Commit e28d90b
fix(backfill): stop recording a resume cursor the sampled segment can never consume (#10238)
recent_merged_pull_requests is the only progressiveHistory segment and the only one
whose terminal status is 'sampled'. Three independent gates make that status
unresumable: complete+hasMore maps to 'sampled' rather than 'running';
canResumePreviousScan accepts only running/partial/waiting_rate_limit, so both a
stored nextCursor and an explicitly passed cursor are ignored and startPage falls
back to 1; and the automatic resume re-send is scoped to labels/open_issues/
open_pull_requests while the cron only dispatches light/full.
So the nextCursor this segment faithfully recorded was written and never read.
Confirmed on edge-nl-01: a resume run with an explicit cursor '11' against a segment
at next_cursor=11 re-crawled pages 1-10, persisted nothing new, and handed back the
same cursor it started with.
Takes the second of the two options on #10209: accept the rolling-window design and
remove the misleading bookkeeping, rather than making 'sampled' resumable. Nothing
consumes the deep history -- every reader goes through listRecentMergedPullRequests,
which is ORDER BY merged_at DESC LIMIT 200 -- so option 1 would build machinery to
satisfy a claim no caller makes.
expectedCount is deliberately kept: 'this window holds N of the M closed PRs GitHub
reports' is a true coverage statement. It only misleads when read as progress toward
M, which is exactly what the now-absent cursor signals.
No behaviour change to the crawl itself: sampled is not a fresh status, so
conditionalRequestForSegment already returned undefined for it regardless of the
cursor, and the 304 fast path is untouched.
Closes #10209
Co-authored-by: JSONbored <aetherealdev@gmail.com>1 parent ee1b86e commit e28d90b
2 files changed
Lines changed: 75 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1712 | 1712 | | |
1713 | 1713 | | |
1714 | 1714 | | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
1715 | 1720 | | |
1716 | 1721 | | |
1717 | 1722 | | |
| |||
1814 | 1819 | | |
1815 | 1820 | | |
1816 | 1821 | | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
1817 | 1841 | | |
1818 | 1842 | | |
1819 | 1843 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
4052 | 4053 | | |
4053 | 4054 | | |
4054 | 4055 | | |
| 4056 | + | |
| 4057 | + | |
| 4058 | + | |
| 4059 | + | |
| 4060 | + | |
| 4061 | + | |
| 4062 | + | |
| 4063 | + | |
| 4064 | + | |
| 4065 | + | |
| 4066 | + | |
| 4067 | + | |
| 4068 | + | |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
| 4074 | + | |
| 4075 | + | |
| 4076 | + | |
| 4077 | + | |
| 4078 | + | |
| 4079 | + | |
| 4080 | + | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
| 4090 | + | |
| 4091 | + | |
| 4092 | + | |
| 4093 | + | |
| 4094 | + | |
| 4095 | + | |
| 4096 | + | |
| 4097 | + | |
| 4098 | + | |
| 4099 | + | |
| 4100 | + | |
| 4101 | + | |
| 4102 | + | |
| 4103 | + | |
| 4104 | + | |
| 4105 | + | |
4055 | 4106 | | |
4056 | 4107 | | |
4057 | 4108 | | |
| |||
0 commit comments