Skip to content

Commit e1266f9

Browse files
committed
kvserver: allowlist spanconfig updates to bypass range-size backpressure
This commit modifies `backpressurableSpans` to exclude the `system.span_configurations` table by splitting the original span into two ranges that create a gap around the `system.span_configurations` table. This allows spanconfig updates to bypass backpressure entirely, preventing the catch-22 deadlock. Fixes: #146982 Release note: None
1 parent 65900fa commit e1266f9

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

pkg/kv/kvserver/client_spanconfig_backpressure_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ func TestSpanConfigUpdatesBlockedByRangeSizeBackpressureOnDefaultRangesWithKVAcc
218218
}
219219

220220
// Assert that the operation failed due to backpressure.
221-
require.Error(t, err, "Expected span config writes to fail due to backpressure, but they succeeded")
222-
log.Dev.Infof(ctx, "Verified that span config writes fail due to backpressure: %v\n", err)
221+
require.NoError(t, err, "Expected span config writes to NOT be backpressured")
222+
log.Dev.Infof(ctx, "Verified that span config writes NOT be backpressured")
223223

224224
log.Dev.Infof(ctx, "Completed %d direct KV writes\n", i)
225225

@@ -244,7 +244,7 @@ func TestSpanConfigUpdatesBlockedByRangeSizeBackpressureOnDefaultRangesWithKVAcc
244244
if smallSpancofnRecordWriteErr != nil {
245245
log.Dev.Infof(ctx, "ERROR: smallSpancofnRecord write failed: %v\n", smallSpancofnRecordWriteErr)
246246
}
247-
require.Error(t, smallSpancofnRecordWriteErr, "Expected smallSpancofnRecord write to succeed")
248-
log.Dev.Infof(ctx, "SUCCESS: smallSpancofnRecord write failed as expected; still getting backpressure\n")
247+
require.NoError(t, smallSpancofnRecordWriteErr, "Expected smallSpancofnRecord write to succeed (spanconfigs should bypass backpressure)")
248+
log.Dev.Infof(ctx, "SUCCESS: smallSpancofnRecord write succeeded as expected (spanconfigs bypassed backpressure)\n")
249249

250250
}

pkg/kv/kvserver/replica_backpressure.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ var backpressurableSpans = []roachpb.Span{
9090
{Key: keys.TimeseriesPrefix, EndKey: keys.TimeseriesKeyMax},
9191
// Backpressure from the end of the system config forward instead of
9292
// over all table data to avoid backpressuring unsplittable ranges.
93-
{Key: keys.SystemConfigTableDataMax, EndKey: keys.TableDataMax},
93+
// Note: The above comment is no longer true.
94+
// Split the span to exclude the span_configurations table to avoid
95+
// catch-22 situations where protected timestamp updates or garbage
96+
// collection TTL updates are blocked by backpressure.
97+
{Key: keys.SystemConfigTableDataMax, EndKey: keys.SystemSQLCodec.TablePrefix(keys.SpanConfigurationsTableID)},
98+
{Key: keys.SystemSQLCodec.TablePrefix(keys.SpanConfigurationsTableID + 1), EndKey: keys.TableDataMax},
9499
}
95100

96101
// canBackpressureBatch returns whether the provided BatchRequest is eligible

0 commit comments

Comments
 (0)