Skip to content

reindex numbered concurrent artifacts#1297

Merged
brandur merged 1 commit into
masterfrom
bg/fix-numbered-reindex-artifacts
Jul 2, 2026
Merged

reindex numbered concurrent artifacts#1297
brandur merged 1 commit into
masterfrom
bg/fix-numbered-reindex-artifacts

Conversation

@bgentry

@bgentry bgentry commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Postgres can leave invalid _ccnew and _ccold indexes after a failed concurrent reindex. When artifacts already existed and Postgres had to append digits to keep names unique, River only checked the unnumbered forms and could keep trying the same reindex, adding more large artifacts.

Add a driver-level catalog lookup for artifacts belonging to a configured index. It matches the exact configured index name followed by _ccnew or _ccold with optional digits, returns the names for logging and cleanup, and lets stop-time cleanup drop the same numbered artifacts. SQLite keeps no-op semantics because it does not create concurrent reindex artifacts.

Extend the maintenance and driver conformance coverage for numbered forms and near-miss names so similar user-created indexes are not treated as PostgreSQL artifacts. Document the user-facing fix in the changelog.

Fixes #1296.

@bgentry bgentry requested a review from brandur July 2, 2026 14:39
@bgentry bgentry force-pushed the bg/fix-numbered-reindex-artifacts branch from 81842e7 to 80d1f32 Compare July 2, 2026 14:40
Postgres can leave invalid `_ccnew` and `_ccold` indexes after a
failed concurrent reindex. When artifacts already existed and Postgres
had to append digits to keep names unique, River only checked the
unnumbered forms and could keep trying the same reindex, adding more
large artifacts.

Add a driver-level catalog lookup for artifacts belonging to a
configured index. It matches the exact configured index name followed
by `_ccnew` or `_ccold` with optional digits, returns the names for
logging and cleanup, and lets stop-time cleanup drop the same numbered
artifacts. SQLite keeps no-op semantics because it does not create
concurrent reindex artifacts.

Extend the maintenance and driver conformance coverage for numbered
forms and near-miss names so similar user-created indexes are not
treated as PostgreSQL artifacts. Make `riverdbtest.TestSchema`'s
`DisableReuse` option use a fresh schema and avoid returning it to the
idle pool, which keeps schema-mutating tests from leaking ad hoc
indexes into later test cases.

Document the user-facing fix in the changelog.

Fixes #1296.
@bgentry bgentry force-pushed the bg/fix-numbered-reindex-artifacts branch from 80d1f32 to f5318c6 Compare July 2, 2026 14:50

@brandur brandur left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool.

@brandur brandur merged commit 986ac94 into master Jul 2, 2026
15 checks passed
@brandur brandur deleted the bg/fix-numbered-reindex-artifacts branch July 2, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

index hell: 210 GB of space for indexes that the logs say are never used...

2 participants