Skip to content

Conversation

@austb
Copy link
Contributor

@austb austb commented Oct 21, 2024

No description provided.

austb and others added 9 commits October 17, 2024 11:42
postgres will coerce unquoted table names to lowercase, so have this
function return lowercase from the start
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.
…handle-report-gc-failures

Handle failure cases of report gc
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ austb
❌ rbrw
You have signed the CLA already but the status is still pending? Let us recheck it.

@rbrw rbrw merged commit 560fdf9 into puppetlabs:main Oct 24, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants