-
Notifications
You must be signed in to change notification settings - Fork 487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TiKV failover #77
TiKV failover #77
Conversation
/run-e2e-tests |
/run-e2e-tests |
TombStoneStores map[string]TiKVStore `json:"tombStoneStores,omitempty"` | ||
Phase MemberPhase `json:"phase,omitempty"` | ||
StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"` | ||
Stores map[string]TiKVStore `json:"stores,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will Stores
contain failure stores or tombstone stores?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stores
contain failure stores, but don't contain tombstone stores.
pkg/manager/member/tikv_failover.go
Outdated
tc.Status.TiKV.FailureStores = nil | ||
} | ||
|
||
func allTiKVStoressAreReady(tc *v1alpha1.TidbCluster) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/allTiKVStoress/AreReady/allTiKVStoresAreReady/
if tc.Status.TiKV.FailureStores != nil { | ||
tkmm.tikvFailover.Recover(tc) | ||
} | ||
} else if int(tc.Spec.TiKV.Replicas) == int(tc.Status.TiKV.StatefulSet.Replicas) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary cast replicas
to int
|
||
"time" | ||
|
||
. "github.com/onsi/gomega" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add revive instruction for dot-import
.
You can choose whatever you like to follow revive linter suggests.
retool do revive -formatter friendly -config revive.toml pkg/...
|
||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
"time" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you separate the standard library and external library?
pdClient.AddReaction(controller.GetConfigActionType, func(action *controller.Action) (interface{}, error) { | ||
if test.getCfgErr { | ||
return nil, fmt.Errorf("get config failed") | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add else
block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-e2e-tests |
This PR fixes #58, adds TiKV failover feature to TiDB Operator.
@tennix @onlymellb @xiaojingchen @gregwebs PTAL