Skip to content

Commit

Permalink
Revert "*: Support learner replica read (pingcap#39979)"
Browse files Browse the repository at this point in the history
This reverts commit a761c02.
  • Loading branch information
v01dstar authored Jan 28, 2023
1 parent 1e0956d commit 4efb37d
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 7 deletions.
Binary file removed cmd/pluginpkg/pluginpkg
Binary file not shown.
2 changes: 0 additions & 2 deletions kv/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ const (
ReplicaReadClosest
// ReplicaReadClosestAdaptive stands for 'read from follower which locates in the same zone if the response size exceeds certain threshold'
ReplicaReadClosestAdaptive
// ReplicaReadLearner stands for 'read from learner'.
ReplicaReadLearner
)

// IsFollowerRead checks if follower is going to be used to read data.
Expand Down
4 changes: 1 addition & 3 deletions sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,7 @@ var defaultSysVars = []*SysVar{
s.NoopFuncsMode = TiDBOptOnOffWarn(val)
return nil
}},
{Scope: ScopeGlobal | ScopeSession, Name: TiDBReplicaRead, Value: "leader", Type: TypeEnum, PossibleValues: []string{"leader", "follower", "leader-and-follower", "closest-replicas", "closest-adaptive", "learner"}, SetSession: func(s *SessionVars, val string) error {
{Scope: ScopeGlobal | ScopeSession, Name: TiDBReplicaRead, Value: "leader", Type: TypeEnum, PossibleValues: []string{"leader", "follower", "leader-and-follower", "closest-replicas", "closest-adaptive"}, SetSession: func(s *SessionVars, val string) error {
if strings.EqualFold(val, "follower") {
s.SetReplicaRead(kv.ReplicaReadFollower)
} else if strings.EqualFold(val, "leader-and-follower") {
Expand All @@ -1794,8 +1794,6 @@ var defaultSysVars = []*SysVar{
s.SetReplicaRead(kv.ReplicaReadClosest)
} else if strings.EqualFold(val, "closest-adaptive") {
s.SetReplicaRead(kv.ReplicaReadClosestAdaptive)
} else if strings.EqualFold(val, "learner") {
s.SetReplicaRead(kv.ReplicaReadLearner)
}
return nil
}},
Expand Down
2 changes: 0 additions & 2 deletions store/driver/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ func GetTiKVReplicaReadType(t kv.ReplicaReadType) storekv.ReplicaReadType {
return storekv.ReplicaReadMixed
case kv.ReplicaReadClosestAdaptive:
return storekv.ReplicaReadMixed
case kv.ReplicaReadLearner:
return storekv.ReplicaReadLearner
}
return 0
}

0 comments on commit 4efb37d

Please sign in to comment.