Skip to content

shard-serialization P3.13: add instance-local suppression state for SkipBoth #6840

@romange

Description

@romange

Phase 3 — Bring non-PIT onto the new foundation (Task 13 of 17)

Goal: Keep the optimization entirely within the existing per-instance callback pair, without cross-instance coordination.

Design doc: docs/shard-serialization.md — Technical Roadmap

Dependencies

Description

Add per-snapshot-instance state that lets `OnDbChange` record a suppression decision (SkipBoth) for mutations whose effects will be covered by future traversal, and lets the same instance's `ConsumeJournalChange` consult and clear that state.

Guidelines

Architecture

  • Each `SliceSnapshot` (or `RestoreStreamer`) instance has its own `OnDbChange` and `ConsumeJournalChange`.
  • The suppression decision is instance-local: multiple snapshots on the same shard make independent decisions based on their own `snapshot_version_` and traversal progress.
  • No shard-wide or cross-instance aggregation.

Suppression state

  • Add a set/map to `SliceSnapshot` that records suppressed mutations (keyed by LSN or key name).
  • `OnDbChange` adds entries when SkipBoth conditions are met (conditions defined in task 14).
  • `ConsumeJournalChange` checks the set: if the mutation is suppressed, skip the journal write and clear the entry.

Scope

  • This task adds the mechanism only — the suppression set and the check/clear logic.
  • The actual eligibility logic (when to set SkipBoth) comes in task 14.
  • Initially the set remains empty (no mutations are suppressed yet).

Acceptance criteria

  • Suppression state container added to `SliceSnapshot`.
  • `ConsumeJournalChange` checks suppression state and skips suppressed entries.
  • No mutations are actually suppressed yet (set is always empty).
  • All existing tests pass unchanged.
  • No cross-instance or shard-wide state introduced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions