Visitar URL original
HA: a refused CREATE INDEX that replaces an existing index (withReplaceIfIncompatible) still quarantines the leader · Issue #10569 · ArcadeData/arcadedb · GitHub
Skip to content

HA: a refused CREATE INDEX that replaces an existing index (withReplaceIfIncompatible) still quarantines the leader #10569

Closed

Description

@robfrank

Follow-up of #10506.

#10506 moves the clean-up of a failed CREATE INDEX build inside its schema session, so on a Raft leader a refused build (for example a duplicate key met after some batches were committed) no longer quarantines the database: the files the build created are dropped before the session decides, and the session finds nothing left behind.

One path keeps quarantining, on purpose: a build made with withReplaceIfIncompatible(true) (the replace of an existing index on the same properties). TypeIndexBuilder.create() drops the index it replaces inside the same session, before the build starts. When the build is then refused, that drop is a change on the leader only - every other node still holds the replaced index's files - so RaftReplicatedDatabase.unpublishedSchemaChange now treats a recorded DROP of a file the session did not create as an unpublished change and quarantines (#10506 added that check; before it, the quarantine on this path came only from the new index's buffered pages). After the session, restoreReplacedIndex builds the old index again in a session of its own.

So a refused replacing CREATE INDEX still costs the leader a resync (UNPUBLISHED_SCHEMA_CHANGE), where it should cost the caller only an error.

Possible fix: either drop the replaced index only once the new one is built and verified (not possible as-is: LocalDocumentType.indexesByProperties holds one index per property set), or let a refused replacement end its session with the replaced index restored and publish that net state (remove old file, add restored file, schema), making sure the buffered pages of the failed build, which name files that are gone, are not shipped.

Covered today by Issue10506RefusedIndexBuildTest.aRefusedReplacingBuildDroppedAnIndexOtherNodesStillHoldAndIsQuarantined (ha-raft), which pins the quarantine as the safe answer until this is fixed.

Activity

  1. added this to the 26.11.1 milestone on Oct 22, 2026
  2. added
    haHigh availability / replication (Raft)
    engineCore engine: document/schema API
    on Oct 22, 2026
  3. self-assigned this
    on Oct 22, 2026
  4. added a commit that references this issue on Oct 23, 2026
  5. robfrank commented on Oct 23, 2026

    @robfrank
    CollaboratorAuthor

    Fixed in #10636. When a CREATE INDEX that replaces an existing index was refused, for example a Cypher UNIQUE constraint over data with duplicates, the Raft leader was quarantined with UNPUBLISHED_SCHEMA_CHANGE. The replaced index is now rebuilt inside the same schema change, so the cluster receives one consistent result, and the caller still gets the original error. The leader is no longer quarantined.

    Still open (no follow-up issues filed):

    • If the replication result of an earlier part of the change is unknown and the in-session restore then runs, the final entry is still sent after it. This depends on Raft keeping entries in log order.
    • A crash between dropping the old index and restoring it can still leave the type with no index, as before this fix.

    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  6. removed
    in progressThe team is actively working on this issue
    on Oct 23, 2026
  7. added a commit that references this issue on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugengineCore engine: document/schema APIhaHigh availability / replication (Raft)severity:minorCosmetic, documentation, edge case, or a workaround exists

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions