forked from cockroachdb/cockroach
-
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.
74654: loqrecovery: verify pending descriptor changes in raft log r=tbg a=aliher1911 Previously, when generating unsafe loss of quorum recovery plan recovery command could pick replicas that have unapplied changes to local range descriptor. That would cause nodes to crash because of unexpected change. To resolve this, this patch adds a check that would extract information about descriptor changes from raft log and subsequently fail if recovered range would need to use replica with pending descriptor changes. It adds the flag --force to allow creation of the plan when some ranges have potentially dangerous changes. For those cases prompt will provide following info: ``` Found replica inconsistencies: range gap /Table/{59-60} r88: /Table/5{8/1/"washington dc"/"Tz\xe1G\xae\x14L\x00\x80\x00\x00\x00\x00\x00\x00\xa5"-9} r49: /Table/6{0-1} Only proceed as a last resort! Proceed with plan creation [f/N] f Plan created To complete recovery, distribute the plan to the below nodes and invoke `debug recover apply-plan` on: - node n6, store(s) s6 - node n5, store(s) s5 - node n1, store(s) s1 ``` --confirm y together with --force: ``` Found replica inconsistencies: range gap /Table/{59-60} r88: /Table/5{8/1/"washington dc"/"Tz\xe1G\xae\x14L\x00\x80\x00\x00\x00\x00\x00\x00\xa5"-9} r49: /Table/6{0-1} Plan created To complete recovery, distribute the plan to the below nodes and invoke `debug recover apply-plan` on: - node n5, store(s) s5 - node n1, store(s) s1 - node n6, store(s) s6 ``` while --confirm y without --force will result in: ``` Found replica inconsistencies: range gap /Table/{59-60} r88: /Table/5{8/1/"washington dc"/"Tz\xe1G\xae\x14L\x00\x80\x00\x00\x00\x00\x00\x00\xa5"-9} r49: /Table/6{0-1} ERROR: can not create plan because of errors and no --force flag is given Failed running "debug recover make-plan" ``` Fixes: cockroachdb#74630 Co-authored-by: Oleg Afanasyev <[email protected]>
- Loading branch information
Showing
16 changed files
with
1,251 additions
and
85 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
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
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
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
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.