Repository navigation
Preserve SYNC response contract under systemMutationMode=ASYNC - #336
Merged
Merged
Conversation
em3s
force-pushed
the
feat/issue-335-sync-contract-under-system-async
branch
from
May 15, 2026 13:03
b1f2858 to
dbf0d66
Compare
…e=ASYNC `systemMutationMode=ASYNC` is a temporary, system-wide override that routes every mutation through the WAL-only queue path. Under this override every response is `QUEUED` — even for `SYNC` tables — which breaks clients that expect `CREATED` / `UPDATED` / `DELETED` / `IDLE` and have not been updated to handle `QUEUED`. When the system override is `ASYNC` and the table's own mode is `SYNC`, derive the response status from the request's `EventType`: INSERT → CREATED UPDATE → UPDATED DELETE → DELETED Tables whose own mode is `ASYNC` keep returning `QUEUED`. Mutations are still queued via the WAL — only the response status changes. The status is intent-based (last-write wins by version, mirroring the SYNC fold winner) and never `IDLE`; the SYNC path's state-diff status is a coarser approximation under this override, so the same input can yield different status under `force=true SYNC` vs. `system=ASYNC` override. Acceptable since the override is itself a temporary operational tool. `force=true` short-circuits to `QUEUED` so clients that explicitly choose ASYNC still receive the async-shaped response they asked for. Tests: - MutationServiceSystemAsyncSpec: SYNC EDGE/MULTI_EDGE INSERT/UPDATE/DELETE return operation-based status; ASYNC tables and `force=true + request=SYNC` paths unchanged; multi-event same-version and ascending-version cases lock the stable-sort winner; `force=true + request=ASYNC` on SYNC EDGE returns QUEUED. - EdgeMutationForceSyncTest: SYNC-table E2E now expects CREATED. Closes #335
em3s
force-pushed
the
feat/issue-335-sync-contract-under-system-async
branch
from
May 15, 2026 13:04
dbf0d66 to
e543089
Compare
Contributor
Author
|
Optimistic merging. |
5 tasks done
em3s
added a commit
that referenced
this pull request
May 15, 2026
em3s
added a commit
that referenced
this pull request
May 15, 2026
(cherry picked from commit 295c79b)
This was referenced May 16, 2026
em3s
added a commit
that referenced
this pull request
May 16, 2026
When systemMutationMode=ASYNC overrides a table whose own mode is SYNC, derive the response status from the request's EdgeOperation (INSERT -> CREATED, UPDATE -> UPDATED, DELETE -> DELETED, PURGE -> PURGED) instead of returning QUEUED. Tables whose own mode is ASYNC keep returning QUEUED. Mutations are still queued via the WAL. Backport of #336 to v2.engine.Graph. Closes #339 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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
When
systemMutationMode=ASYNCoverrides a table whose own mode isSYNC, derive the response status from the request'sEdgeOperation(INSERT → CREATED,UPDATE → UPDATED,DELETE → DELETED) instead of returningQUEUED. Tables whose own mode isASYNCkeep returningQUEUED. Mutations are still queued via the WAL — only the response status changes.Closes #335
Changes
MutationServiceforsystem=ASYNC + label=SYNCMutationServiceSystemAsyncSpec— expect operation-based status for SYNC tables, add UPDATE/DELETE coverageEdgeMutationForceSyncTest— adjust the SYNC-table queue expectationHow to Test
./gradlew :engine:test --tests "*MutationServiceSystemAsyncSpec"./gradlew :server:test --tests "*EdgeMutationForceSyncTest"./gradlew buildAI Assistance