Skip to content

PageShadow spill channel has no reopen after an interrupt closes it, so one interrupt fails the snapshot window (follow-up of #9306) #9444

Closed

Description

@robfrank

Summary

Follow-up of #9306. The point-in-time snapshot's shadow spill file (PageShadow.spillChannel) is a plain FileChannel.open(...) with no interrupt protection and no reopen. An interrupt landing on any thread doing I/O on it closes it for every thread (ClosedByInterruptException), and from then on:

  • PageShadow.store (pre-image capture that spills past the RAM budget) throws -> PageManager.capturePreImages invalidates the window (STATUS.FAILED);
  • PageShadow.read (called from PageSnapshot.SnapshotFileInputStream.fill for every page of every run) throws -> the HA snapshot ship / full backup fails mid-archive.

#9306 gave every channel operation of PaginatedComponentFile (the DATA files) a bounded reopen-and-retry. The spill file is the same failure mode on the other half of the snapshot read path, but a different class with its own locking (a monitor, range reservation outside it), so it was left out of that PR.

Where

engine/src/main/java/com/arcadedb/engine/PageShadow.java:

  • store: spillChannel = FileChannel.open(spillFile.toPath(), CREATE_NEW, READ, WRITE) and pos += channel.write(buffer, pos) outside the monitor;
  • read: channel.read(buffer, pos) outside the monitor.

Neither catches ClosedChannelException, and the channel is not protected the way PaginatedComponentFile.doNotCloseOnInterrupt protects data files.

Suggested fix

Either apply the same doNotCloseOnInterrupt treatment to the spill channel, or reopen it (READ/WRITE, without CREATE_NEW) under the monitor on ClosedChannelException and retry a bounded number of times, mirroring PaginatedComponentFile.reopenAndRetry. A reopen must be refused once the shadow is closed.

Scope

Only reachable when a window spills (arcadedb.pageSnapshotMaxRAM exceeded) - large backups / HA ships under write load, which is exactly when the window is long enough for an interrupt to land.

Activity

  1. added this to the 26.11.1 milestone on Oct 7, 2026
  2. added
    storage
    engine
    backup-restore
    on Oct 7, 2026
  3. added
    concurrency
    severity:minor
    on Oct 7, 2026
  4. added
    in progress
    on Oct 7, 2026
  5. self-assigned this
    on Oct 7, 2026
  6. added a commit that references this issue on Oct 8, 2026
  7. lvca commented on Oct 8, 2026

    @lvca
    Member

    Fixed in #9474 (26.11.1).

    A backup or HA snapshot keeps copies of changed pages in a temporary file once they exceed the RAM budget. An interrupted thread could close that file, making the whole backup/ship fail. The file is now protected from interrupts like the data files, and if it gets closed anyway it is reopened and the read/write retried, so a single interrupt no longer kills the backup.


    ❤️ 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.

  8. removed
    in progress
    on Oct 8, 2026
  9. 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

backup-restorebugconcurrencyengineseverity:minorstorage

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions