citusdata / citus

Distributed PostgreSQL as an extension
https://www.citusdata.com
GNU Affero General Public License v3.0
10.63k stars 670 forks source link

Adjust max_prepared_transactions only when it is default #7712

Open Green-Chan opened 1 month ago

Green-Chan commented 1 month ago

Fixes #7711. Change AdjustMaxPreparedTransactions to really check if max_prepared_transactions is explicitly set by user, and only adjust max_prepared_transactions when it is default. This fixes 021_twophase test failure with loaded Citus library after postgres/postgres@b39c5272.

Green-Chan commented 1 month ago

Argh, I always forget to check it with older PG versions. find_option is declared static in guc.c, so it won't work. Check using find_options for PG versions >= 16, and keep the old check for older versions is too ugly, isn't it?