-
Notifications
You must be signed in to change notification settings - Fork 221
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
debugpb: support fail point #200
Conversation
LGTM |
proto/debugpb.proto
Outdated
@@ -99,3 +103,22 @@ message ScanMvccResponse { | |||
bytes key = 1; | |||
kvrpcpb.MvccInfo info = 2; | |||
} | |||
|
|||
message Failure { | |||
enum Type { |
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.
Maybe we should figure out a better name.
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 two methods instead, one for setting and one for removal.
proto/debugpb.proto
Outdated
message Failure { | ||
enum Type { | ||
INVALID = 0; | ||
INJECT = 1; |
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.
Should we remove INVALID
and set INJECT
as default?
proto/debugpb.proto
Outdated
} | ||
|
||
message FailPointRequest { | ||
repeated Failure failures = 1; |
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.
Should it be one request for one failure?
Let's consider failures [A, B, C]
, we may set A and B successfully but C failed, so what should we do? Revert A and B then return error to client? But it is possible that A or B is already be triggered.
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.
Just one should be OK.
PTAL @BusyJay |
proto/debugpb.proto
Outdated
@@ -38,6 +38,10 @@ service Debug { | |||
// Note: DO NOT CALL IT IN PRODUCTION, it's really expensive. | |||
// Server uses keys directly w/o any encoding. | |||
rpc ScanMvcc(ScanMvccRequest) returns (stream ScanMvccResponse) {} | |||
|
|||
// Inject fail points. Currently, it only used in tests. |
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/it/it's/
proto/debugpb.proto
Outdated
} | ||
|
||
message FailPointRequest { | ||
repeated Failure failures = 1; |
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.
Just one should be OK.
proto/debugpb.proto
Outdated
@@ -99,3 +103,22 @@ message ScanMvccResponse { | |||
bytes key = 1; | |||
kvrpcpb.MvccInfo info = 2; | |||
} | |||
|
|||
message Failure { | |||
enum Type { |
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 two methods instead, one for setting and one for removal.
PTAL |
LGTM |
LGTM |
LGTM |
Fail point API for injecting failures!