citusdata / citusdata/citus

Add fast recovery option to recover_prepared_transaction

Open
#4,186 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

The normal implementation of `recover_prepared_transactions` does not block 2PCs, but can cause table bloat.

We sometimes get into trouble with `pg_dist_transaction` becoming very large and transaction recovery or autovacuum struggling to delete tuples fast enough to bring it down in size. It would be useful to have a fast way to reset pg_dist_transaction by adding an option to `recover_prepared_transactions` which:

1. blocks 2PCs
2. rolls pending prepared transactions on workers forward
3. truncates pg_dist_transaction

That way, we can quickly restore order in case of emergency.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.