Repository navigation
Share task pagination across bulk dump and load progress queries - #14716
tclinkenbeard-oai wants to merge 1 commit into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Result of foundationdb-pr-macos-m1 on macOS
|
Result of foundationdb-pr-clang-ide on Linux RHEL 9
|
Result of foundationdb-pr-macos on macOS
|
Result of foundationdb-pr-clang on Linux RHEL 9
|
Result of foundationdb-pr on Linux RHEL 9
|
Result of foundationdb-pr-clang-arm on Linux RHEL 9
|
Result of foundationdb-pr-cluster-tests on Linux RHEL 9
|
tclinkenbeard-oai
left a comment
There was a problem hiding this comment.
Generated by Codex.
What problem is this PR trying to solve? (ELI10)
Three progress queries count jobs from a list that can span several pages. Imagine one page ends at m and the next starts at m. Counting the task starting at m on both pages would inflate the total. Each query had its own copy of the rule for where to stop and resume.
How does this PR solve the problem? (ELI10 and review walkthrough)
Read pages in one shared loop and let each query count the tasks it cares about. The task at m counts on the second page.
- The query lends its transaction to the scanner and waits for it. The scanner retries the current page with the same transaction options and retry budget. The range-map defaults supply the previous row and byte limits. Page read and retry · Default limits
- A page represents intervals between adjacent keys. The scanner visits nonempty values before the final boundary and copies that boundary into an owning key before the page goes away. The range-map reader asks for at least two rows and supplies the final end boundary. Range read · Final boundary · Continuation
- The callbacks decode values while the page is alive. Dump queries count phases and completed bytes. Load progress retains an owning stalled-task range and includes acknowledged bytes in completion. Dump counts · Dump progress · Load progress · Owned range
What is it trying to do?
Factor the common range-map pagination and keep each query’s accounting local.
Is it correct?
Yes. A read failure occurs before any visitor runs for that page, so retrying cannot count it twice. Each caller awaits the helper while its transaction and accumulator are alive. The visitor is synchronous. The scan stays linear in the number of returned intervals, with one helper coroutine per query and one page live at a time. The stored task format and returned progress fields match the base.
I reviewed the code without running builds, tests or simulations. All 10 currently listed public checks passed on 1fe334a3. Three earlier Linux builds timed out without diagnostic logs, leaving their causes inconclusive. Earlier macOS contention for the CI runner lock was unrelated to the patch. Checks at this commit · Build timeout · Runner lock
Are there bugs?
I found no correctness bug. As before, retrying at a newer read version can observe a changing job across pages.
Are there omissions?
The PR reports a multi-page probe covering clipping, gaps, byte totals and stalled ranges with both row and byte limits. Those cases exercise the continuation boundary directly.
Are there better ways of doing things?
Keep the helper private. The dump and load callbacks have different definitions of completion and should stay visible beside their respective queries.
Should this CL be LGTMd?
Yes, LGTM. The two main risks are duplicate counts on continuation and borrowed values escaping a page. The last-boundary rule and owning result fields address both.
The dump task counts used by backup and both management progress queries each implemented the same scan over a task range map. Move the page read, retry budget and continuation key into one private helper. Each query still decodes the appropriate task type and accumulates its own counts.
The scanner uses the caller's transaction and the existing KRM limits. It visits non-empty values only after the page read succeeds. The last key is the start of the next page, so the helper copies that boundary into an owning key and excludes it from the current page's counts.
All 188
fdbclient_testcases passed. I linked a standalone probe against the updated client and read task metadata on a disposable 8.0.1 cluster with the KRM row limit set to three. The scan took four pages. I checked all three queries, including a clipped range, an empty task interval, byte totals and the retained metadata for a stalled load.Repeating the probe with a one-byte KRM limit exercised seven pages with the same results.
BulkDumpingandBulkLoadingpassed in simulation with buggify enabled and seed 123456.