Skip to content

cluster: the metadata.mutated lane (lane 2) re-converges the ObjectQL registry on cluster.resync, so an object authored during a Redis outage is served by every replica without a restart (#31596 follow-up) #31722

Closed

Description

@objectstack-fleet

domain:server#1 · os-steve · session_01ADHkmPF1skfu2kx89BEXZi

Filing gate: ④ coordination node, a child of #3814 that carries the part of #31596 (F3a) its PR #31721 leaves out. ⛔ Not a claim.
Business reason: #31596 is done when "caches converge without a restart" once Redis returns. PR #31721 adds the local cluster.resync event, and lanes 1, 3 and 4 and authz re-read on it. Lane 2 (attachMetadataMutationPubSub(), metadata.mutated) has no resync seam: metadata-cluster-bridge-plugin.ts on the PR head says "Lane 2 has no resync seam yet". Lane 2 is the one behind the data plane on the shipped EE shape (#13331). So an object authored through PUT /api/v1/meta/* while the store is unreachable loses its hint, and every other replica answers OBJECT_NOT_FOUND for it until restart.
Reader: seat domain:server#1, serial after #31596's PR #31721 merges. It touches the same bridge file as #31597, so it runs on the same seat, one after another.
Dedupe (open AND closed): metadata.mutated resync → 0 on point; #13331 (closed) is the lane's original defect, which lane 2 fixed for delivered hints.
class: b · type: Bug
Grade: p1, same as #31596 (#3814 HA critical path).

维护者速读

Redis 断线期间在某个副本上新建或修改的对象,恢复连接后别的副本仍然找不到,要重启才好。#31596 已经让其他三条缓存通道在重连时重读,这条负责对象注册表的通道还没有,这张卡补上。

What to build

  1. A resync seam on the metadata protocol lane's owner, registered with the bridge exactly as lanes 1, 3 and 4 register theirs in PR fix(cluster): a Redis outage must not crash replicas; resync caches on reconnect #31721 (LaneResync, called from resyncLanes on onClusterResync). On the event, the replica re-runs the ObjectQL registry write-through from its OWN sys_metadata read for every item a missed hint could have touched. Measure the cost of a full re-read against a per-type or since-timestamp re-read, and say which one you chose in the PR.
  2. ⛔ No value travels on the wire; the DB stays the source of truth. ⛔ A resync never deletes a registry entry it cannot re-read (a transient read failure is not a delete). Log it once and keep the entry.
  3. approvals: 审批请求行不暴露节点的 lockRecord,客户端只能假定「有 pending 就是锁死」 #3814 R3: the memory driver never emits the event, so the single-node path is unchanged. Pin that.
  4. Tests: two kernels on a shared pub/sub. Drop A's metadata.mutated hint (the driver's fault seam or a dropped publish), author an object on A, and emit cluster.resync on B. B then serves the object. This is red without the seam. CONTROL: single node unchanged; a delivered hint still converges per item.
  5. Update content/docs/kernel/cluster.mdx §6.2 so it no longer says lane 2 lacks the resync.

Surface

  • Expected file surface: packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts, the protocol lane's owner (where attachMetadataMutationPubSub lives), tests, content/docs/kernel/cluster.mdx, root .changeset/.
  • Clause-②: no.

Parent: #31596. Epic: #3814.

Activity

  1. added
    bug
    priority:p1
    pm:queue
    domain:server
    on Nov 8, 2026
  2. objectstack-fleet commented on Nov 8, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: confirmed · domain:server · p1 · pm:queue · 2026-11-08T23:53Z

    ⛔ Not a claim.


    Generated by Claude Code

  3. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 9, 2026
  4. objectstack-fleet commented on Nov 9, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-steve · session_01ADHkmPF1skfu2kx89BEXZi

    Claim: PM loop round 1 · #31722 · 2026-11-09T02:44Z · bug (p1; #31596 follow-up, lane 2 resync; prioritised by the maintainer 2026-11-09T02:41Z)
    Session: session_01ADHkmPF1skfu2kx89BEXZi
    Account: os-steve
    Branch: claude/project-thread-eeoddo (the card thread's harness-pinned branch; platform exception to claude/issue-<n>-<slug>)
    Worktree: objectstack-issue-31722
    Domain: domain:server
    Seat: domain:server#1
    File surface: packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts (lane 2's resync registration), lane 2's owner (where attachMetadataMutationPubSub lives), their tests, content/docs/kernel/cluster.mdx §6.2, a changeset (stop on breach; explain in the report)
    Container & model: M/L, mode:thread, model: default tier, effort: high
    Clause-②: no
    Metadata-protocol: none
    Ruling-ref: #3814 R0–R6 as #31596 quotes them (R3 binds)
    Responsibility: n/a — not a defect card
    Thread-read: none
    Premise: holds (read at f65c36fc: lane 2 has no resync seam; F3a's resync API is on PR #31721 head f2661d70, in the merge queue)
    Serial constraints cleared: F3a PR #31721 (this seat) is in the merge queue; this card pushes only after it merges. #31597 (this seat, another thread) edits the same bridge file and lands first; this card merges main after it.
    Order: standard order + server-seat1/31722-delta.md (project files).

  5. objectstack-fleet commented on Nov 9, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-steve · session_01ADHkmQr9knGGTwQc6UKmnE
    os-dev-report

    {
      "issue": 31722,
      "status": "done",
      "branch": "claude/project-thread-eeoddo",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/31816",
      "session": "session_01ADHkmQr9knGGTwQc6UKmnE",
      "premise_still_valid": true,
      "summary": "Lane 2 (metadata.mutated) gains a resync seam, ObjectStackProtocolImplementation.resyncMetadataMutationPubSub(), which MetadataClusterBridgePlugin registers through registerLaneResync on cluster.resync, beside lanes 1, 3, 4 and 5. One address+checksum read of sys_metadata's active rows is diffed against a per-replica baseline seeded at attach. Items whose checksum moved, items with no active row left, and items a hint or local write marked are re-converged through applyRemoteMetadataMutation from the replica's own re-read. Nothing travels on the wire, and a failed read never deletes. Step 0 measured on a booted showcase: at 300 objects the diff takes 2 ms (nothing lost) or 9 ms (5 changed), while a full re-apply takes 406 ms with 300 listener replays, so the diff was chosen. The measurement also found that the resync reads need context {isSystem:true} (a secured stack refused them); that is fixed and pinned.",
      "tests": "Full vitest run on merged head 70a46315: metadata-protocol 329 files / 22607 passed (26 skipped); service-cluster 11 / 158; runtime 568 / 10424 passed (19 skipped). New: fan-out suite +10 cases, bridge +2 (+ lane-2 assertions), runtime two-kernel 3 cases (star + 2 CONTROLs incl. memory driver never runs the seam). 9 ablations each red, run on the pre-merge head and again on the merged head, with ablation-replace restore blob==HEAD: A1 bridge registration removed (3 bridge + runtime star via dist, preflight marker present/absent/present), A2 read failure swallowed (1), A3 item failure drops key (1), A4 no unchanged skip (2), A5 hint touch removed (4), A6 registration before in-process guard (4), A7 local-write touch removed (1), A8a seed read without isSystem (1), A8b resync read without isSystem (9).",
      "gates": "dispatch-gates --commands on 70a46315: 104 commands, each run with its exit code captured to a file before any pipe: all exit 0. --ran reconciliation: 104 derived, 104 run, 0 NOT-MEASURED, 0 UNRUN. Plus pnpm typecheck (metadata-protocol, service-cluster, runtime) exit 0, root eslint --no-inline-config on the touched dirs exit 0, check-nul-bytes exit 0. PR check-runs: not yet read (just opened).",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "4 — mcp__github__issue_read x3 (get, get_comments x2), mcp__github__pull_request_read x1; no write tool",
      "api_writes": "0 REST proxy writes. Relay: 1 pr_create (fleet-write run 42567409598, read-back identical, assignee os-steve) and this comment via post-stamped. Git pushes to claude/project-thread-eeoddo only.",
      "open_questions": [],
      "security_findings": "withheld",
      "out_of_scope_findings": [],
      "files_changed": [
        ".changeset/31722-metadata-mutated-resync.md",
        "content/docs/kernel/cluster.mdx",
        "packages/metadata-protocol/src/index.ts",
        "packages/metadata-protocol/src/protocol-class-head.ts",
        "packages/metadata-protocol/src/protocol-host.ts",
        "packages/metadata-protocol/src/protocol-mutation-resync.ts",
        "packages/metadata-protocol/src/protocol.cluster-mutation-fanout.test.ts",
        "packages/metadata-protocol/src/protocol.ts",
        "packages/runtime/src/cluster-metadata-mutation-resync.integration.test.ts",
        "packages/services/service-cluster/src/metadata-cluster-bridge-plugin.test.ts",
        "packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts"
      ],
      "line_budget": "+841/-14 over 11 files vs merge base 01cbbba5: source +356/-5, tests +447/-4, docs +13/-5, changeset +15",
      "deviations": [
        "Clause-② measured yes (widening) against the claim's no: one new public method and its exported result type (F3a #31721 precedent).",
        "The runtime two-kernel test sits in packages/runtime, outside the claim's literal file surface ('their tests'): it is the only place the real bridge, two kernels and a shared DB meet.",
        "Pushed before #31785 landed, on the seat's 02:54Z go-ahead; the later hold arrived after that push. No push happened after the hold until #31785 merged; main was then merged in (merge commit).",
        "The first commit (c970b634) alone fails the dts build (Error {cause} on an older lib target); fixed in the next commit.",
        "A trailer with a model name was refused by the pre-push hook; the unpushed tip was amended to the model-free pair. No pushed history was rewritten.",
        "The first dist-ablation preflight used a single-quoted marker that tsup never emits (vacuous absent reading); redone with the double-quoted marker.",
        "The Step 0 measurement used a scratch dogfood test file (never committed). The WIP started on a local branch off the F3a head and was applied onto main.",
        "The gate run caught check:test-source-alias (the edited fan-out suite reached @objectstack/lint lazily); a module-top import was added, the same as sibling suites do."
      ]
    }

    Stamped 2026-11-09T05:28Z.

  6. objectstack-fleet commented on Nov 9, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-steve · session_01ADHkmPF1skfu2kx89BEXZi

    Claim: PM loop round 1 (restated: surface and Clause-② as measured on PR #31816) · #31722 · 2026-11-09T05:29Z · bug (p1; #31596 follow-up, lane 2 resync; prioritised by the maintainer 2026-11-09T02:41Z)
    Session: session_01ADHkmPF1skfu2kx89BEXZi
    Account: os-steve
    Branch: claude/project-thread-eeoddo (the card thread's harness-pinned branch; platform exception to claude/issue-<n>-<slug>)
    Worktree: objectstack-issue-31722
    Domain: domain:server
    Seat: domain:server#1
    File surface: packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts (lane 2's resync registration), lane 2's owner in packages/metadata-protocol/src/ (protocol-class-head.ts, protocol.ts, protocol-host.ts, index.ts, and the new protocol-mutation-resync.ts), their tests, packages/runtime/src/cluster-metadata-mutation-resync.integration.test.ts (one booted-stack integration test), content/docs/kernel/cluster.mdx §6.2, a changeset (stop on breach; explain in the report)
    Container & model: M/L, mode:thread, model: default tier, effort: high
    Clause-②: yes (widening: new public method resyncMetadataMutationPubSub() and its result type MetadataMutationResyncReport; nothing narrowed)
    Metadata-protocol: none
    Ruling-ref: #3814 R0–R6 as #31596 quotes them (R3 binds)
    Responsibility: n/a — not a defect card
    Thread-read: 6733003382
    Premise: holds (read at f65c36fc: lane 2 has no resync seam; F3a's resync API is on PR #31721 head f2661d70, in the merge queue)
    Serial constraints cleared: F3a PR #31721 (this seat) is in the merge queue; this card pushes only after it merges. #31597 (this seat, another thread) edits the same bridge file and lands first; this card merges main after it.
    Order: standard order + server-seat1/31722-delta.md (project files).

  7. removed
    pm:dispatched
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdomain:serverpriority:p1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions