storage: don't crash when applying ChangeReplicas trigger with DeprecatedNextReplicaID#41148
Conversation
bdarnell
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r1.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)
ajwerner
left a comment
There was a problem hiding this comment.
Nice test. Thanks for picking this up
Reviewed 1 of 2 files at r1.
Reviewable status:complete! 0 of 0 LGTMs obtained
pkg/storage/replica_application_state_machine.go, line 675 at r1 (raw file):
// providing a new range descriptor directly, which includes this info. var nextReplID roachpb.ReplicaID if change.Desc != nil {
I could see adding a method to the ChangeReplicasTrigger to hide this migration.
…atedNextReplicaID Fixes cockroachdb#41145. This bug was introduced in cockroachdb#40892. This may force us to pick a new SHA for the beta. Any ChangeReplicas Raft entry from 19.1 or before is going to crash a node without it. Release justification: fixes a crash in mixed version clusters. Release note: None
8f9657e to
15f5b81
Compare
nvb
left a comment
There was a problem hiding this comment.
bors r+
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @bdarnell)
pkg/storage/replica_application_state_machine.go, line 675 at r1 (raw file):
Previously, ajwerner wrote…
I could see adding a method to the ChangeReplicasTrigger to hide this migration.
This is only used here, so I think I'd rather call it out where it's needed.
41148: storage: don't crash when applying ChangeReplicas trigger with DeprecatedNextReplicaID r=nvanbenschoten a=nvanbenschoten Fixes #41145. This bug was introduced in #40892. This may force us to pick a new SHA for the beta. Any ChangeReplicas Raft entry from 19.1 or before is going to crash a node without it. Release justification: fixes a crash in mixed version clusters. Release note: None Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
Build succeeded |
… trigger Fixes cockroachdb#41155. The fix in cockroachdb#41148 avoided a crash when staging a ChangeReplicas trigger with a DeprecatedNextReplicaID in an application batch, but there was another bug where applying the side-effects of such a command still caused a crash. This commit fixes the crash and extends the test added in cockroachdb#41148 to go through the whole process of applying the command (which would have caught the second crash as well). Release justification: fixes a crash in mixed version clusters. Release note: None
41171: storage: don't crash when applying side-effects of old ChangeReplicas trigger r=nvanbenschoten a=nvanbenschoten Fixes #41155. Fixes #41147. The fix in #41148 avoided a crash when staging a ChangeReplicas trigger with a DeprecatedNextReplicaID in an application batch, but there was another bug where applying the side-effects of such a command still caused a crash. This commit fixes the crash and extends the test added in #41148 to go through the whole process of applying the command (which would have caught the second crash as well). Release justification: fixes a crash in mixed version clusters. Release note: None Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
Fixes #41145.
This bug was introduced in #40892.
This may force us to pick a new SHA for the beta. Any ChangeReplicas
Raft entry from 19.1 or before is going to crash a node without it.
Release justification: fixes a crash in mixed version clusters.
Release note: None