Verify document hash (h) and document size (sz) for deletes on non-primaries

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      On non-primaries, verify delete oplog entries: before deleting, recompute the pre-image's hash and size and compare against the primary's m.h/m.sz. Deletes already have an apply-time sz verification in oplog.cpp (the delete path, gated mode == kSecondary).

      No extra read is needed: the delete already fetches the pre-image (preImage) to remove it, and that is exactly the document we hash.

      Generation and comparison happen together. On a mismatch, report through the same hook the sz check uses (log a repl constraint violation); the configurable off / log / crash behavior is
      WS6.

      Runs only on non-primaries (OplogApplication::Mode::kSecondary), with the feature flag on, for supported collections, and only when m.h is present.

      Acceptance criteria

      • Before deleting, the in-hand pre-image is hashed (SHA-256) and its size computed, then both compared against m.h/m.sz, beside the existing sz check.
      • On mismatch, fassert and crash.
      • Skipped on the primary, when the feature flag is off, on unsupported collections, and when m.h is absent.
      • Inserts and updates are out of scope, and are filed as SERVER-128516 and [...]
      • Unit-test

            Assignee:
            Unassigned
            Reporter:
            Stephanie Eristoff
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: