Repository navigation
Gate INSERT activating-merge behind the INSERT_MERGE feature - #415
Conversation
777a840 to
ee1a454
Compare
Follow-up concern: loss of payload-deterministic (pre-WAL) INSERT validationFolding merge into Snapshot
Merge The only way to keep both properties is to keep them as two operations: snapshot Open question for reviewers: does any WAL/CDC consumer or bulk client actually rely on " |
60a1d12 to
ec907e5
Compare
INSERT / UPDATE / DELETE: v2 vs v3 (before) vs v3 (this PR), summarized
This PR touches exactly one cell — INSERT's "omitted" row, snapshot → merge — which is what brings INSERT back in line with v2. UPDATE and DELETE were already identical between v2 and v3 and stay that way. The two remaining structural v2/v3 differences are both on DELETE and are pre-existing, out of scope for this PR: v3 keeps |
ec907e5 to
6a05971
Compare
6a05971 to
024a321
Compare
|
Rollout note: #430 added the database-level feature gate, and this PR puts the INSERT merge semantics behind it — enabled per database via |
975b153 to
d06c262
Compare
For a database enabled for INSERT_MERGE via actionbase.feature-flags, INSERT becomes an activating merge: an omitted field keeps its value, an explicit null clears it, and only INSERT activates the row. Without the feature, INSERT keeps snapshot semantics, so ungated databases are unaffected and pre-gate WAL entries replay identically. - StateExtensions.transit(insertMerge): INSERT branches between merge and snapshot - MutationRequestValidator: INSERT_MERGE relaxes INSERT to present-only nullability; an activated row left incomplete fails at transit (InvalidMutationException) - MutationService: resolves the feature once per request via the injected FeatureFlags; permanent failures surface as a per-item INVALID status - Wire MutationService to Graph.featureFlags in GraphConfiguration Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
d06c262 to
815e39c
Compare
|
Optimistic |
Summary
For a database enabled for
INSERT_MERGEviaactionbase.feature-flags(#432), INSERT becomes an activating merge: an omitted field keeps its existing value, an explicit null clears it, and only INSERT activates the row. This lets multi-source fan-in writers each INSERT the subset of fields they own without clobbering each other.Without the feature (default), INSERT keeps snapshot semantics — ungated databases are unaffected, pre-gate WAL entries replay identically, and the completeness check keeps its original
IllegalArgumentException(surfaced asERROR).Behavior on an existing row,
email = "[email protected]"(nullable):{email:"b"}"b""b""b"{email:null}null(clear)null(clear)null{}(omitted)null(cleared)"[email protected]"(kept)Changes
StateExtensions.transit(insertMerge): INSERT branches between merge and snapshot property handling. The active-row completeness check throwsInvalidMutationExceptiononly underinsertMerge; the default path keeps its originalIllegalArgumentException, so ungated behavior is unchangedMutationRequestValidator: with the feature, INSERT relaxes to present-only nullability validation; explicit null on a non-nullable field still fails pre-WAL. Completeness of an activated row is enforced at transit (permanent)MutationService: resolves the feature once per request via the injectedFeatureFlags(has(Scope(database), INSERT_MERGE)); a permanently invalid mutation surfaces as a per-itemINVALIDstatus (vs transientERROR), detected across the exception cause chainGraphConfiguration: wiresMutationServicetoGraph.featureFlagsInsertMergeTest; newEdgeMutationInsertMergeTestpins the gated pipeline end to endHow to Test
./gradlew :core:test --tests "*InsertMergeTest"— merge goldens./gradlew :engine:test --tests "com.kakao.actionbase.v2.engine.v3.MutationServiceSpec"— per-itemINVALIDand fan-in merge through the RMW pipeline./gradlew :server:test --tests "com.kakao.actionbase.server.api.graph.v3.EdgeMutationInsertMergeTest"— E2E with the feature enabled via configAI Assistance