-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
tests: Add SIGKILL functional test #13924
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -260,6 +260,9 @@ enum Operation { | |
// SIGQUIT_ETCD_AND_REMOVE_DATA kills etcd process and removes all data | ||
// directories to simulate destroying the whole machine. | ||
SIGQUIT_ETCD_AND_REMOVE_DATA = 21; | ||
// SIGKILL_ETCD kills etcd process while keeping data directories | ||
// and previous etcd configurations. | ||
SIGKILL_ETCD = 22; | ||
|
||
// SAVE_SNAPSHOT is sent to trigger local member to download its snapshot | ||
// onto its local disk with the specified path from tester. | ||
|
@@ -426,6 +429,8 @@ enum Case { | |
// each member must be able to process client requests. | ||
SIGQUIT_AND_REMOVE_QUORUM_AND_RESTORE_LEADER_SNAPSHOT_FROM_SCRATCH = 14; | ||
|
||
SIGKILL_FOLLOWER = 15; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SIGKILL_ONE_FOLLOWER? The same as above. |
||
SIGKILL_LEADER = 16; | ||
// BLACKHOLE_PEER_PORT_TX_RX_ONE_FOLLOWER drops all outgoing/incoming | ||
// packets from/to the peer port on a randomly chosen follower | ||
// (non-leader), and waits for "delay-ms" until recovery. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,6 +174,30 @@ func recover_SIGQUIT_ETCD_AND_REMOVE_DATA(clus *Cluster, idx1 int) error { | |
return err | ||
} | ||
|
||
func inject_SIGKILL(clus *Cluster, index int) error { | ||
clus.lg.Info( | ||
"disastrous machine failure START", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (SIGKILL) |
||
zap.String("target-endpoint", clus.Members[index].EtcdClientEndpoint), | ||
) | ||
err := clus.sendOp(index, rpcpb.Operation_SIGKILL_ETCD) | ||
clus.lg.Info( | ||
"disastrous machine failure END", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SIGKILL |
||
zap.String("target-endpoint", clus.Members[index].EtcdClientEndpoint), | ||
zap.Error(err), | ||
) | ||
return err | ||
} | ||
|
||
func recover_SIGKILL(clus *Cluster, idx1 int) error { | ||
err := clus.sendOp(idx1, rpcpb.Operation_RESTART_ETCD) | ||
clus.lg.Info( | ||
"restart machine", | ||
zap.String("target-endpoint", clus.Members[idx1].EtcdClientEndpoint), | ||
zap.Error(err), | ||
) | ||
return err | ||
} | ||
|
||
func new_Case_SIGQUIT_AND_REMOVE_ONE_FOLLOWER(clus *Cluster) Case { | ||
cc := caseByFunc{ | ||
rpcpbCase: rpcpb.Case_SIGQUIT_AND_REMOVE_ONE_FOLLOWER, | ||
|
@@ -187,6 +211,24 @@ func new_Case_SIGQUIT_AND_REMOVE_ONE_FOLLOWER(clus *Cluster) Case { | |
} | ||
} | ||
|
||
func new_Case_SIGKILL_FOLLOWER() Case { | ||
cc := caseByFunc{ | ||
rpcpbCase: rpcpb.Case_SIGKILL_FOLLOWER, | ||
injectMember: inject_SIGKILL, | ||
recoverMember: recover_SIGKILL, | ||
} | ||
return &caseFollower{cc, -1, -1} | ||
} | ||
|
||
func new_Case_SIGKILL_LEADER() Case { | ||
cc := caseByFunc{ | ||
rpcpbCase: rpcpb.Case_SIGKILL_LEADER, | ||
injectMember: inject_SIGKILL, | ||
recoverMember: recover_SIGKILL, | ||
} | ||
return &caseLeader{cc, -1, -1} | ||
} | ||
|
||
func new_Case_SIGQUIT_AND_REMOVE_ONE_FOLLOWER_UNTIL_TRIGGER_SNAPSHOT(clus *Cluster) Case { | ||
return &caseUntilSnapshot{ | ||
rpcpbCase: rpcpb.Case_SIGQUIT_AND_REMOVE_ONE_FOLLOWER_UNTIL_TRIGGER_SNAPSHOT, | ||
|
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.
SIGKILL_ONE_FOLLOWER
so as to keep the naming consistent as the existingSIGTERM_ONE_FOLLOWER
andSIGQUIT_AND_REMOVE_ONE_FOLLOWER
?