Skip to content

Commit

Permalink
roachtest: include learner snapshot error in isExpectedRelocateError …
Browse files Browse the repository at this point in the history
…whitelist

Fixes #40359.

We occasionally see the error "failed to apply snapshot: raft group deleted"
during a RELOCATE RANGE statement. This occurs because the newly added learner
attempts to send a raft message to another node after it has been removed and
then destroys itself in response to a ReplicaTooOldError. We have a similar
case in TestLearnerAdminChangeReplicasRace.

Release justification: Testing only.

Release note: None
  • Loading branch information
nvanbenschoten committed Oct 9, 2019
1 parent d14d69f commit 14784b6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/cmd/roachtest/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,15 @@ func isExpectedRelocateError(err error) bool {
// for more failure modes not caught here. We decided to avoid adding
// to this catchall and to fix the root causes instead.
// We've also seen "breaker open" errors here.
return testutils.IsError(err, "(descriptor changed|unable to remove replica .* which is not present|unable to add replica .* which is already present|received invalid ChangeReplicasTrigger .* to remove self)")
whitelist := []string{
"descriptor changed",
"unable to remove replica .* which is not present",
"unable to add replica .* which is already present",
"received invalid ChangeReplicasTrigger .* to remove self",
"failed to apply snapshot: raft group deleted",
}
pattern := "(" + strings.Join(whitelist, "|") + ")"
return testutils.IsError(err, pattern)
}

func accountDistribution(r *rand.Rand) *rand.Zipf {
Expand Down

0 comments on commit 14784b6

Please sign in to comment.