Commit 3b1e9fa
Merge #153373
153373: kvserver: resolve range-size backpressure preventing spanconfig updates r=iskettaneh a=dodeca12
This PR ensures that all spanconfig updates bypass the backpressure mechanism. This is done by excluding the `system.span_configurations` table from backpressurable spans by splitting the backpressurable range around it.
#### Implementation
##### Commit 1: Reproduce the Issue
- Added comprehensive test TestSpanConfigUpdatesBlockedByRangeSizeBackpressureOnDefaultRanges that reproduces the catch-22 scenario
- The test repeatedly writes spanconfig updates for a single key until the range becomes too large to split, triggering backpressure
- Demonstrates how spanconfig updates (including protected timestamp deletions) get blocked by backpressure:
```log
W250910 14:26:03.302675 144058 kv/kvserver/replica_backpressure.go:263 [T1,Vsystem,n1,s1,r77/1:/Table/4{7/1/"\xf…-8}] 481 applying backpressure to limit range growth on batch Put [/Table/47/1/"\xfa"/0], [txn: cfbe5191], [can-forward-ts]
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 ERROR! BREAKING OUT OF LOOP, numWrites successful: 62690, error: upsert-span-cfgs: split failed while applying backpressure to Put [/Table/47/1/"\xfa"/0], [txn: cfbe5191], [can-forward-ts] on range r77:/Table/4{7/1/"\xfa"-8} [(n1,s1):1, next=2, gen=1]: could not find valid split key
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 +(1) attached stack trace
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 + -- stack trace:
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 + | github.com/cockroachdb/cockroach/pkg/sql.(*InternalExecutor).execInternal.func1.1
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 + | pkg/sql/internal.go:1260
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 + | github.com/cockroachdb/cockroach/pkg/sql.(*rowsIterator).Close
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 + | pkg/sql/internal.go:608
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 + | github.com/cockroachdb/cockroach/pkg/sql.(*rowsIterator).Next
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 + | pkg/sql/internal.go:584
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 + | github.com/cockroachdb/cockroach/pkg/sql.(*InternalExecutor).execIEStmt
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 + | pkg/sql/internal.go:872
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 + | github.com/cockroachdb/cockroach/pkg/sql.(*InternalExecutor).ExecEx
I250910 14:26:03.304650 50 kv/kvserver_test/client_spanconfig_backpressure_test.go:209 [-] 482 + | pkg/sql/internal.go:820
.
.
.
```
##### Commit 2:
- **Modified `backpressurableSpans`** in `replica_backpressure.go`: Split the original backpressurable span `{SystemConfigTableDataMax, TableDataMax}` into two spans that exclude the span_configurations table:
- `{SystemConfigTableDataMax, span_configurations_table_start}`
- `{span_configurations_table_end, TableDataMax}`
- **Added explanatory comments**: Documented that this prevents catch-22 situations where protected timestamp updates or garbage collection TTL updates are blocked by backpressure
- **Updated test expectations**: Modified the aforementioned test to expect that spanconfig updates should succeed (bypass backpressure) rather than fail
Expected behaviour - any span config updates now bypass the range-size backpressure mechanism.
Fixes: #146982
Release note: None
Co-authored-by: Swapneeth Gorantla <swapneeth.gorantla@cockroachlabs.com>File tree
3 files changed
+248
-3
lines changed- pkg
- keys
- kv/kvserver
3 files changed
+248
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
377 | 381 | | |
378 | 382 | | |
379 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| 40 | + | |
32 | 41 | | |
33 | 42 | | |
34 | 43 | | |
| |||
332 | 341 | | |
333 | 342 | | |
334 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
0 commit comments