Skip to content

Admit retained relation ownership transitions for COW and arena promotion #1434

Description

@justinjoy

Context

PR #1433 admits heap-owned, session-retained EDB relation columns and timestamps. Retained relations can still reach ownership-transition paths that are intentionally outside that unit: copy-on-write unsharing and arena-to-heap promotion.

Scope

Make retained relation ownership transitions participate in the shared memory governor without double-counting borrowed or arena-owned buffers.

  • Admit COW unsharing before allocating newly owned heap columns.
  • Admit arena-to-heap promotion before copying into heap storage.
  • Cover col_rel_cow_unshare(), retained col_rel_append_row() ownership-transition branches, and col_rel_append_all() when an attached destination is supported.
  • Publish the replacement reservation only after all allocations/copies succeed.
  • Preserve readable rows, ownership flags, capacity, timestamps, and the prior reservation on denial.
  • Release shared/arena and replacement ownership exactly once on destroy.

Tests

  • Exact-fit and one-byte-over-budget COW growth tests.
  • Exact-fit and one-byte-over-budget arena promotion tests.
  • Denial preserves rows, capacity, ownership flags, timestamps, and reservation.
  • ASan/UBSan coverage for success, denial, and destruction.

Dependency

Depends on #1430 and the heap-retained admission work in PR #1433.

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