Skip to content

[Store] Add producer view to durable oplog prefix - #3201

Open
Icedcoco wants to merge 7 commits into
kvcache-ai:mainfrom
Icedcoco:dev/oplog-ha-prs/S02
Open

[Store] Add producer view to durable oplog prefix#3201
Icedcoco wants to merge 7 commits into
kvcache-ai:mainfrom
Icedcoco:dev/oplog-ha-prs/S02

Conversation

@Icedcoco

Copy link
Copy Markdown
Collaborator

Important

This PR is stacked on #3165 and must not be merged before #3165.
After #3165 is merged, this branch will be rebased onto the updated main.

Description

This PR adds a backward-compatible producer view field to the durable oplog prefix.

  • Add producer_view_version to DurablePrefix while keeping schema version 1.
  • Preserve byte-identical legacy encoding when the producer view is zero.
  • Validate producer view values during decoding and leave the output unchanged on decode failure.
  • Carry the producer view across atomic batch and durable-prefix commits.
  • Include the producer view in compare-failure idempotency checks.
  • Support exact-value CAS for valid non-canonical prefixes, such as an explicitly encoded zero producer view.

This PR only introduces the format and storage semantics needed by later HA work. It does not claim producer views, fence stale writers, or switch the production writer.

Module

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Mooncake EP (mooncake-ep)
  • Mooncake PG (mooncake-pg)
  • Integration (mooncake-integration)
  • P2P Store (mooncake-p2p-store)
  • Python Wheel (mooncake-wheel)
  • Common (mooncake-common)
  • Mooncake RL (mooncake-rl)
  • CI/CD
  • Docs
  • Other

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation update
  • Performance improvement
  • Other

How Has This Been Tested?

Test commands:

cmake --build build --target \
  oplog_batch_codec_test \
  oplog_batch_storage_test \
  oplog_batch_standby_reader_test \
  ordered_oplog_writer_test -j32

LSAN_OPTIONS=detect_leaks=0 ./build/mooncake-store/tests/oplog_batch_codec_test
LSAN_OPTIONS=detect_leaks=0 ./build/mooncake-store/tests/oplog_batch_storage_test
LSAN_OPTIONS=detect_leaks=0 ./build/mooncake-store/tests/oplog_batch_standby_reader_test
LSAN_OPTIONS=detect_leaks=0 ./build/mooncake-store/tests/ordered_oplog_writer_test

Test results:

  • oplog_batch_codec_test: 34/34 passed

  • oplog_batch_storage_test: 38/38 passed

  • oplog_batch_standby_reader_test: 20/20 passed

  • ordered_oplog_writer_test: 28/28 passed

  • Pre-commit hooks passed for all files changed by this PR

  • Unit tests pass

  • Integration tests pass (if applicable)

  • Manual testing done

Checklist

  • I have performed a self-review of every changed line
  • I have formatted my code using ./scripts/code_format.sh
  • I have run pre-commit run --all-files and all hooks pass
  • I have updated the documentation (not applicable)
  • I have added tests to prove my changes are effective
  • For changes >500 LOC: I have filed an RFC issue (not applicable)

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used (specified below)

Codex was used to refine the design, implement the code and tests, investigate review findings, and run verification. The human submitter is responsible for reviewing and defending every changed line.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 99.35275% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ooncake-store/src/ha/oplog/oplog_batch_storage.cpp 96.72% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Icedcoco
Icedcoco marked this pull request as ready for review August 4, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants