⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

fix: handle sequence=0 during cluster shard failover#377

Open
Kaustubh1204 wants to merge 1 commit intoapache:unstablefrom
Kaustubh1204:fix-366-clean
Open

fix: handle sequence=0 during cluster shard failover#377
Kaustubh1204 wants to merge 1 commit intoapache:unstablefrom
Kaustubh1204:fix-366-clean

Conversation

@Kaustubh1204
Copy link

@Kaustubh1204 Kaustubh1204 commented Feb 9, 2026

Problem

Failover fails when a shard has never received any writes and its sequence number is 0.
In this case, the validation logic incorrectly rejects the failover even when both the
current master and the new master have a sequence of 0.

This scenario is reported in issue #366 and can occur for empty or newly created shards.

Solution

Update the failover validation logic to explicitly allow sequence == 0 when the
current master’s sequence is also 0.

This ensures failover works correctly for empty shards without changing behavior
for non-zero sequence cases.

Scope

  • Limited to failover logic
  • Single focused change
  • No refactors, exports, CI, or unrelated fixes

Testing

  • Existing tests pass
  • No behavioral change for non-zero sequences

Fixes #366

@Kaustubh1204
Copy link
Author

@git-hulk I’ve reworked the fix for #366 in a clean branch with a single focused commit.
The previous PR (#373) was closed to avoid confusion and mixed changes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failover failed because of sequence is 0

1 participant