8000 Adapt columnar stripe metadata updates for PostgreSQL 18 by m3hm3t · Pull Request #8030 · citusdata/citus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adapt columnar stripe metadata updates for PostgreSQL 18 #8030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: m3hm3t/pg18_support
Choose a base branch
from

Conversation

m3hm3t
Copy link
Contributor
@m3hm3t m3hm3t commented Jun 23, 2025

Fixes #8019

Background / Problem

  • PostgreSQL 18 (commit a07e03f…) removed heap_inplace_update() and related helpers.
  • Citus’ columnar writer relied on that API in UpdateStripeMetadataRow() to patch the columnar_stripe catalog row with the stripe file-offset, size, and row-count.
  • Building the extension against PG 18 therefore failed at link-time and, if stubbed out, left file_offset = 0, causing every insert to abort with
    ERROR: attempted columnar write … to invalid logical offset: 0

Scope of This PR

  • Keep the fast-path on PG 12–17 (heap_inplace_update() unchanged).
  • Switch to CatalogTupleUpdate() on PG 18+, matching core’s new catalog-update API.
  • Bump the lock level from AccessShareLockRowExclusiveLock when the normal heap-update path is taken.
  • No behavioral changes for users on PG ≤ 17

@m3hm3t m3hm3t self-assigned this Jun 23, 2025
@m3hm3t m3hm3t changed the base branch from main to m3hm3t/pg18_support June 23, 2025 16:45
Copy link
codecov bot commented Jun 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.12%. Comparing base (433e22e) to head (096a510).

Additional details and impacted files
@@                   Coverage Diff                   @@
##           m3hm3t/pg18_support    #8030      +/-   ##
=======================================================
+ Coverage                89.11%   89.12%   +0.01%     
=======================================================
  Files                      284      284              
  Lines                    61595    61600       +5     
  Branches                  7707     7707              
=======================================================
+ Hits                     54890    54902      +12     
+ Misses                    4477     4469       -8     
- Partials                  2228     2229       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@m3hm3t m3hm3t changed the title M3hm3t/pg18 columnar write 1 Adapt columnar stripe metadata updates for PostgreSQL 18 Jun 23, 2025
@m3hm3t m3hm3t marked this pull request as ready for review June 25, 2025 10:30
@m3hm3t m3hm3t requested a review from Copilot June 25, 2025 10:45
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adapts columnar stripe metadata updates for PostgreSQL 18 by switching from the deprecated in‐place update (heap_inplace_update) to CatalogTupleUpdate and adjusting the lock level accordingly.

  • Switch to CatalogTupleUpdate for PG 18+
  • Introduce a conditional lock mode (RowExclusiveLock vs AccessShareLock) based on the PostgreSQL version
  • Remove the PG <18 only in-place update block

@m3hm3t m3hm3t requested review from naisila and colm-mchugh and removed request for colm-mchugh June 25, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0