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

Adjust max_prepared_transactions only when it is default #7712

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/backend/distributed/transaction/transaction_management.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,18 @@ AdjustMaxPreparedTransactions(void)
* (connections * 2 currently). If the user explicitly configured 2PC, we
* leave the configuration alone - there might have been intent behind the
* decision.
*
* find_option is declared static in guc.c for older versions, so we can't
* really check if max_prepared_xacts is configured by the user explicitly,
* so check if it's value is default.
*/
#if PG_VERSION_NUM >= PG_VERSION_16
struct config_generic *gconf = find_option("max_prepared_transactions",
true, false, 0);
if (gconf->source == PGC_S_DEFAULT)
#else
if (max_prepared_xacts == 0)
#endif
{
char newvalue[12];

Expand Down
Loading