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

Fix locking rows when partitioning with a lock timeout #435

Merged

Conversation

cbisnett
Copy link

@cbisnett cbisnett commented Feb 9, 2022

When running partition_data_proc() or partition_data_time() with a non-zero value for p_lock_wait, the query generated to lock the rows for updating incorrectly includes the table name where it should be including p_partition_expression. This PR fixes that issue by indexing the correct argument to format.

I don't have a setup to test this, but I ran into this in a production environment while trying to understand why moving data from the default partition didn't appear to be making any progress. I also didn't write any tests because I wasn't sure what minimum level of SQL would be necessary for testing this. Hopefully that's not an issue for getting this merged.

Ultimately this isn't blocking my progress, but I figured I would make this quick update. Let me know if you want me to make any updates to the CHANGELOG or any other files.

@keithf4
Copy link
Collaborator

keithf4 commented Feb 17, 2022

Thanks for this! Looks good on initial review and not sure it needs extra testing. Will take a closer look when I get a chance.

@keithf4 keithf4 self-assigned this Feb 17, 2022
@keithf4 keithf4 changed the base branch from master to 4.6.1 March 11, 2022 19:54
@keithf4 keithf4 merged commit d1a34f4 into pgpartman:4.6.1 Mar 11, 2022
@cbisnett cbisnett deleted the fix-partition-time-nowait-query branch March 12, 2022 14:01
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.

2 participants