Skip to content

HA/Raft: a replica transaction prepared before it applied a new index is accepted after the DDL and leaves that index without the record on every node #8686

Closed

Description

@lvca

Found while testing #7438.

A replica prepares its transaction against ITS schema. If the leader's CREATE INDEX SCHEMA_ENTRY is committed but the replica has not applied it yet, the replica ships a TX_ENTRY whose WAL carries no page changes for the new index. The leader accepts it (it is after the DDL in the log, page versions are consistent), every node applies the WAL pages as-is, and the record is never added to the new index anywhere. Records and index entries then disagree (records N+1, index N) on all nodes.

#7438 excludes replica entries while the DDL runs; it cannot cover this, because the entry is valid against the page versions and only stale against the schema.

Shape of a fix: carry the schema version the transaction was prepared under in TX_ENTRY (a wire format change, needs capability gating), and refuse it in ArcadeStateMachine.startTransaction with a retryable error when the leader's schema version is newer, so the originator retries after applying the schema entry.

Activity

  1. added this to the 26.10.1 milestone on Sep 30, 2026
  2. self-assigned this
    on Sep 30, 2026
  3. added
    haHigh availability / replication (Raft)
    on Sep 30, 2026
  4. added
    concurrencyThreading / concurrency / MVCC
    severity:criticalData loss, corruption, crash/hang, security hole, or product unusable
    on Sep 30, 2026
  5. added
    in progressThe team is actively working on this issue
    on Sep 30, 2026
  6. added 7 commits that reference this issue on Sep 30, 2026
  7. 1 remaining item

  8. lvca commented on Sep 30, 2026

    @lvca
    MemberAuthor

    Fixed in 26.10.1 (PR #8754).

    A write on a replica that started before the replica applied a new CREATE INDEX could be accepted and leave the record out of that index on every node. The leader now refuses such a write with a retryable error, and the retry is prepared under the new schema. Expect retryable errors on replicas during schema changes, and set transaction retries accordingly. The check can be turned off with arcadedb.ha.txSchemaCheck=false.

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

  9. removed
    in progressThe team is actively working on this issue
    on Sep 30, 2026
  10. added a commit that references this issue on Sep 30, 2026
  11. added 9 commits that reference this issue on Oct 6, 2026
  12. added a commit that references this issue on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugconcurrencyThreading / concurrency / MVCChaHigh availability / replication (Raft)severity:criticalData loss, corruption, crash/hang, security hole, or product unusable

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions