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

021_twophase test failure #7711

Open
Green-Chan opened this issue Oct 21, 2024 · 0 comments · May be fixed by #7712
Open

021_twophase test failure #7711

Green-Chan opened this issue Oct 21, 2024 · 0 comments · May be fixed by #7712

Comments

@Green-Chan
Copy link
Contributor

In commit postgres/postgres@b39c5272 021_twophase test was changed, and it doesn't pass with loaded Citus library any more. Apparently, when max_prepared_transactions is set to zero, Citus overrides it, while the test sets this GUC to zero and relies on this.

Here is how I run this test. In postgres build directory:

echo "shared_preload_libraries = 'citus'" > temp.conf
TEMP_CONFIG=$PWD/temp.conf make installcheck -C src/test/subscription

Citus overrides max_prepared_transactions in function AdjustMaxPreparedTransactions:

/*
 * As Citus uses 2PC internally, there always should be some available. As
 * the default is 0, we increase it to something appropriate
 * (connections * 2 currently).  If the user explicitly configured 2PC, we
 * leave the configuration alone - there might have been intent behind the
 * decision.
 */
if (max_prepared_xacts == 0)
{
	...
}

The comment is slightly inconsistent with the code here. If max_prepared_transactions is set to zero explicitly (as it is in 021_twophase test), Citus overrides it anyway.

Do you think fixing Citus to pass this test worth it? I'm going to create a pull request soon, where I change AdjustMaxPreparedTransactions to really check if max_prepared_transactions is explicitly set by user. Please take a look.

I also believe that it should be mentioned in the documentation that Citus overrides max_prepared_transactions in some cases.

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 a pull request may close this issue.

1 participant