Add pg_durable compaction adapter - #476
Draft
tjgreen42 wants to merge 7 commits into
Draft
Conversation
tjgreen42
changed the base branch from
background-compaction-2-api
to
background-compaction-3-dispatch
August 29, 2026 03:40
tjgreen42
force-pushed
the
background-compaction-4-pg-durable
branch
from
August 29, 2026 03:44
2f4324c to
04594fa
Compare
tjgreen42
force-pushed
the
background-compaction-4-pg-durable
branch
2 times, most recently
from
August 29, 2026 04:38
2963fd2 to
1478422
Compare
tjgreen42
force-pushed
the
background-compaction-4-pg-durable
branch
from
August 30, 2026 05:27
1478422 to
7c0516a
Compare
tjgreen42
force-pushed
the
background-compaction-4-pg-durable
branch
from
August 30, 2026 06:10
7c0516a to
760e9d9
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
tjgreen42
force-pushed
the
background-compaction-4-pg-durable
branch
from
August 30, 2026 06:20
760e9d9 to
a1b340c
Compare
This was referenced Aug 30, 2026
tjgreen42
force-pushed
the
background-compaction-4-pg-durable
branch
from
August 31, 2026 01:41
a1b340c to
ec88da1
Compare
tjgreen42
force-pushed
the
background-compaction-4-pg-durable
branch
from
August 31, 2026 03:20
ec88da1 to
063744a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an optional pg_durable adapter for per-index background compaction
requests. The adapter keeps pg_textsearch's core dispatch scheduler-neutral
while providing hardened operator scripts for deployments that use
pg_durable.
Design
01_setup_role.sqlcreates and validates a least-privilege compactor rolewithout changing state when required pg_durable capabilities are absent or
drifted.
02_wrapper.sqlinstalls a SECURITY DEFINER request wrapper with a fixedsearch path, explicit target validation, and owner-only helper privileges.
the per-index identity and stale-target bookkeeping rather than requiring a
keyed scheduling API upstream.
relfilenode, and creation identity so a stale job cannot compact a
replacement relation.
bm25_compact_step()in separate transactions and uses thefailure policy supplied by pg_durable's seven-argument
df.start.nonowners using explicitly qualified catalog operators.
The scripts fail closed on hostile or drifted managed objects, authenticate
extension-owned pg_durable entry points, and keep the callback handoff free of
privilege escalation or stale-object reuse.
Merge blocker
Do not merge until microsoft/pg_durable#354 lands in a release. Released
pg_durable v0.2.6 and current main do not provide failure-resilient recurrence.
PR #354 targets v0.2.7 and adds the required
on_failure => continuepolicythrough the seven-argument
df.start; this adapter deliberately does notinvent a new
df.loopAPI. The localized capability checks must gain thereleased version floor once that release is available.
Test coverage
The static harness verifies wrapper identity, body hashes, extension
ownership, privilege boundaries, callback wiring, and package contents. The
live adapter harness covers transaction callbacks, precise skipping against
v0.2.6 with no side effects, and full execution against the pg_durable #354
implementation.
Stack position
This is the fourth layer of GitHub stack #479 and remains a draft because of
the upstream release blocker. It builds on #477's scheduler-neutral dispatch;
the final layer adds the singleton recovery backstop and operational
packaging.