Repository navigation
docs: define catalog metadata barrier wire contract - #29008
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
文档 deep review 发现 4 个 P2 设计契约缺口(当前 head 1467183):
-
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。
-
MOH3 compatibility gate(:76-90)没有定义哪个 capability predicate 证明 MOH3 decoding 和 barrier-entry replay;但后文要求所有 HAKeeper replica 支持 MOH3。请明确 advertising field、minimum version、semantics、absent/unsupported 行为,并与现有 V3 capability 区分。
-
缺少 state-transition contract(:97-113)。需要 normative transition table,覆盖 initialization、abort/retry、recovery、subsequent generations,以及 ever-non-disabled downgrade protection 的 durable rule。
-
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
left a comment
There was a problem hiding this comment.
新 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 跳过。
Merge Queue Status
This pull request spent 34 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. Tick the box to put this pull request back in the merge queue (same as
|
## 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>
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
## 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>
## 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>
## 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>
## 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>
… (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
What type of PR is this?
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.