Reduce sequence-assignment allocator round trips - #1373
Draft
JackWilb wants to merge 8 commits into
Draft
Conversation
…-startup-performance # Conflicts: # src/storage/tests/highLevelSupabase.spec.ts # src/storage/tests/primitivesSupabase.spec.ts
…erformance' into codex/1322-reduce-allocator-round-trips
Contributor
|
A preview of 8044ab2 is uploaded and can be seen here: ✨ https://revisit.dev/study/PR1373 ✨ Changes may take a few minutes to propagate. |
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
allocate_sequence_assignmentRPC that commits allocator state, reusable-slot claims, and the participant assignment togetherWhy
The bounded allocator from #1311 still serialized provider reads before its atomic reservation step. Firebase read participant and allocator state before reading them again in the transaction, while Supabase separately selected, claimed, reserved, and created rows. Those extra request/response cycles remained on fresh participant startup.
This change moves Supabase allocation into one database transaction and removes Firebase's duplicated document pre-read phase while preserving atomic assignment, FIFO rejected-slot reuse, legacy compatibility, bounded contention failure, and startup recovery when participant-data persistence fails after assignment.
Stack dependency
This PR targets
devbut is stacked on #1311 becausedevdoes not yet contain the bounded allocator that #1322 optimizes. The #1322 implementation is isolated in commit086a1c5b; merge #1311 first so this PR's review diff collapses to the allocator round-trip changes.Deployment
supabase/migrations/20260730000000_allocate_sequence_assignment.sqlbefore enabling the one-RPC Supabase path.firestore.indexes.jsonto each Firebase project so rejected candidates can be selected deterministically by assignment timestamp.Validation
yarn unittest --run— 2,054 passed, 1 skippedyarn typecheckyarn lintyarn buildgit diff --checkLive before/after HAR capture was unavailable because the development environment does not have authenticated Firebase and Supabase study credentials.
SEQUENCE_ASSIGNMENT_ALLOCATION.mdrecords the expected provider-operation traces and the production verification still needed after deploying the migration and index.Closes #1322.