Skip to content

LogService HAKeeper can regress to stale shard membership after Dragonboat imported snapshot metadata rewrite #24966

Closed

Description

@LeftHandCold

Problem

A production LogService incident on June 4 exposed a Dragonboat snapshot import metadata bug that can make HAKeeper observe a stale shard membership as a newer view.

When Dragonboat imported a snapshot, the imported snapshot metadata could use the snapshot index as Membership.ConfigChangeId. MatrixOne maps Dragonboat membership ConfigChangeId to the LogService shard epoch visible to HAKeeper. If an old membership is imported with a large snapshot index, HAKeeper can treat that stale membership as the latest shard view.

In the observed incident, this allowed HAKeeper to schedule membership changes from an obsolete view and attempt to replace the live LogService replica, creating a split membership state.

Root cause

Dragonboat's snapshot import path mixed two different concepts:

  • snapshot index: the raft log index represented by the snapshot data
  • membership config-change id: the raft entry index of the latest applied membership change

The imported snapshot path must not synthesize Membership.ConfigChangeId from the snapshot index. For online imports, it must preserve the source snapshot membership consistently and reject invalid target membership before restore.

Upstream fix

Dragonboat has merged the fix in:

The upstream fix:

  • preserves source snapshot membership for NodeHost.SyncRequestImportSnapshot
  • keeps tools.ImportSnapshot disaster-recovery membership rewrite behavior, but preserves the original ConfigChangeId
  • rejects imported snapshots whose target replica is missing, removed, role-mismatched, duplicated across roles, or mismatched with the local replica id
  • adds regression coverage for the import metadata paths

Required MatrixOne changes

Update MatrixOne's Dragonboat replacement dependency to include the upstream fix on both active branches:

Validation expectation

Each branch PR should at least validate:

  • git diff --check
  • Go module resolution for the updated Dragonboat replacement
  • A focused LogService or dependency compile/test target where practical

Related incident context

This issue tracks the dependency uptake needed to prevent recurrence of the June 4 LogService/HAKeeper stale-membership incident. It does not attempt to repair already-corrupted cluster metadata; that should be handled by a separate recovery/remediation task if needed.

Activity

  1. self-assigned this
    on Jun 15, 2026
  2. added
    severity/s1
    on Jun 30, 2026
  3. added this to the MO-202607 milestone on Jun 30, 2026
  4. added a commit that references this issue on Jul 22, 2026
    4f76182
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

severity/s1

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions