Skip to content

fix(gossip): disable unsupported push-pull route snapshots - #26538

Merged
mergify[bot] merged 2 commits into
matrixorigin:mainfrom
LeftHandCold:fix/issue-25942-disable-dead-join-state
Aug 1, 2026
Merged

mergify[bot] merged 2 commits into
matrixorigin:mainfrom
LeftHandCold:fix/issue-25942-disable-dead-join-state

Conversation

@LeftHandCold

Copy link
Copy Markdown
Collaborator

What type of PR is this?

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

Which issue(s) this PR fixes:

issue #25942

What this PR does / why we need it:

The gossip delegate had a route-snapshot codec that was not part of MatrixOne's effective memberlist protocol: join exchanges called LocalState(true), which already returned nil, while periodic exchanges called MergeRemoteState(..., false), which already ignored the snapshot. Honest nodes therefore never consumed this state, but malformed join state could still reach the decoder and trigger a short-buffer panic or an allocation controlled by its inner length header.

This PR makes that existing protocol decision explicit:

  • LocalState returns nil for both push/pull modes;
  • MergeRemoteState ignores remote user state without parsing or allocating;
  • the dead binary/LZ4 snapshot codec and state builders are removed;
  • the live incremental GetBroadcasts / NotifyMsg / NotifyLeave route path is unchanged.

The effective old/new rolling-upgrade behavior is unchanged. This PR is scoped to MatrixOne's delegate state and does not change the pinned memberlist transport/framing layer.

Tested with:

./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -run '^TestDelegatePushPullStateDisabled$' ./pkg/gossip

./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=45 -run '^TestNodeGossip$' ./pkg/gossip

./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 ./pkg/gossip

./.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -run '^$' ./pkg/cnservice

go build -mod=readonly ./pkg/gossip

go vet -mod=readonly ./pkg/gossip

@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.

Approved exact head 9abe377 after tracing the complete memberlist push/pull and live route-propagation paths.

MatrixOne sets PushPullInterval to zero. Join exchanges propagate join=true to both LocalState calls, and the old LocalState(true) already returned nil; non-join state was generated but ignored by MergeRemoteState(..., false). The removed snapshot codec therefore had no honest producer/consumer closure. Rolling old/new behavior remains unchanged, while arbitrary delegate state can no longer reach the short-buffer decoder or its inner length-controlled allocation. Incremental GetBroadcasts/NotifyMsg and NotifyLeave routing are untouched.

Q1-Q3 review found no remaining blocker; this also removes periodic serialization/compression/locking work. Local validation: the disabled-state regression passed under race at count=100; TestNodeGossip passed under race at adaptive count=50; the full pkg/gossip package passed under race; pkg/cnservice compiled through go test; scoped go vet passed.

@mergify mergify Bot added the queued label Aug 1, 2026
@mergify

mergify Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-01 00:16 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-08-01 00:59 UTC · at 8e5a2ccdc3004067c2e0d78142dc66965d676219 · squash

This pull request spent 42 minutes 58 seconds in the queue, including 42 minutes 40 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86

@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.

Revalidated exact head 8e5a2cc after the automatic main merge. The only old-head-to-new-head delta is main commit 4fe0c66 (TAE transfer-page synchronization); pkg/gossip and pkg/cnservice are byte-identical to the previously reviewed head, and the net PR diff against the updated base is unchanged. Re-ran disabled-state race count=100, full pkg/gossip race, pkg/cnservice compile, and gossip vet: all pass. No failed CI checks; refreshed jobs are still running.

@mergify
mergify Bot merged commit 3e31dbc into matrixorigin:main Aug 1, 2026
24 of 25 checks passed
@mergify mergify Bot removed the queued label Aug 1, 2026
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…gin#26538)

The gossip delegate had a route-snapshot codec that was not part of MatrixOne's effective memberlist protocol: join exchanges called `LocalState(true)`, which already returned nil, while periodic exchanges called `MergeRemoteState(..., false)`, which already ignored the snapshot. Honest nodes therefore never consumed this state, but malformed join state could still reach the decoder and trigger a short-buffer panic or an allocation controlled by its inner length header.

This PR makes that existing protocol decision explicit:

- `LocalState` returns nil for both push/pull modes;
- `MergeRemoteState` ignores remote user state without parsing or allocating;
- the dead binary/LZ4 snapshot codec and state builders are removed;
- the live incremental `GetBroadcasts` / `NotifyMsg` / `NotifyLeave` route path is unchanged.

The effective old/new rolling-upgrade behavior is unchanged. This PR is scoped to MatrixOne's delegate state and does not change the pinned memberlist transport/framing layer.

Tested with:

`./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -run '^TestDelegatePushPullStateDisabled$' ./pkg/gossip`

`./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=45 -run '^TestNodeGossip$' ./pkg/gossip`

`./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 ./pkg/gossip`

`./.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -run '^$' ./pkg/cnservice`

`go build -mod=readonly ./pkg/gossip`

`go vet -mod=readonly ./pkg/gossip`

Approved by: @XuPeng-SH
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…gin#26538)

The gossip delegate had a route-snapshot codec that was not part of MatrixOne's effective memberlist protocol: join exchanges called `LocalState(true)`, which already returned nil, while periodic exchanges called `MergeRemoteState(..., false)`, which already ignored the snapshot. Honest nodes therefore never consumed this state, but malformed join state could still reach the decoder and trigger a short-buffer panic or an allocation controlled by its inner length header.

This PR makes that existing protocol decision explicit:

- `LocalState` returns nil for both push/pull modes;
- `MergeRemoteState` ignores remote user state without parsing or allocating;
- the dead binary/LZ4 snapshot codec and state builders are removed;
- the live incremental `GetBroadcasts` / `NotifyMsg` / `NotifyLeave` route path is unchanged.

The effective old/new rolling-upgrade behavior is unchanged. This PR is scoped to MatrixOne's delegate state and does not change the pinned memberlist transport/framing layer.

Tested with:

`./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -run '^TestDelegatePushPullStateDisabled$' ./pkg/gossip`

`./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=45 -run '^TestNodeGossip$' ./pkg/gossip`

`./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 ./pkg/gossip`

`./.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -run '^$' ./pkg/cnservice`

`go build -mod=readonly ./pkg/gossip`

`go vet -mod=readonly ./pkg/gossip`

Approved by: @XuPeng-SH
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…gin#26538)

The gossip delegate had a route-snapshot codec that was not part of MatrixOne's effective memberlist protocol: join exchanges called `LocalState(true)`, which already returned nil, while periodic exchanges called `MergeRemoteState(..., false)`, which already ignored the snapshot. Honest nodes therefore never consumed this state, but malformed join state could still reach the decoder and trigger a short-buffer panic or an allocation controlled by its inner length header.

This PR makes that existing protocol decision explicit:

- `LocalState` returns nil for both push/pull modes;
- `MergeRemoteState` ignores remote user state without parsing or allocating;
- the dead binary/LZ4 snapshot codec and state builders are removed;
- the live incremental `GetBroadcasts` / `NotifyMsg` / `NotifyLeave` route path is unchanged.

The effective old/new rolling-upgrade behavior is unchanged. This PR is scoped to MatrixOne's delegate state and does not change the pinned memberlist transport/framing layer.

Tested with:

`./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -run '^TestDelegatePushPullStateDisabled$' ./pkg/gossip`

`./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=45 -run '^TestNodeGossip$' ./pkg/gossip`

`./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 ./pkg/gossip`

`./.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -run '^$' ./pkg/cnservice`

`go build -mod=readonly ./pkg/gossip`

`go vet -mod=readonly ./pkg/gossip`

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/bug Something isn't working kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants