Skip to content

Add relation view generations for cache invalidation #1438

Description

@justinjoy

Discovery context

Architect/Critic review of #1435 found that materialization-cache pinning can be implemented independently, but relation-view correctness needs a separate generation contract. Arrangement bucket generations do not cover same-row-count mutation, row permutation, compaction, rollback, COW transitions, or worker-copy ownership.

Scope

  • Add explicit rowset/order and storage-buffer generations to col_rel_t.
  • Increment the appropriate generation on append, permutation, compaction, rollback, COW unshare, and replacement-buffer publication.
  • Store source generations in materialization, filtered, sorted, and differential cache entries where applicable.
  • Reject stale views and force rebuild/miss even when nrows is unchanged.
  • Define worker clone/reset behavior for every generation field and validate teardown under sanitizers.

Acceptance criteria

  • Same-row-count mutation, permutation, retraction/rollback, compaction, and COW transitions invalidate the correct cached view.
  • Cache lookup validates source generations rather than relying only on row count or arrangement bucket generation.
  • Worker create/destroy with populated relation views has no stale-view, double-free, or use-after-free failure under ASan/UBSan.
  • Existing arrangement, filtered, differential, sorted, materialization, retraction, compaction, and worker tests remain green.
  • No public API/ABI, spill implementation, or suspended-reader subsystem is added.

Dependency

Depends on the materialization-cache pin/deferred-destruction unit in #1435 and feeds #1371, #1372, #1382, and #1383.

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions