forked from apache/kudu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KUDU-2274. Shut down tombstoned replica when replacing it
Failing to shut down a tombstoned replica after copying it can lead to unfortunate interleavings resulting in the replica ending up in an inconsistent state. This actually occurred in a test environment, although it proved very hard to reproduce. This patch includes several changes in addition to shutting down tombstoned replicas before replacing them: * Remove the thread safety properties of the ConsensusMetadata class ConsensusMetadata doesn't need to be thread-safe, even though it is ref-counted, because it is required to be externally synchronized. This patch replaces the mutex with a DFAKE_MUTEX from the thread collision warner utility class in order to easily detect concurrent access due to buggy external sychronization. * Also improve destructor state checks in TabletReplica. * Fix another case of unlocked cmeta access by TSTabletManager. These fixes were verified by running tombstoned_voting-stress-test with 4 CPU stress threads on the dist-test cluster after applying only the ConsensusMetadata thread-safety portion of this patch, and then again with the unlocked access fix and shutdown portions of this patch. After removing the cmeta mutex only (186/200 failed): http://dist-test.cloudera.org/job?job_id=mpercy.1518077234.135005 This full patch (200/200 succeeded): http://dist-test.cloudera.org/job?job_id=mpercy.1518078690.66599 Change-Id: Ia8d086c3fba52826ebe0d3a44842d53ecb6a9265 Reviewed-on: http://gerrit.cloudera.org:8080/9246 Tested-by: Kudu Jenkins Reviewed-by: Alexey Serbin <[email protected]>
- Loading branch information
Showing
6 changed files
with
87 additions
and
155 deletions.
There are no files selected for viewing
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
Oops, something went wrong.