Skip to content

Commit

Permalink
Merge #53011
Browse files Browse the repository at this point in the history
53011: batcheval: deflake version-upgrade (again) r=irfansharif a=irfansharif

Fixes #52907. Unskips it as well.

The patch in #52750 was not quite complete. We had zeroed out the
replicated RHS delta appropriately, but forgot to consider the RHS stats
added to the batch then later used to seed RHS state. I re-verified this
patch using the same `splits/mixed-version` test but running for more
iterations.

Release note: None

Co-authored-by: irfan sharif <[email protected]>
  • Loading branch information
craig[bot] and irfansharif committed Aug 19, 2020
2 parents a4286e9 + da99bbb commit 944dbc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion pkg/cmd/roachtest/acceptance.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ func registerAcceptance(r *testRegistry) {
// to head after 19.2 fails.
minVersion: "v19.2.0",
timeout: 30 * time.Minute,
skip: "https://github.com/cockroachdb/cockroach/issues/52907",
},
}
tags := []string{"default", "quick"}
Expand Down
17 changes: 9 additions & 8 deletions pkg/kv/kvserver/batcheval/cmd_end_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,15 @@ func splitTriggerHelper(
return enginepb.MVCCStats{}, result.Result{}, err
}

if !rec.ClusterSettings().Version.IsActive(ctx, clusterversion.VersionAbortSpanBytes) {
// Since the stats here is used to seed the initial state for the RHS
// replicas, we need to be careful about zero-ing out the abort span
// bytes if the cluster version introducing it is not yet active. Not
// doing so can result in inconsistencies in MVCCStats across replicas
// in a mixed-version cluster.
h.AbsPostSplitRight().AbortSpanBytes = 0
}

// Note: we don't copy the queue last processed times. This means
// we'll process the RHS range in consistency and time series
// maintenance queues again possibly sooner than if we copied. The
Expand Down Expand Up @@ -1033,14 +1042,6 @@ func splitTriggerHelper(
if !rec.ClusterSettings().Version.IsActive(ctx, clusterversion.VersionContainsEstimatesCounter) {
deltaPostSplitLeft.ContainsEstimates = 0
}
if !rec.ClusterSettings().Version.IsActive(ctx, clusterversion.VersionAbortSpanBytes) {
// Since the stats here is used to seed the initial state for the RHS
// replicas, we need to be careful about zero-ing out the abort span
// bytes if the cluster version introducing it is not yet active. Not
// doing so can result in inconsistencies in MVCCStats across replicas
// in a mixed-version cluster.
pd.Replicated.Split.RHSDelta.AbortSpanBytes = 0
}
return deltaPostSplitLeft, pd, nil
}

Expand Down

0 comments on commit 944dbc3

Please sign in to comment.