CultNet: a replica applies the changes of one server commit as one cache commit; a refused commit faults the client
The database publishes commits (WatchCommits); the subscription server and the database server tag the changes a subscription receives from one commit with commitId and commitCount (optional wire fields older peers ignore). The C# subscription client buffers a tagged commit and applies it through one CultCache.Commit, judged on its result, so a swap of [CultIndex] values replicates. A refusal sets Fault, raises Faulted, and stops further applying. Snapshots apply as one commit too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d53778288b
commit
3a5df75a07
9 changed files with 632 additions and 93 deletions
|
|
@ -140,6 +140,12 @@ A malformed put or delete is `message_invalid`, not a per-operation code: the pe
|
|||
- A shard snapshot represents a log sequence. Applying it replaces the local
|
||||
shard view and advances the replica cursor to that sequence.
|
||||
- Realtime subscriptions publish domain changes, not storage envelopes.
|
||||
- A subscription's `database_change_raw` messages may carry `commitId` and `commitCount`: the changes of one cache
|
||||
commit that this subscription delivers (`commitCount` of them, at least two). Both fields are optional and additive; a
|
||||
peer that does not know them ignores them and applies each change alone. A replica that knows them applies the
|
||||
commit's changes as one commit, so the replica judges the result (a swap of two unique-index values) and not the state
|
||||
between records. A replica whose cache refuses a commit is faulted, never silent. `commitId` is opaque and valid only
|
||||
within the subscription. The C# subscription server and database server tag commits; other runtimes adopt next.
|
||||
- Client-owned input documents may be predicted locally only inside explicit
|
||||
`CultNetClientAuthorityScope` declarations.
|
||||
- Predicted input state is not authoritative shared state. The shard log still
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@
|
|||
"changeKind": { "enum": ["added", "updated", "removed"] },
|
||||
"document": { "$ref": "./cultnet.raw-document-record.schema.json" },
|
||||
"recordKey": { "type": "string", "minLength": 1 },
|
||||
"schemaId": { "type": "string", "minLength": 1 }
|
||||
"schemaId": { "type": "string", "minLength": 1 },
|
||||
"commitId": { "type": "string", "minLength": 1 },
|
||||
"commitCount": { "type": "integer", "minimum": 2 }
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue