Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fdb): conflict ranges #2063

Conversation

MasterPtato
Copy link
Contributor

Changes

Copy link

cloudflare-workers-and-pages bot commented Feb 21, 2025

Deploying rivet with  Cloudflare Pages  Cloudflare Pages

Latest commit: dc1d8cc
Status:🚫  Build failed.

View logs

Copy link

Deploying rivet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7b6ec47
Status:🚫  Build failed.

View logs

Copy link
Contributor Author

MasterPtato commented Feb 21, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR fixes critical issues with FoundationDB transaction conflict range handling across multiple services and utilities in the Rivet platform.

  • Added new end_of_key_range utility function in fdb-util that properly appends a 0 byte to end keys for single-key conflict ranges
  • Fixed lease expiration conflict detection in workflow engine by using proper end keys in fdb_sqlite_nats/mod.rs
  • Updated port allocation conflict ranges in ds/allocate_ingress_ports.rs to prevent concurrent allocation issues
  • Corrected client reservation conflict handling in Pegboard service to maintain data consistency during concurrent transactions
  • Fixed allocation index update conflict ranges in Pegboard to ensure proper transaction isolation

8 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +84 to +89
pub fn end_of_key_range(key: &[u8]) -> Vec<u8> {
let mut end_key = Vec::with_capacity(key.len() + 1);
end_key.extend_from_slice(key);
end_key.push(0);
end_key
}
Copy link

Choose a reason for hiding this comment

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

style: Consider using Vec::from(key) followed by push(0) for better readability and potentially better performance since it avoids an extra copy

@MasterPtato MasterPtato force-pushed the 02-21-fix_fdb_conflict_ranges branch from 7b6ec47 to 403b5c7 Compare February 21, 2025 02:27
@MasterPtato MasterPtato force-pushed the feat_add_basic_websocket_load_testing branch from b2020df to 0e11e7a Compare March 5, 2025 20:49
@MasterPtato MasterPtato force-pushed the 02-21-fix_fdb_conflict_ranges branch from c0ae31a to dc1d8cc Compare March 5, 2025 20:55
@MasterPtato MasterPtato mentioned this pull request Mar 5, 2025
@NathanFlurry NathanFlurry force-pushed the 02-21-fix_fdb_conflict_ranges branch from dc1d8cc to c3470c3 Compare March 5, 2025 23:56
@NathanFlurry NathanFlurry force-pushed the feat_add_basic_websocket_load_testing branch from 1ff560c to 745d6de Compare March 5, 2025 23:56
@MasterPtato MasterPtato force-pushed the 02-21-fix_fdb_conflict_ranges branch from c3470c3 to dc1d8cc Compare March 6, 2025 00:50
@NathanFlurry NathanFlurry force-pushed the 02-21-fix_fdb_conflict_ranges branch from dc1d8cc to c3470c3 Compare March 6, 2025 01:32
@MasterPtato MasterPtato force-pushed the 02-21-fix_fdb_conflict_ranges branch from c3470c3 to dc1d8cc Compare March 6, 2025 02:38
@NathanFlurry NathanFlurry force-pushed the 02-21-fix_fdb_conflict_ranges branch from dc1d8cc to c3470c3 Compare March 6, 2025 03:30
Copy link
Contributor

graphite-app bot commented Mar 6, 2025

Merge activity

  • Mar 5, 10:33 PM EST: A user added this pull request to the Graphite merge queue.
  • Mar 5, 10:35 PM EST: CI is running for this PR on a draft PR: #2125
  • Mar 5, 10:37 PM EST: A user merged this pull request with the Graphite merge queue via draft PR: #2125.

graphite-app bot pushed a commit that referenced this pull request Mar 6, 2025
<!-- Please make sure there is an issue that this PR is correlated to. -->

## Changes

<!-- If there are frontend changes, please include screenshots. -->
@graphite-app graphite-app bot closed this Mar 6, 2025
@graphite-app graphite-app bot deleted the 02-21-fix_fdb_conflict_ranges branch March 6, 2025 03:37
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.

1 participant