Skip to content
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

Issue #437: Cleanup temporary indexes on error (with --only-indexes) #440

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

za-arthur
Copy link
Collaborator

When using --only-indexes pg_repack uses different approach to repack indexes, which is running CREATE INDEX CONCURRENTLY command to create a temporary index and swapping the target index and the temporary index afterwards.
That approach didn't use any cleanup callbacks and therefore in case of an error temporary indexes wouldn't be cleaned up.

The commit adds the callback repack_cleanup_index.

Issue: #437

When using --only-indexes pg_repack uses different approach to repack
indexes, which is running CREATE INDEX CONCURRENTLY command to create a
temporary index and swapping the target index and the temporary index
afterwards.
That approach didn't use any cleanup callbacks and therefore in case of
an error temporary indexes wouldn't be cleaned up.

The commit adds the callback repack_cleanup_index.
@za-arthur
Copy link
Collaborator Author

@andreasscherbaum @Melkij I'd merge this PR if no objections. There are no new tests since it will be necessary somehow to throw an error in the middle of repacking of an index.

@za-arthur za-arthur merged commit 306b0d4 into master Feb 3, 2025
20 checks passed
@za-arthur za-arthur deleted the issue437_cleanup_index_callback branch February 3, 2025 12:38
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