Skip to content

docs: define catalog metadata barrier wire contract - #29008

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
ck89119:issue-29003-main
Sep 16, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
ck89119:issue-29003-main

Conversation

@ck89119

@ck89119 ck89119 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #29003

What this PR does / why we need it:

Defines the design-first contract for the catalog metadata capability barrier on top of the current persisted-expression admission protocol.

This design-only checkpoint specifies:

No runtime behavior, heartbeat producer, admission decision, recovery worker, or public SQL behavior changes in this checkpoint. Production wire/snapshot implementation remains blocked until the exact design revision receives traceable design-owner approval.

@ck89119
ck89119 requested a review from fengttt September 16, 2026 09:20
@matrix-meow matrix-meow added the size/XS Denotes a PR that changes [1, 9] lines label Sep 16, 2026
@mergify mergify Bot added kind/feature kind/documentation Improvements or additions to documentation kind/api-change labels Sep 16, 2026
@ck89119
ck89119 marked this pull request as ready for review September 16, 2026 09:21
@ck89119
ck89119 requested a review from XuPeng-SH as a code owner September 16, 2026 09:21
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文档 deep review 发现 4 个 P2 设计契约缺口(当前 head 1467183):

  1. snapshot validation(docs/design/CLAUDE_20260916-catalog-metadata-barrier.md:179-186)没有规定 unknown phase 必须拒绝,也没有 feature bit 0 与 persisted-expression floor 的双向一致性校验。phase=99、zero generations、feature bit=1 等未定义状态可能通过。请定义合法 phase,并补 bidirectional validation 和 negative fixtures。

  2. MOH3 compatibility gate(:76-90)没有定义哪个 capability predicate 证明 MOH3 decoding 和 barrier-entry replay;但后文要求所有 HAKeeper replica 支持 MOH3。请明确 advertising field、minimum version、semantics、absent/unsupported 行为,并与现有 V3 capability 区分。

  3. 缺少 state-transition contract(:97-113)。需要 normative transition table,覆盖 initialization、abort/retry、recovery、subsequent generations,以及 ever-non-disabled downgrade protection 的 durable rule。

  4. snapshot memory bound(:206)“约 2x serialized payload + fixed envelope”缺少依据;rsm_state 可变长,decode 期间可能同时保留输入、copy、decoded maps/strings 和旧 live state。请补 allocation/ownership model 或 representative allocation evidence。

当前 raw/MOH2 behavior 和 field tags 与 baseline 一致;文档 CI 通过,runtime checks 按文档-only scope 被跳过。

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新 head 复审通过(当前 d7085d1):此前 4 个 P2 设计缺口均已关闭。

  • snapshot validation 现在拒绝 unknown phase、非法 phase/generation 组合和双向 feature/payload mismatch,并要求 negative fixtures/atomicity checks。
  • MOH3 capability predicate 已明确 protocol >=1、decoder/replay semantics、absent/zero 行为、membership gate 和 first durable-entry writer gate。
  • state transition contract 已覆盖 initialization、retry、supersession、recovery、overflow、duplicate 和不可回到 DISABLED 的 durable rule。
  • memory bound 已删除无依据的 2x claim,改为说明 old/new state、input/payload copies,并要求实现阶段 allocation/profile evidence。

Baseline tags 未占用,raw/MOH2 recovery 与 V3 semantics 一致;git diff --check 和 exact-head documentation CI 通过,runtime tests 按 docs-only scope 跳过。

@mergify mergify Bot added the queued label Sep 16, 2026
@mergify

mergify Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-16 11:02 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-09-16 11:03 UTC · at 5be1ad8802575c558743048443dbf4f7b5a50076

This pull request spent 34 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

This pull request seems to come from a fork, and Mergify needs the author's permission to update its branch.
The author needs to enable "Allow edits from maintainers" on this pull request, or update the branch manually.

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

@XuPeng-SH
XuPeng-SH merged commit 125d943 into matrixorigin:main Sep 16, 2026
4 of 5 checks passed
@mergify mergify Bot added dequeued and removed queued labels Sep 16, 2026
@ck89119
ck89119 deleted the issue-29003-main branch September 16, 2026 11:03
XuPeng-SH pushed a commit that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [x] API-change
- [ ] BUG
- [x] Improvement
- [ ] Documentation
- [x] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue #29003

## What this PR does / why we need it:

Implements the catalog metadata barrier wire and snapshot contract
approved in #29008.

