-
Notifications
You must be signed in to change notification settings - Fork 226
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
Handle failure cases of report gc #4014
Merged
rbrw
merged 3 commits into
puppetlabs:7.x
from
austb:gh-4013/main/handle-report-gc-failures
Oct 21, 2024
Merged
Handle failure cases of report gc #4014
rbrw
merged 3 commits into
puppetlabs:7.x
from
austb:gh-4013/main/handle-report-gc-failures
Oct 21, 2024
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
austb
force-pushed
the
gh-4013/main/handle-report-gc-failures
branch
from
October 17, 2024 00:11
6780c59
to
5e1d0f5
Compare
austb
force-pushed
the
gh-4013/main/handle-report-gc-failures
branch
4 times, most recently
from
October 17, 2024 16:08
2b63c31
to
39cf59d
Compare
The beaker acceptance tests actually passed, but after the tests passed the Jenkins instance encountered an error |
Tagged PuppetDB for the release, so this can be merged anytime now |
postgres will coerce unquoted table names to lowercase, so have this function return lowercase from the start
austb
force-pushed
the
gh-4013/main/handle-report-gc-failures
branch
2 times, most recently
from
October 18, 2024 15:59
fa72125
to
3adda41
Compare
austb
force-pushed
the
gh-4013/main/handle-report-gc-failures
branch
from
October 21, 2024 22:00
3adda41
to
16d3cdc
Compare
The process of detaching a partition is a two transaction process. When the first transaction succeeds, the partition is now "pending". The second transaction needs an ACCESS EXCLUSIVE lock on the partition and can therefore sometimes fail. When this happens, subsequent GCs will fail because only one pending partition detachment is allowed. To handle this, catch the SQLException and finalize the pending detach operation. If that was a different partition from the partition we are trying to remove, retry the detach operation that failed.
If a partition is fully detached, but fails to be dropped during its GC operation, subsequent GC operations will not see that partition at all. It will be stranded and PuppetDB will never remove it. During GC, search for stranded partitions that need to be removed and add them to the list of partitions that need to be dropped. There is no structural way to tell the difference between a non-partitioned table and a detached partition table. This PR uses a regular expression, which means that PuppetDB cannot have any non-partitioned tables matching the regular expressions used to identify stranded partitions.
austb
force-pushed
the
gh-4013/main/handle-report-gc-failures
branch
from
October 21, 2024 22:04
16d3cdc
to
7d86914
Compare
rbrw
approved these changes
Oct 21, 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.
Fixes #4013