Skip to content

VACUUM with page size increase does not check for write error #346

Description

@rhashimoto

There is a call to FileSystemSyncAccessHandle.write() in WriteAhead.write() (next to last line in this excerpt):

// New page size is larger. Save the page data to the WAL file
// so it can be read back and rewritten as frames with the new
// page size.
const pageOffset = offset % this.#txInProgress.newPageSize;
const waOffset = this.#activeOffset +
(offset - pageOffset) / this.#txInProgress.newPageSize * frameSize +
FRAME_HEADER_SIZE +
pageOffset;
this.#activeHandle.write(data.subarray(), { at: waOffset });
this.log?.(`%cwrite page at ${offset} to WAL ${this.#activeHeader.salt1 & 1}:${waOffset}`, 'background-color: lightskyblue;');

This call is made when executing a VACUUM with a change to a larger page size. The return value is not checked for success, so a failure here (e.g. an incomplete write due to exhausting quota) will not be detected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions