Commit 25061d6
committed
keyviz: synthetic virtual bucket IDs + scoped prune cancel
Codex round-11 P2 #1: cancelPendingPrune ran unconditionally at the
top of RegisterRoute. When a removed virtual member rejoined as an
individual slot (capacity freed up), the cancel suppressed the only
cleanup path for the old bucket's MemberRoutes — leaving the routeID
listed on the bucket forever despite no longer contributing traffic.
Replace with cancelPendingPruneFor(bucket, routeID), called only
after we know the route is rejoining the same bucket; prunes against
other buckets (or where the route lands as an individual slot) fire
normally and clean up the old bucket's metadata.
Codex round-11 P2 #2: a freshly created virtual bucket stamped its
RouteID with the first folded real route ID. If that real route was
later removed and re-registered as an individual slot, flushed
columns could show two rows with the same RouteID — one aggregate,
one individual. Add an atomic.Uint64 virtualIDCounter on MemSampler
and hand out synthetic IDs from the high end of uint64
(MaxUint64, MaxUint64-1, …). The synthetic space cannot collide with
real route IDs (assigned from the low end by the coordinator), so
row identity stays unambiguous under churn.
Claude bot nit: rename the local `bytes` variable in Observe to
`byteCount` so it no longer shadows the new `bytes` stdlib import.
Tests: TestVirtualBucketRouteIDIsSynthetic + TestRejoinAsIndividualLetsBucketPruneFire.1 parent 41ab078 commit 25061d6
2 files changed
Lines changed: 121 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
138 | 146 | | |
139 | 147 | | |
140 | 148 | | |
| |||
317 | 325 | | |
318 | 326 | | |
319 | 327 | | |
320 | | - | |
| 328 | + | |
321 | 329 | | |
322 | | - | |
| 330 | + | |
323 | 331 | | |
324 | 332 | | |
325 | | - | |
| 333 | + | |
326 | 334 | | |
327 | 335 | | |
328 | 336 | | |
329 | 337 | | |
330 | | - | |
331 | | - | |
| 338 | + | |
| 339 | + | |
332 | 340 | | |
333 | 341 | | |
334 | 342 | | |
335 | | - | |
336 | | - | |
| 343 | + | |
| 344 | + | |
337 | 345 | | |
338 | 346 | | |
339 | 347 | | |
| |||
345 | 353 | | |
346 | 354 | | |
347 | 355 | | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
353 | 362 | | |
354 | 363 | | |
355 | 364 | | |
356 | 365 | | |
357 | 366 | | |
358 | 367 | | |
359 | 368 | | |
360 | | - | |
361 | | - | |
362 | 369 | | |
363 | 370 | | |
364 | 371 | | |
| |||
388 | 395 | | |
389 | 396 | | |
390 | 397 | | |
391 | | - | |
| 398 | + | |
392 | 399 | | |
393 | 400 | | |
394 | 401 | | |
| |||
398 | 405 | | |
399 | 406 | | |
400 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
401 | 413 | | |
402 | 414 | | |
403 | 415 | | |
| |||
567 | 579 | | |
568 | 580 | | |
569 | 581 | | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
576 | 594 | | |
577 | 595 | | |
578 | 596 | | |
579 | 597 | | |
580 | | - | |
| 598 | + | |
581 | 599 | | |
582 | 600 | | |
583 | 601 | | |
| |||
586 | 604 | | |
587 | 605 | | |
588 | 606 | | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
589 | 619 | | |
590 | 620 | | |
591 | 621 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
689 | 758 | | |
690 | 759 | | |
691 | 760 | | |
| |||
0 commit comments