Commit 996df49
committed
sqs(reaper): polish per Claude review (PR #736, round 1)
Two findings from Claude on PR #736 plus a medium-severity Gemini
suggestion in the same review pass:
1. (Claude must-fix) Stale forward-reference comment in reapPage
was written in PR 6a pointing at PR 6b. PR 6b is now this branch,
so the "is a follow-up to PR 6a" wording was misleading. Trimmed
to a one-line note that reapPage covers the legacy keyspace and
reapPartitionedPage is the partitioned twin.
2. (Claude should-fix) classifyPartitionedByAgeEntry had no direct
coverage of its retention-cutoff branch (live gen, sendTs <=
cutoff -> reapable) or its future-gen guard (parsed.gen >
currentGen -> not reapable). The integration tests exercise the
orphan-cohort and dedup-expiry paths only. Added
TestClassifyPartitionedByAgeEntry: a table-driven unit test that
pins every branch (within retention, past retention, exact-cutoff
boundary, orphan generation, future generation, wrong partition,
wrong queue prefix, legacy key) against deterministic key inputs
built via sqsPartitionedMsgByAgeKey. No store / coordinator
dependency, so the test is fast and immune to retention timing.
3. (Gemini medium) reapExpiredDedup used an if/else to pick between
legacy and partitioned dedup reaping for partitioned queues,
while reapQueue runs both for symmetry and defensive coverage of
leaked legacy entries. Mirrored that policy: legacy scan now
always runs (cheap on an empty prefix today), and the partitioned
scan additionally runs for partitioned queues. Caller audit:
reapExpiredDedup has a single caller (reapAllQueues) and the
error contract is unchanged, so no semantic ripple.
Refs: PR #736 review thread; Claude review at run 25327783108.1 parent 80f1c86 commit 996df49
2 files changed
Lines changed: 103 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
| 622 | + | |
| 623 | + | |
626 | 624 | | |
627 | 625 | | |
628 | 626 | | |
| |||
731 | 729 | | |
732 | 730 | | |
733 | 731 | | |
734 | | - | |
735 | | - | |
736 | | - | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
737 | 741 | | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
738 | 745 | | |
739 | 746 | | |
740 | 747 | | |
741 | | - | |
| 748 | + | |
742 | 749 | | |
743 | 750 | | |
744 | 751 | | |
| |||
0 commit comments