Skip to content

Share task pagination across bulk dump and load progress queries - #14716

Open
tclinkenbeard-oai wants to merge 1 commit into
apple:mainfrom
tclinkenbeard-oai:dev/tclinkenbeard/bulk-task-pagination
Open

tclinkenbeard-oai wants to merge 1 commit into
apple:mainfrom
tclinkenbeard-oai:dev/tclinkenbeard/bulk-task-pagination

Conversation

@tclinkenbeard-oai

@tclinkenbeard-oai tclinkenbeard-oai commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

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_test cases 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. BulkDumping and BulkLoading passed in simulation with buggify enabled and seed 123456.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS

  • Commit ID: 1fe334a
  • Duration 0:19:32
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-ide on Linux RHEL 9

  • Commit ID: 1fe334a
  • Duration 0:19:38
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS

  • Commit ID: 1fe334a
  • Duration 0:26:38
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang on Linux RHEL 9

  • Commit ID: 1fe334a
  • Duration 0:44:58
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux RHEL 9

  • Commit ID: 1fe334a
  • Duration 0:48:54
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-arm on Linux RHEL 9

  • Commit ID: 1fe334a
  • Duration 0:51:37
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-cluster-tests on Linux RHEL 9

  • Commit ID: 1fe334a
  • Duration 1:30:58
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

@tclinkenbeard-oai tclinkenbeard-oai left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

  1. 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
  2. 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
  3. 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.

@tclinkenbeard-oai
tclinkenbeard-oai marked this pull request as ready for review December 5, 2026 21:28

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants