feat(eventcore-fs): local-ingestion cursor for projections #398
No reviewers
Labels
No labels
adr
automated
bug
chore
dependencies
documentation
enhancement
epic
github-actions
P1-high
P2-medium
P3-low
release
research
rust
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Slipstream/eventcore!398
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/391-local-ingestion-cursor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements issue #391 / ADR-0043 part (c): a per-replica local-ingestion-order cursor so live cursor-based projections never rewind or miss events after a structural
git merge.Problem
EventReader::read_eventskeyed pagination on the canonical per-event UUID7. Agit mergecan union in a transaction whose canonical linearized position falls earlier than a cursor a projection already advanced past — so that event was silently skipped. That is read-model corruption.Change
StreamPositionUUID so positions sort by sequence.index/directory, so a projection checkpoint stays valid across reopen.read_eventsnow delivers events in local-ingestion order and returns local-ingestion positions.read_streamis unchanged (canonical linearized order) and remains the convergent, cross-replica-identical view; merge-convergence tests assert convergence viaread_stream.Acceptance (ADR-0043)
blueprints/fs-merge-mode.md.Tests
projection_after_merge_test.rs:live_projection_does_not_miss_a_merge_introduced_earlier_event(red→green via forced adverse id ordering) andtopology_rebuild_projection_matches_the_live_projection_state.cargo nextest run --workspace: 236 passed. clippy/fmt clean.Closes #391
This PR introduces a local-ingestion-order cursor to ensure projections do not miss events after a
git merge. The changes appear well-implemented and tested, focusing on maintaining event order per replica. Ensure all parts of the codebase handle the new structures and return types correctly.Walkthrough
indexdirectory toRootsstruct for storing ingestion logs.by_ingestionvector to maintain local-ingestion order and updated index building logic.EventStoreandEventReaderimplementations to use local-ingestion order.LLM usage and cost
Estimated total USD: $0.063521 via https://api.openai.com and https://api.openai.com
Pre-merge checks
The PR introduces a local-ingestion-order cursor to ensure projections do not miss events after a
git merge. The change tosort_by_keyinindex.rsimproves readability and performance. The update appears safe to merge.Walkthrough
Δ since
d0aecc3:sort_bytosort_by_keyfor sorting events by position, enhancing code clarity and efficiency.LLM usage and cost
Estimated total USD: $0.012070 via https://api.openai.com
Pre-merge checks
feat(eventcore-fs): local-ingestion-order cursor for projections (ADR-0043)to feat(eventcore-fs): local-ingestion cursor for projections@auto-review re-review
The only blocking item was the PR title length; it has been shortened to 58 characters (ADR reference moved to the body).
Queued a forced review at
c8c8a56f2b. This intentionally bypasses CI gating; watch the commit-status badge for progress.This PR introduces a local-ingestion order cursor to ensure projections do not miss events after a
git merge. The changes appear well-structured and include comprehensive tests to validate the new behavior. Ensure that the persistence of the ingestion log is robust to prevent data corruption.Walkthrough
indexdirectory to theRootsstruct for storing ingestion logs.build_indexfunction to handle ingestion logs.IngestionLogstruct to manage local-ingestion sequences and their persistence.append_eventsandmergemethods to persist ingestion logs.LLM usage and cost
Estimated total USD: $0.066106 via https://api.openai.com and https://api.openai.com
@ -0,0 +159,4 @@// be strictly greater than the nil UUID so the first event is reachable.assert!(position_from_seq(1) > Uuid::nil());}}🟡 Warning: The
IngestionLogstruct and its methods are central to maintaining the local-ingestion order. Ensure that the log is correctly persisted and loaded, especially in scenarios involving concurrent writes or failures.@ -316,26 +325,31 @@ impl EventReader for FileEventStore {let prefix = filter.stream_prefix();🟡 Warning: The
append_eventsmethod now persists new entries to the ingestion log. Ensure that this persistence is atomic and handles failures gracefully to prevent data corruption.@ -539,15 +553,24 @@ impl FileEventStore {detail: "index lock poisoned".to_string(),🟡 Warning: The
mergemethod now persists new entries to the ingestion log. Ensure that this persistence is atomic and handles failures gracefully to prevent data corruption.