Skip to content

Commit

Permalink
Merge pull request #99244 from erikgrinaker/23.1-ignore-sysbytes
Browse files Browse the repository at this point in the history
release-23.1: kvnemesis: ignore `SysBytes` mismatch
  • Loading branch information
erikgrinaker authored Mar 22, 2023
2 parents fdd1e88 + b8462ce commit 1352ad2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/kv/kvnemesis/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,17 @@ func (e *Env) CheckConsistency(ctx context.Context, span roachpb.Span) []error {
if err := rows.Scan(&rangeID, &key, &status, &detail); err != nil {
return []error{err}
}
// TODO(erikgrinaker): There's a known issue that can result in a 10-byte
// discrepancy in SysBytes. This hasn't been investigated, but it's not
// critical so we ignore it for now. See:
// https://github.com/cockroachdb/cockroach/issues/93896
// TODO(erikgrinaker): There's a known issue that can result in a SysBytes
// discrepancy due to lease requests racing with merges. Ignore them for
// now, see: https://github.com/cockroachdb/cockroach/issues/93896
if status == kvpb.CheckConsistencyResponse_RANGE_CONSISTENT_STATS_INCORRECT.String() {
m := regexp.MustCompile(`.*\ndelta \(stats-computed\): \{(.*)\}`).FindStringSubmatch(detail)
if len(m) > 1 {
delta := m[1]
// Strip out LastUpdateNanos and all zero-valued fields.
delta = regexp.MustCompile(`LastUpdateNanos:\d+`).ReplaceAllString(delta, "")
delta = regexp.MustCompile(`\S+:0\b`).ReplaceAllString(delta, "")
if regexp.MustCompile(`^\s*SysBytes:10\s*$`).MatchString(delta) {
if regexp.MustCompile(`^\s*SysBytes:\S+(\s+SysCount:\S+)?\s*$`).MatchString(delta) {
continue
}
}
Expand Down

0 comments on commit 1352ad2

Please sign in to comment.