Skip to content

[dbsp] Limit checkpoint fingerprints to the JS-safe 53-bit range - #6844

Closed
blp wants to merge 2 commits into
mainfrom
53bit-fingerprint
Closed

[dbsp] Limit checkpoint fingerprints to the JS-safe 53-bit range#6844
blp wants to merge 2 commits into
mainfrom
53bit-fingerprint

Conversation

@blp

@blp blp commented Aug 11, 2026

Copy link
Copy Markdown
Member

fda's REST client generates the CheckpointMetadata.fingerprint field as i64 from the OpenAPI schema, so a checkpoint whose 64-bit fingerprint has the high bit set breaks fda pipelines/fda status for the whole instance (#6841). Add a Fingerprint newtype that masks to 0..2**53 both when a circuit computes a fresh fingerprint and when one is deserialized, so checkpoints already on disk get corrected on load instead of only new ones.

Also add a migration to mask any checkpoint fingerprint already cached in a pipeline's storage_status_details: a stopped pipeline has no running worker to send a fresh status report, so its last-cached value would otherwise stay out of range indefinitely.

Fixes #6841

Describe Manual Test Plan

Tested a sample migration

Checklist

  • Unit tests added/updated
  • Integration tests added/updated
  • Documentation updated
  • Changelog updated

fda's REST client generates the CheckpointMetadata.fingerprint field as
i64 from the OpenAPI schema, so a checkpoint whose 64-bit fingerprint
has the high bit set breaks `fda pipelines`/`fda status` for the whole
instance (#6841). Add a Fingerprint newtype that masks to 0..2**53 both
when a circuit computes a fresh fingerprint and when one is
deserialized, so checkpoints already on disk get corrected on load
instead of only new ones.

Also add a migration to mask any checkpoint fingerprint already cached
in a pipeline's storage_status_details: a stopped pipeline has no
running worker to send a fresh status report, so its last-cached value
would otherwise stay out of range indefinitely.

Fixes #6841

Signed-off-by: Ben Pfaff <blp@feldera.com>
@blp
blp requested a review from gz August 11, 2026 23:14
@blp blp self-assigned this Aug 11, 2026
@blp blp added bug Something isn't working DBSP core Related to the core DBSP library API Distributed system APIs Pipeline manager Pipeline manager (API, API server, runner, compiler server) CLI Feldera CLI (fda) - related issues rust Pull requests that update Rust code labels Aug 11, 2026
Signed-off-by: feldera-bot <feldera-bot@feldera.com>

@mihaibudiu mihaibudiu left a comment

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.

The only thing I don't understand is exactly how migration will happen for older checkpoints, but I don't know that part of the code.

#[derive(Debug, Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Fingerprint(u64);

/// The derive can't express `maximum` for a tuple struct (utoipa only allows

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.

This comment could be just the last line

-- gets a fresh status report to pick up that fix, so its last-cached
-- `storage_status_details` can still hold an out-of-range value. Mask any
-- checkpoint fingerprint already stored here the same way.
UPDATE pipeline

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.

it makes sense, just wonder if it's even worth to run an explicit migration for it

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.

Well, we don't have to, if you don't care whether fda pipelines works with older pipelines.

Comment thread openapi.json
"type": "integer",
"format": "int64",
"description": "Fingerprint of the circuit at the time of the checkpoint.",
"description": "Fingerprint of the circuit at the time of the checkpoint, limited to 0..2**53 to stay within JavaScript's safe integer range.",

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.

isn't javascript a great language

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.

I wonder why this is a javascript problem since it's the fda rust? binding that fails

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.

Depends on whether we might want to use the fingerprints from the web console someday. If we don't care, then we don't have to do this.

);
}

#[cfg(feature = "testing")]

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.

is this supposed to be behind a testing gate?

@@ -0,0 +1,37 @@
-- `storage_status_details` embeds each checkpoint's fingerprint as a plain

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.

it seems we already have a V36_ in the repo (i believe they need to be unique and incrementing for things to work)

@blp

blp commented Aug 12, 2026

Copy link
Copy Markdown
Member Author

@gz There's a much simpler fix if we only care about fda and Rust, by just adding #[schema(format = "uint64")] in the right place I think. I'm happy to do that instead, if you think it's appropriate.

@blp

blp commented Aug 12, 2026

Copy link
Copy Markdown
Member Author

Closing in favor of #6850

@blp blp closed this Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Distributed system APIs bug Something isn't working CLI Feldera CLI (fda) - related issues DBSP core Related to the core DBSP library Pipeline manager Pipeline manager (API, API server, runner, compiler server) rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fda cannot parse pipelines whose checkpoint fingerprint exceeds i64::MAX

4 participants