Skip to content

Publish commits before notifying the change feed, and fix CI - #49

Merged
venkat1701 merged 7 commits into
mainfrom
fix/publish-before-feed
Oct 5, 2026
Merged

venkat1701 merged 7 commits into
mainfrom
fix/publish-before-feed

Conversation

@venkat1701

Copy link
Copy Markdown
Collaborator

CI has been failing or getting cancelled after most merges since #25. Three separate causes.

1. A real race in the engine (the build failures). SecurityTest.materializedViewsStayInsideTheirTenant failed on 6 of the last 12 merges, always at the 5 s deadline. The group-commit flusher appended a commit to the change feed before making it the current generation. A subscriber could react to generation g while new transactions still saw g - 1. Since #25, continuous views look up each changed atom's tenant in their own snapshot. A not-yet-visible edge was skipped, and the view still advanced past it, so the change was lost from the view for good. It shows up on 2-core runners and almost never on a fast machine.

  • The flusher now sets current first, then appends to the feed.
  • MaterializedViews.refresh replays only up to min(feed.lastGeneration(), own snapshot). That closes the narrower case where a later commit lands between the writer starting and the refresh. This is what SemanticPlane already does.
  • docs/storage/change-feed.md described the old order as deliberate. I checked every place that combines a snapshot with the feed, and none depends on it. The doc now states the new guarantee: a subscriber can always read the commit it's told about.
  • New EngineTest.subscribersSeeTheCommitTheyAreToldAbout: four subscribers watch 500 commits. Against the old ordering it failed in 5 of 6 runs; with the fix it passed every run.

2. Merges cancelling each other (the cancelled runs). For a merged PR, github.ref is main, so every merge shared one concurrency group and cancelled the previous merge's native and docker jobs. Grouped by PR number now.

3. Docker cache saves (the docker failures). failed to reserve cache when overlapping runs wrote the same cache entry. The image itself had built fine every time. cache-to now has ignore-error=true, here and in the release workflow.

Also includes the README tweak that drops the venue from the paper reference.

Full ./mvnw install passes locally (92 tests), and each commit compiles on its own.

The flusher appended the commit event to the feed and only then made the
generation current, so a subscriber could react to generation g while new
transactions still saw g - 1. Continuous views then looked up atoms that
weren't visible yet and skipped their changes for good. Publishing first
means a subscriber can always read the commit it is told about.
Four subscribers watch 500 commits and record any event whose generation
is ahead of the current one. Against the old ordering it caught the race
in 5 of 6 runs.
refresh replayed events up to the feed's last generation but checked
tenants against the writer's snapshot, so a commit landing in between
could still be skipped. Events past the snapshot are left for the next
notification, as SemanticPlane already does.
For a merged pull request github.ref is main, so every merge shared one
concurrency group and cancelled the previous merge's native and docker
jobs. Group by pull request instead. A failed cache upload no longer
fails a docker build that otherwise succeeded.
@venkat1701
venkat1701 merged commit 2094e92 into main Oct 5, 2026
@venkat1701
venkat1701 deleted the fix/publish-before-feed branch October 6, 2026 00:55
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