- Adds additive CN/LogStore capability fields, heartbeat barrier
snapshots, durable barrier state, and the MOH3 snapshot envelope without
changing existing field meanings.
- Preserves the current raw/MOH2 production writer behavior while the
barrier remains disabled; this PR does not advertise the new HAKeeper
barrier protocol or activate metadata admission.
- Adds strict phase/generation validation and bidirectional
required-feature validation.
- Decodes into temporary state and publishes only after complete
validation, preserving reused-state atomicity on corrupt/truncated
input.
- Adds byte-level old/new heartbeat compatibility, raw/MOH2/MOH3,
format-selection, invalid-state, feature matrix, corruption, truncation,
and reused-state tests.
- Records the exact design approval in the tracked design document.

Validation:

- `make pb` and a second `make generate-pb` reproducibility check
- HAKeeper and protobuf package tests, normal and race
- focused race tests repeated 10 times
- full LogService tests
- CN/LogService consumer compile tests
- `go vet` for HAKeeper and protobuf owners
- new snapshot codec statement coverage: 85.7%–100%; owning package
total 84.4%
- raw/MOH2/MOH3 fresh/reused allocation benchmark and alloc-space
profile

No runtime activation, recovery worker, SQL admission, planner, DDL, or
restore behavior is included; those remain in #29004–#29007.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mergify Bot pushed a commit that referenced this pull request Sep 17, 2026
This is the single draft delivery PR for #29004. Per the requested workflow, design updates and subsequent implementation will remain in this PR; there will be no separate documentation PR.

**Current checkpoint is design-first only. No production implementation is delivered yet. Do not merge as completion of #29004.**

Adds `docs/design/CLAUDE_20260917-catalog-barrier-rsm.md` with independent participant acknowledgments, durable targets, transition evidence ownership, and explicit compatibility changes to the previously approved #29008 design.

The code trace identifies a concrete membership race: ordinary AddReplica commands leave the HAKeeper pending queue on delivery, before the executor calls Dragonboat. A barrier application entry does not advance the membership config-change index, so OrderedConfigChange alone does not fence a delayed add.

Design blockers are explicit rather than treated as implementation details:
- Shared replicated arbitration of first barrier submission and actual membership admission, including commands delivered before upgrade.
- Durable decoder floor even when a valid new entry's business transition is rejected; proposed MOH3 required-feature bit 2.
- Runtime target evidence compatibility and catalog/public-authority owner boundaries across the subtask series.

The existing design approval does not cover these additions. Please review this checkpoint before implementation delivery. Runtime activation and MetadataReadsEnabled remain unchanged/disabled.

Validation: source-level execution-chain inspection and `git diff --cached --check`. No production code or generated protobuf changed; no UT/race success is claimed for this checkpoint.

Approved by: @XuPeng-SH
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [x] API-change
- [ ] BUG
- [ ] Improvement
- [x] Documentation
- [x] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#29003

## What this PR does / why we need it:

Defines the design-first contract for the catalog metadata capability
barrier on top of the current persisted-expression admission protocol.

This design-only checkpoint specifies:

- independent protocol-floor, membership-epoch, and catalog-generation
state;
- additive protobuf messages and proposed unoccupied field tags;
- legacy raw, current MOH2, and proposed MOH3 snapshot compatibility;
- atomic decode/reused-state/corruption requirements;
- mixed-version, downgrade, rollout, resource, security, and validation
contracts;
- the boundaries for follow-up issues matrixorigin#29004 through matrixorigin#29007.

No runtime behavior, heartbeat producer, admission decision, recovery
worker, or public SQL behavior changes in this checkpoint. Production
wire/snapshot implementation remains blocked until the exact design
revision receives traceable design-owner approval.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [x] API-change
- [ ] BUG
- [x] Improvement
- [ ] Documentation
- [x] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#29003

## What this PR does / why we need it:

Implements the catalog metadata barrier wire and snapshot contract
approved in matrixorigin#29008.

- Adds additive CN/LogStore capability fields, heartbeat barrier
snapshots, durable barrier state, and the MOH3 snapshot envelope without
changing existing field meanings.
- Preserves the current raw/MOH2 production writer behavior while the
barrier remains disabled; this PR does not advertise the new HAKeeper
barrier protocol or activate metadata admission.
- Adds strict phase/generation validation and bidirectional
required-feature validation.
- Decodes into temporary state and publishes only after complete
validation, preserving reused-state atomicity on corrupt/truncated
input.
- Adds byte-level old/new heartbeat compatibility, raw/MOH2/MOH3,
format-selection, invalid-state, feature matrix, corruption, truncation,
and reused-state tests.
- Records the exact design approval in the tracked design document.

Validation:

