This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
feat(dup): support multiple fail modes for duplication #429
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
levy5307
reviewed
Mar 26, 2020
levy5307
reviewed
Mar 26, 2020
levy5307
reviewed
Mar 26, 2020
src/dist/replication/lib/duplication/test/load_from_private_log_test.cpp
Outdated
Show resolved
Hide resolved
levy5307
reviewed
Mar 26, 2020
src/dist/replication/lib/duplication/test/load_from_private_log_test.cpp
Show resolved
Hide resolved
levy5307
reviewed
Mar 26, 2020
src/dist/replication/lib/duplication/test/load_from_private_log_test.cpp
Outdated
Show resolved
Hide resolved
levy5307
reviewed
Mar 26, 2020
src/dist/replication/test/meta_test/unit_test/meta_duplication_service_test.cpp
Show resolved
Hide resolved
levy5307
previously approved these changes
Mar 26, 2020
acelyc111
reviewed
Mar 26, 2020
@@ -43,6 +43,15 @@ namespace replication { | |||
return it->second; | |||
} | |||
|
|||
/*extern*/ const char *duplication_fail_mode_to_string(duplication_fail_mode::type fmode) | |||
{ | |||
auto it = _duplication_fail_mode_VALUES_TO_NAMES.find(fmode); |
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.
duplication_fail_mode::type is just a struct enum, you can set any value you like. If you set a invalid value, server will coredump here?
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.
Yes, if so, something must be wrong. Fail early is necessary.
acelyc111
reviewed
Mar 26, 2020
acelyc111
approved these changes
Mar 27, 2020
levy5307
approved these changes
Mar 27, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new concept, namely "fail_mode" for duplication, in case of permanent failure occurred, fail-modes will allow flexible and extensible failure handling strategies.
replication.thrift
We currently support 3 fail-modes.
FAIL_SLOW: the default mode that uses monitoring to report failure, requires human interference, like downgrade the failing primary, to solve the problem.
FAIL_SKIP: skip the failing file (when the file is corrupted), or failing RPC (the remote cluster is possibly down). This mode is useful for those who care high availability more than data safety.
FAIL_FAST: Certainly, fail-fast (suicide and coredump) is always the simplest error handling, but not ops-friendly, its blast-radius will cover many the irrelevant replicas on the server.
Users are able to dynamically change the fail mode by 'modify_dup', using shell command 'update_fail_mode'.