-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
AAP-15927 Use ATTACH PARTITION to avoid exclusive table lock for events #14433
Merged
Conversation
This file contains 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
AlanCoding
changed the title
Use ATTACH PARTITION to avoid exclusive table lock for events
AAP-15927 Use ATTACH PARTITION to avoid exclusive table lock for events
Sep 13, 2023
AlanCoding
force-pushed
the
attach_partition
branch
from
September 13, 2023 13:49
ba9ec51
to
77297d3
Compare
AlanCoding
force-pushed
the
attach_partition
branch
from
September 14, 2023 18:26
93c493c
to
fa02590
Compare
AlanCoding
force-pushed
the
attach_partition
branch
from
September 18, 2023 15:03
fa02590
to
933a1f9
Compare
Update: From the CI logs, I discovered that we're hitting a new kind of race condition. It is ever-so slightly different from the established one.
As such, I propose that we keep the current structure but add |
TheRealHaoLiu
approved these changes
Sep 21, 2023
already pass SOLOYO so I'm gonna go ahead and merge it |
kdelee
pushed a commit
to kdelee/awx
that referenced
this pull request
May 8, 2024
…r events (ansible#14433) (ansible#6491) * AAP-15927 Use ATTACH PARTITION to avoid exclusive table lock for events (ansible#14433) * Add null value handling in create_partition * Use cursor to fetchone, the established Django pattern --------- Co-authored-by: Alan Rominger <[email protected]>
djyasin
pushed a commit
to djyasin/awx
that referenced
this pull request
Sep 16, 2024
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
This parrots the example from postgresql docs
https://www.postgresql.org/docs/current/ddl-partitioning.html
Specifically, see the example:
This just replaces our current SQL for creating a partition with this example, editing the details to use the tables names and timestamps that we use.
Right now this is working, in that new jobs will create a partition and that goes fine.
I did add a new bit of code to this to pre-check for existence of the partition. Letting it error in postgres created a lot of log noise that we've found very distracting in the past so I wanted to go ahead and take care of this, particularly since I'm running a new version of our SQL code. I do think we should remove our existing error handling since I added this, so expect a new commit to do that.
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
I'm not yet sure if we need this part:
Because historically, the old method did not create this constraint. So I think we could just delete these lines, but including it is more compliant to the docs so I wanted to start with this.