Skip to content

[Fix] Prevent stale schema queue closes after leader transfer - #18948

Merged
jt2594838 merged 2 commits into
apache:masterfrom
Caideyipi:fix/pipe-schema-queue-close-leader-transfer
Oct 21, 2026
Merged

jt2594838 merged 2 commits into
apache:masterfrom
Caideyipi:fix/pipe-schema-queue-close-leader-transfer

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Schema listener cleanup uses the local DataNode's Pipe metadata. If the SchemaRegion leader steps down while a cleanup write is in flight, Ratis can forward that close to the new leader after it has opened the queue for a new task. The late close invalidates the active iterator and stalls schema replication.

Allow consensus requests to opt out of remote forwarding and apply this to schema queue closes. The new leader can reevaluate cleanup on its next metadata synchronization. Ordinary writes and queue opens retain their existing routing, and the serialized plan format is unchanged.

Validation:

  • A three-peer Ratis regression transfers leadership, accepts a current-leader request, rejects the old leader's stale request, and verifies that ordinary follower writes still succeed.
  • The same regression fails against the original origin/master Ratis implementation because it forwards the stale request (status 200 instead of 400).
  • A DataNode regression verifies the close restriction survives cloning and serialization.
  • Spotless and the targeted regression tests pass.

@jt2594838
jt2594838 merged commit 20cab12 into apache:master Oct 21, 2026
39 of 40 checks passed
@jt2594838
jt2594838 deleted the fix/pipe-schema-queue-close-leader-transfer branch October 21, 2026 07:44
VGalaxies pushed a commit to VGalaxies/iotdb that referenced this pull request Oct 26, 2026
…#18948)

* [Fix] Prevent stale schema queue closes from following leader transfers

* [Pipe] Wait for historical transfer before asserting mods
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.

2 participants