Skip to content

TableScanBuilder::UseRef truncates snapshot IDs above INT32_MAX #660

@fallintoplace

Description

@fallintoplace

Problem

TableScanBuilder::UseRef() copies SnapshotRef::snapshot_id into an int32_t before looking up the snapshot and writing the scan context.

Snapshot IDs are stored as int64_t in SnapshotRef, TableMetadata::SnapshotById, and TableScanContext. A ref that points at a snapshot ID greater than INT32_MAX can be truncated, which can make branch/ref scans fail to find the snapshot or select the wrong ID.

Expected

UseRef() should preserve the full int64_t snapshot ID when resolving a ref.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions