Cut 4 Soul 4d: a skipped entry is relayed as the primary sent it; probes, wire cases and the closed-enum rule committed
F1: RecordUnappliedEntry keeps the primary's wire entry on the in-memory log entry (internal Relayed) and ToLogEntryMessage returns it through the same normalisation the store uses, so a replica with no store no longer relays a skipped put as a delete; memory and disk relay identically. Soul's 4d probes are committed (chained replica keeps the row, key-prefixed reads serve only owned keys, primary-all serves everything; the two measurements are explicit) with a memory/disk relay-parity test. Rust: captured-bytes cases for unowned_schema and variant_unsupported (with and without a subscription). The error-code set is stated as a closed enum in the schema description (both copies) and in cultnet-distributed-database.md: adding a code is one coordinated change across runtimes, since Rust and TypeScript refuse an unknown code. The Soul 4c probe file's header says what it guards. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
784dc7d614
commit
3f942a57e7
7 changed files with 266 additions and 4 deletions
|
|
@ -437,6 +437,10 @@ namespace GameCult.Networking
|
|||
/// Gets the previous document, when present.
|
||||
/// </summary>
|
||||
public object? PreviousDocument { get; }
|
||||
|
||||
// The primary's own wire entry, kept for an entry this replica changed nothing for (a row its shard does not own, an
|
||||
// absent key): it is relayed downstream exactly as the primary sent it, in memory and on disk alike.
|
||||
internal CultNetShardLogEntryMessage? Relayed { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -1819,13 +1823,18 @@ namespace GameCult.Networking
|
|||
{
|
||||
RecordMutationLogEntry(new CultNetShardMutationLogEntry(
|
||||
shard.ShardId, shard.Epoch, entry.Sequence, entry.CommittedAt, kind,
|
||||
schemaId, key, document: null, previousDocument: null), entry);
|
||||
schemaId, key, document: null, previousDocument: null) { Relayed = entry }, entry);
|
||||
_lastWriteSequence[(schemaId, key.Value)] = entry.Sequence;
|
||||
}
|
||||
}
|
||||
|
||||
private CultNetShardLogEntryMessage ToLogEntryMessage(CultNetShardMutationLogEntry entry)
|
||||
{
|
||||
if (entry.Relayed != null)
|
||||
{
|
||||
return NormalizeWireLogEntry(entry, entry.Relayed);
|
||||
}
|
||||
|
||||
if (entry.Kind == CultNetDatabaseChangeKind.Removed || entry.Document == null)
|
||||
{
|
||||
return new CultNetShardLogEntryMessage
|
||||
|
|
|
|||
Loading…
Reference in a new issue