- `make pb` and a second `make generate-pb` reproducibility check
- HAKeeper and protobuf package tests, normal and race
- focused race tests repeated 10 times
- full LogService tests
- CN/LogService consumer compile tests
- `go vet` for HAKeeper and protobuf owners
- new snapshot codec statement coverage: 85.7%–100%; owning package
total 84.4%
- raw/MOH2/MOH3 fresh/reused allocation benchmark and alloc-space
profile

No runtime activation, recovery worker, SQL admission, planner, DDL, or
restore behavior is included; those remain in matrixorigin#29004–matrixorigin#29007.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [x] API-change
- [ ] BUG
- [ ] Improvement
- [x] Documentation
- [x] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#29003

## What this PR does / why we need it:

Defines the design-first contract for the catalog metadata capability
barrier on top of the current persisted-expression admission protocol.

This design-only checkpoint specifies:

- independent protocol-floor, membership-epoch, and catalog-generation
state;
- additive protobuf messages and proposed unoccupied field tags;
- legacy raw, current MOH2, and proposed MOH3 snapshot compatibility;
- atomic decode/reused-state/corruption requirements;
- mixed-version, downgrade, rollout, resource, security, and validation
contracts;
- the boundaries for follow-up issues matrixorigin#29004 through matrixorigin#29007.

No runtime behavior, heartbeat producer, admission decision, recovery
worker, or public SQL behavior changes in this checkpoint. Production
wire/snapshot implementation remains blocked until the exact design
revision receives traceable design-owner approval.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [x] API-change
- [ ] BUG
- [x] Improvement
- [ ] Documentation
- [x] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#29003

## What this PR does / why we need it:

Implements the catalog metadata barrier wire and snapshot contract
approved in matrixorigin#29008.

- Adds additive CN/LogStore capability fields, heartbeat barrier
snapshots, durable barrier state, and the MOH3 snapshot envelope without
changing existing field meanings.
- Preserves the current raw/MOH2 production writer behavior while the
barrier remains disabled; this PR does not advertise the new HAKeeper
barrier protocol or activate metadata admission.
- Adds strict phase/generation validation and bidirectional
required-feature validation.
- Decodes into temporary state and publishes only after complete
validation, preserving reused-state atomicity on corrupt/truncated
input.
- Adds byte-level old/new heartbeat compatibility, raw/MOH2/MOH3,
format-selection, invalid-state, feature matrix, corruption, truncation,
and reused-state tests.
- Records the exact design approval in the tracked design document.

Validation:

- `make pb` and a second `make generate-pb` reproducibility check
- HAKeeper and protobuf package tests, normal and race
- focused race tests repeated 10 times
- full LogService tests
- CN/LogService consumer compile tests
- `go vet` for HAKeeper and protobuf owners
- new snapshot codec statement coverage: 85.7%–100%; owning package
total 84.4%
- raw/MOH2/MOH3 fresh/reused allocation benchmark and alloc-space
profile

No runtime activation, recovery worker, SQL admission, planner, DDL, or
restore behavior is included; those remain in matrixorigin#29004–matrixorigin#29007.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
… (matrixorigin#29049)

This is the single draft delivery PR for matrixorigin#29004. Per the requested workflow, design updates and subsequent implementation will remain in this PR; there will be no separate documentation PR.

**Current checkpoint is design-first only. No production implementation is delivered yet. Do not merge as completion of matrixorigin#29004.**

Adds `docs/design/CLAUDE_20260917-catalog-barrier-rsm.md` with independent participant acknowledgments, durable targets, transition evidence ownership, and explicit compatibility changes to the previously approved matrixorigin#29008 design.

The code trace identifies a concrete membership race: ordinary AddReplica commands leave the HAKeeper pending queue on delivery, before the executor calls Dragonboat. A barrier application entry does not advance the membership config-change index, so OrderedConfigChange alone does not fence a delayed add.

Design blockers are explicit rather than treated as implementation details:
- Shared replicated arbitration of first barrier submission and actual membership admission, including commands delivered before upgrade.
- Durable decoder floor even when a valid new entry's business transition is rejected; proposed MOH3 required-feature bit 2.
- Runtime target evidence compatibility and catalog/public-authority owner boundaries across the subtask series.

The existing design approval does not cover these additions. Please review this checkpoint before implementation delivery. Runtime activation and MetadataReadsEnabled remain unchanged/disabled.

Validation: source-level execution-chain inspection and `git diff --cached --check`. No production code or generated protobuf changed; no UT/race success is claimed for this checkpoint.

Approved by: @XuPeng-SH

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/api-change kind/documentation Improvements or additions to documentation kind/feature size/XS Denotes a PR that changes [1, 9] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants