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

Lock issue with 1.5.1 on partitioned table repack #435

Open
ankitml opened this issue Dec 13, 2024 · 3 comments
Open

Lock issue with 1.5.1 on partitioned table repack #435

ankitml opened this issue Dec 13, 2024 · 3 comments
Assignees

Comments

@ankitml
Copy link

ankitml commented Dec 13, 2024

I am repacking a child partition of a partitioned table. It fails during swap after the indexes are created. I have not been able to successfully run a repack on 1.5.1, while on 1.5.0 it is succeeding.

{"levelname": "INFO", "message": "[repack.py] LOG: Initial worker 1 to build index: CREATE INDEX index_399285097 ON repack.table_399285089 USING gin (a, b, available_at, c)", "asctime": "2024-12-12 18:14:51,165"}
{"levelname": "INFO", "message": "[repack.py] LOG: Command finished in worker 1: CREATE UNIQUE INDEX index_399285097 ON repack.table_399285089 USING gin (a, b, available_at, c)", "asctime": "2024-12-12 18:14:51,165"}
{"levelname": "INFO", "message": "[repack.py] ERROR: query failed: ERROR:  must hold access exclusive lock on table \"table_399285089\"", "asctime": "2024-12-12 18:14:51,165"}
{"levelname": "INFO", "message": "[repack.py] DETAIL: query was: SELECT repack.repack_swap($1)", "asctime": "2024-12-12 18:14:51,165"}
@ankitml
Copy link
Author

ankitml commented Dec 13, 2024

Confirming, downgrading fixes it. Upgrading fails. This does not show up when a normal table that is not partitioned is repacked.
Postgres version 15. OS : Ubuntu 22.04

@za-arthur
Copy link
Collaborator

I couldn't reproduce the issue. Could you provide a reproduciable example?

@andreasscherbaum
Copy link
Collaborator

This needs more information about your environment, how you run pg_repack, what other activities are going on in the database.

You can also check pg_catalog.pg_locks for the other process(es) holding locks on this table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants