Skip to content

WALFile.getTransaction returns null on partial record, recovery abandons rest of WAL #4508

Closed

Description

@ruispereira

Affected version: 26.4.2 (confirmed still present in 26.5.1)
Component: com.arcadedb.engine.WALFile / TransactionManager

Summary

A torn write in the middle of one transaction record (header valid but
segment truncated, or torn magic number) makes getTransaction return
null. The recovery loop interprets null as "end of WAL" and abandons
later valid transactions in the same file.

With TX_WAL_FILES > 1 (default = number of cores) WAL files are written
in parallel; a torn record in one of them ends WAL replay there even
though subsequent records are intact.

Code

engine/com/arcadedb/engine/WALFile.java:148–222
engine/com/arcadedb/engine/TransactionManager.java:230–253

Suggested fix

Distinguish "torn record" from "physical EOF": scan forward for the next
plausible record header (txId monotonic, plausible magic-number alignment)
or fail loudly. Log SEVERE with the file/offset.

Activity

  1. self-assigned this
    on Jun 8, 2026
  2. added theissue type on Jun 8, 2026
  3. added this to the 26.7.1 milestone on Jun 8, 2026
  4. lvca commented on Jun 8, 2026

    @lvca
    Member

    This was quite internal, thanks @ruispereira ! Fixed now.

  5. ruispereira commented on Jun 8, 2026

    @ruispereira
    ContributorAuthor

    No problem :)

  6. added 2 commits that reference this issue on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions