Skip to content

[dbsp] Avoid race updating checkpoint catalog file. - #6751

Closed
blp wants to merge 1 commit into
mainfrom
checkpoint-race-fix
Closed

[dbsp] Avoid race updating checkpoint catalog file.#6751
blp wants to merge 1 commit into
mainfrom
checkpoint-race-fix

Conversation

@blp

@blp blp commented Jul 29, 2026

Copy link
Copy Markdown
Member

Commit 92b29a4 ("[dbsp] Avoid repeatedly listing files in storage with no checkpoints.") changed Checkpointer::read_checkpoints() to write an empty checkpoint file if it found that one did not exist. A failing CI run demonstrated that this in fact introduced a race against checkpoint synchronization.

This commit fixes the problem by using a different approach: instead of writing a checkpoint catalog file, we only do the full scan of the directory once at startup instead of every time we try to read the catalog. This still accomplishes the original goal of avoiding doing a full directory scan every time.

Fixes: #6750

@blp
blp requested a review from mihaibudiu July 29, 2026 16:53
@blp blp self-assigned this Jul 29, 2026
@blp blp added bug Something isn't working storage Persistence for internal state in DBSP operators rust Pull requests that update Rust code enterprise Issue related to Feldera Enterprise features. labels Jul 29, 2026
Comment thread crates/dbsp/src/circuit/checkpointer.rs Outdated
/// while the checkpoints themselves are likely still on disk, and
/// proceeding would let `gc_startup` recursively delete them, so we refuse
/// to start instead.
fn read_checkpoints_for_startup(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"for startup" or "at startup"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I guess at_startup is a little better. Updated.

@blp
blp force-pushed the checkpoint-race-fix branch from 96c0729 to 67e5573 Compare July 29, 2026 17:18
Commit 92b29a4 ("[dbsp] Avoid repeatedly listing files in storage with
no checkpoints.") changed Checkpointer::read_checkpoints() to write an
empty checkpoint file if it found that one did not exist.  A failing
CI run demonstrated that this in fact introduced a race against
checkpoint synchronization.

This commit fixes the problem by using a different approach: instead of
writing a checkpoint catalog file, we only do the full scan of the
directory once at startup instead of every time we try to read the catalog.
This still accomplishes the original goal of avoiding doing a full
directory scan every time.

Fixes: #6750

Signed-off-by: Ben Pfaff <blp@feldera.com>
@blp
blp force-pushed the checkpoint-race-fix branch from 67e5573 to 72e2760 Compare July 29, 2026 17:18
@blp
blp enabled auto-merge July 29, 2026 17:18
@blp
blp added this pull request to the merge queue Jul 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 29, 2026
@mihaibudiu

Copy link
Copy Markdown
Contributor

This passed for me previously, maybe you can give more memory to datafusion in the failing test?

@blp

blp commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

This passed for me previously, maybe you can give more memory to datafusion in the failing test?

I'll submit a PR for that failure too.

@blp
blp added this pull request to the merge queue Jul 29, 2026
@blp

blp commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

This passed for me previously, maybe you can give more memory to datafusion in the failing test?

#6754

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 29, 2026
@blp

blp commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

Closing this because I'm merging it as part of #6754

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

Labels

bug Something isn't working enterprise Issue related to Feldera Enterprise features. rust Pull requests that update Rust code storage Persistence for internal state in DBSP operators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[qa] test_bucket_preferred_over_read_bucket non-deterministic test failure

2 participants