Skip to content

Commit a01be33

Browse files
craig[bot]wenyihu6fqazi
committed
146129: kvserver: revert add NoReplicasMoved to AdminScatterResponse r=kvoli a=wenyihu6 **Revert "backup: add warning when no replica moved from AdminScatter"** This commit reverts 519f22c. We found that the number of replicas moved is not a reliable criterion for DR to rely on for retries. We're exploring alternative responses. As a simple example, in a 3-node single-store cluster with RF=3, it is expected for AdminScatter to move zero replicas. DR should not retry just because numnber of replicas moved is zero. Epic: none Release note: none --- **Revert "kvpb: add NoReplicasMoved to AdminScatterResponse"** This commit reverts 8f00544. We found that the number of replicas moved is not a reliable criterion for DR to rely on for retries. We're exploring alternative responses. As a simple example, in a 3-node single-store cluster with RF=3, it is expected for AdminScatter to move zero replicas. DR should not retry just because numnber of replicas moved is zero. Epic: none Release note: none 146219: roachtest: deflake declarative_schema_changer/job-compatibility-mixed-version r=fqazi a=fqazi Previously, the job compatibility test could run into flakes because it reduced the GC TTL to one second. This could cause some system database queries to fail during upgrade preconditions. To address this, this patch leaves a 1-minute GC TTL on the system database, which prevents the low TTL from interfering with internal operations for upgrades. Fixes: #144920 Release note: None Co-authored-by: wenyihu6 <[email protected]> Co-authored-by: Faizan Qazi <[email protected]>
3 parents a26e4d8 + ccebf07 + 5a59d1c commit a01be33

File tree

5 files changed

+6
-29
lines changed

5 files changed

+6
-29
lines changed

pkg/backup/generative_split_and_scatter_processor.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -212,26 +212,11 @@ func (s dbSplitAndScatterer) scatter(
212212
// throughput.
213213
log.Errorf(ctx, "failed to scatter span [%s,%s): %+v",
214214
newScatterKey, newScatterKey.Next(), pErr.GoError())
215-
} else {
216-
// Log at INFO level when scatter request is rejected because the range is
217-
// non-empty (range size exceeds req.MaxSize). This is expected during
218-
// RESTORE resume.
219-
log.Infof(ctx, "failed to scatter span [%s,%s): %+v",
220-
newScatterKey, newScatterKey.Next(), pErr.GoError())
221215
}
222216
return 0, nil
223217
}
224218

225-
scatteredResp, ok := res.(*kvpb.AdminScatterResponse)
226-
if !ok {
227-
log.Fatalf(ctx, "expected AdminScatterResponse, got %T", res)
228-
}
229-
if scatteredResp.NoReplicasMoved {
230-
// TODO(#144856): DR should consider retrying the scatter if no replicas
231-
// were moved.
232-
log.Warningf(ctx, "no replicas moved during scatter")
233-
}
234-
return s.findDestination(scatteredResp), nil
219+
return s.findDestination(res.(*kvpb.AdminScatterResponse)), nil
235220
}
236221

237222
// findDestination returns the node ID of the node of the destination of the

pkg/cmd/roachtest/tests/mixed_version_job_compatibility_in_declarative_schema_changer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ func setShortJobIntervalsStep(
5757
func setShortGCTTLInSystemZoneConfig(
5858
ctx context.Context, l *logger.Logger, r *rand.Rand, h *mixedversion.Helper,
5959
) error {
60+
// Ensure the system database has a longer TTL interval, which is needed to avoid
61+
// flakes on system database queries for upgrades.
62+
if err := h.Exec(r, "ALTER DATABASE system CONFIGURE ZONE USING gc.ttlseconds=60;"); err != nil {
63+
return err
64+
}
6065
return h.Exec(r, "ALTER RANGE default CONFIGURE ZONE USING gc.ttlseconds = 1;")
6166
}
6267

pkg/kv/kvpb/api.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ func (r *AdminScatterResponse) combine(_ context.Context, c combinable, _ *Batch
626626
r.RangeInfos = append(r.RangeInfos, otherR.RangeInfos...)
627627
r.MVCCStats.Add(otherR.MVCCStats)
628628
r.ReplicasScatteredBytes += otherR.ReplicasScatteredBytes
629-
r.NoReplicasMoved = r.NoReplicasMoved && otherR.NoReplicasMoved
630629
}
631630
return nil
632631
}

pkg/kv/kvpb/api.proto

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,13 +1974,6 @@ message AdminScatterResponse {
19741974
// scattered
19751975
int64 replicas_scattered_bytes = 5;
19761976

1977-
// NoReplicasMoved indicates whether no replicas were moved during the scatter
1978-
// operation. NB: this needs to be a separate field, since we can't reliably
1979-
// infer "no replica moved" from ReplicasScatteredBytes == 0. Empty ranges
1980-
// have stats.Total() == 0 and ReplicasScatteredBytes will be 0 regardless of
1981-
// whether any replicas were moved.
1982-
bool no_replicas_moved = 6;
1983-
19841977
// NB: if you add a field here, don't forget to update combine().
19851978
}
19861979

pkg/kv/kvserver/replica_command.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4266,11 +4266,6 @@ func (r *Replica) adminScatter(
42664266
// that were moved so the value may not be entirely accurate, but it is
42674267
// adequate.
42684268
ReplicasScatteredBytes: stats.Total() * int64(numReplicasMoved),
4269-
// NB: this needs to be a separate field, since we can't reliably infer
4270-
// "no replica moved" from ReplicasScatteredBytes == 0. Empty ranges have
4271-
// stats.Total() == 0 and ReplicasScatteredBytes will be 0 regardless of
4272-
// whether any replicas were moved.
4273-
NoReplicasMoved: numReplicasMoved == 0,
42744269
}, nil
42754270
}
42764271

0 commit comments

Comments
 (0)