Commit d8dec00
Merge #152697
152697: kvserver: track priority inversion in replicate queue metrics r=tbg a=wenyihu6
Part of: #151847
Resolves: #152022
Release note: none
----
**kvserver: track priority inversion in replicate queue metrics**
Previously, replicas could be enqueued at a high priority but end up processing
a lower-priority actions, causing priority inversion and unfairness to other
replicas behind them that needs a repair action. This commit adds metrics to
track such cases. In addition, this commit also adds metrics to track when
replicas are requeued in the replicate queue due to a priority inversion from a
repair action to a rebalance action.
---
**kvserver: add TestPriorityInversionRequeue**
Previously, we added priority inversion requeuing mechanism.
This commit adds a unit test that forces the race condition we suspected to be
happening in escalations involving priority inversion and asserts that priority
inversion occurs and that the replica is correctly requeued. Test set up:
1. range’s leaseholder replica is rebalanced from one store to another.
2. new leaseholder enqueues the replica for repair with high priority (e.g. to
finalize the atomic replication change or remove a learner replica)
3. before processing, the old leaseholder completes the change (exits the joint
config or removes the learner).
4. when the new leaseholder processes the replica, it computes a
ConsiderRebalance action, resulting in a priority inversion and potentially
blocking other high-priority work.
---
**kvserver: delete per action priority inversion metrics**
This commit removes per-action priority inversion metrics due to their high
cardinality. We already have logging in place, which should provide sufficient
observability. For now, we care about is priority inversion that leads to
consider rebalance and requeuing the most.
Co-authored-by: wenyihu6 <wenyi@cockroachlabs.com>File tree
5 files changed
+163
-0
lines changed- docs/generated/metrics
- pkg/kv/kvserver
5 files changed
+163
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13951 | 13951 | | |
13952 | 13952 | | |
13953 | 13953 | | |
| 13954 | + | |
| 13955 | + | |
| 13956 | + | |
| 13957 | + | |
| 13958 | + | |
| 13959 | + | |
| 13960 | + | |
| 13961 | + | |
| 13962 | + | |
| 13963 | + | |
| 13964 | + | |
| 13965 | + | |
| 13966 | + | |
| 13967 | + | |
| 13968 | + | |
| 13969 | + | |
13954 | 13970 | | |
13955 | 13971 | | |
13956 | 13972 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
1004 | 1007 | | |
1005 | 1008 | | |
1006 | 1009 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
325 | 341 | | |
326 | 342 | | |
327 | 343 | | |
| |||
344 | 360 | | |
345 | 361 | | |
346 | 362 | | |
| 363 | + | |
347 | 364 | | |
348 | 365 | | |
349 | 366 | | |
| |||
381 | 398 | | |
382 | 399 | | |
383 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
384 | 405 | | |
385 | 406 | | |
386 | 407 | | |
| |||
417 | 438 | | |
418 | 439 | | |
419 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
420 | 444 | | |
421 | 445 | | |
422 | 446 | | |
| |||
955 | 979 | | |
956 | 980 | | |
957 | 981 | | |
| 982 | + | |
958 | 983 | | |
959 | 984 | | |
960 | 985 | | |
961 | 986 | | |
962 | 987 | | |
963 | 988 | | |
| 989 | + | |
964 | 990 | | |
965 | 991 | | |
966 | 992 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2540 | 2540 | | |
2541 | 2541 | | |
2542 | 2542 | | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
538 | 542 | | |
539 | 543 | | |
540 | 544 | | |
| |||
0 commit comments