Skip to content

Commit 8a4ba47

Browse files
committed
[#29405] YSQL: Make yb_make_all_ddl_statements_incrementing a test GUC
Summary: Previously, {D46348} introduced the `yb_make_all_ddl_statements_incrementing` GUC, which when enabled, makes all DDL statements increment the catalog version. This could potentially cause DDLs to fail that previously succeeded due to catalog version mismatch. For example, if a workload involves running multiple `CREATE TABLE` statements in parallel, this would previously be okay, but if `yb_make_all_ddl_statements_incrementing` was set to `true`, some of these `CREATE TABLE` DDLs would fail. This diff makes `yb_make_all_ddl_statements_incrementing` into a test GUC to discourage customers from setting it without understanding the consequences. We do this with the following two changes: - Add the `yb_test` prefix to the GUC. `yb_make_all_ddl_statements_incrementing` -> `yb_test_make_all_ddl_statements_incrementing` - Change the GUC's group from `CUSTOM_OPTIONS` to `DEVELOPER_OPTIONS`. Test Plan: ``` ./yb_build.sh release --java-test 'org.yb.pgsql.TestPgRegressMisc#makeAllDdlStatementsIncrementing' ``` Reviewers: myang Reviewed By: myang Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D48415
1 parent 4fc1e96 commit 8a4ba47

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgRegressMisc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void makeAllDdlStatementsIncrementing() throws Exception {
8989
Collections.emptyMap(),
9090
Collections.singletonMap(
9191
"ysql_pg_conf_csv",
92-
"yb_make_all_ddl_statements_incrementing=true"
92+
"yb_test_make_all_ddl_statements_incrementing=true"
9393
)
9494
);
9595
runPgRegressTest("yb_misc_catalog_version_increment_schedule");

src/postgres/src/backend/utils/cache/catcache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,11 +1931,11 @@ YbAllowNegativeCacheEntries(int cache_id,
19311931
bool implicit_prefetch_entries)
19321932
{
19331933
/*
1934-
* If yb_make_all_ddl_statements_incrementing is true, negative cache entries
1934+
* If yb_test_make_all_ddl_statements_incrementing is true, negative cache entries
19351935
* are always okay, because if a negative entry needs to be invalidated, the
19361936
* catalog version will be incremented.
19371937
*/
1938-
if (yb_make_all_ddl_statements_incrementing)
1938+
if (yb_test_make_all_ddl_statements_incrementing)
19391939
return true;
19401940

19411941
switch (cache_id)

src/postgres/src/backend/utils/misc/guc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3676,14 +3676,14 @@ static struct config_bool ConfigureNamesBool[] =
36763676
},
36773677

36783678
{
3679-
{"yb_make_all_ddl_statements_incrementing", PGC_SIGHUP, CUSTOM_OPTIONS,
3679+
{"yb_test_make_all_ddl_statements_incrementing", PGC_SIGHUP, DEVELOPER_OPTIONS,
36803680
gettext_noop("When set, all DDL statements will cause the "
36813681
"catalog version to increment. This mainly affects "
36823682
"CREATE commands such as CREATE TABLE, CREATE VIEW, "
36833683
"and CREATE SEQUENCE."),
36843684
NULL
36853685
},
3686-
&yb_make_all_ddl_statements_incrementing,
3686+
&yb_test_make_all_ddl_statements_incrementing,
36873687
false,
36883688
NULL, NULL, NULL
36893689
},
@@ -7500,7 +7500,7 @@ static const char *const YbDbAdminVariables[] = {
75007500
"yb_binary_restore",
75017501
"yb_speculatively_execute_pl_statements",
75027502
"yb_whitelist_extra_statements_for_pl_speculative_execution",
7503-
"yb_make_all_ddl_statements_incrementing",
7503+
"yb_test_make_all_ddl_statements_incrementing",
75047504
};
75057505

75067506

src/postgres/src/backend/utils/misc/pg_yb_utils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,7 +2249,7 @@ bool yb_enable_parallel_scan_colocated = true;
22492249
bool yb_enable_parallel_scan_hash_sharded = false;
22502250
bool yb_enable_parallel_scan_range_sharded = false;
22512251
bool yb_enable_parallel_scan_system = false;
2252-
bool yb_make_all_ddl_statements_incrementing = false;
2252+
bool yb_test_make_all_ddl_statements_incrementing = false;
22532253

22542254
/* DEPRECATED */
22552255
bool yb_enable_advisory_locks = true;
@@ -4148,10 +4148,10 @@ YbGetDdlMode(PlannedStmt *pstmt, ProcessUtilityContext context,
41484148
if (yb_make_next_ddl_statement_nonbreaking)
41494149
is_breaking_change = false;
41504150
/*
4151-
* If yb_make_all_ddl_statements_incrementing is true, we should be incrementing
4151+
* If yb_test_make_all_ddl_statements_incrementing is true, we should be incrementing
41524152
* the catalog version for all DDL statements.
41534153
*/
4154-
if (yb_make_all_ddl_statements_incrementing)
4154+
if (yb_test_make_all_ddl_statements_incrementing)
41554155
is_version_increment = true;
41564156
/*
41574157
* If yb_make_next_ddl_statement_nonincrementing is true, then no DDL statement

src/postgres/src/include/pg_yb_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ extern bool yb_enable_parallel_scan_system;
800800
/*
801801
* If set to true, all DDL statements will cause the catalog version to increment.
802802
*/
803-
extern bool yb_make_all_ddl_statements_incrementing;
803+
extern bool yb_test_make_all_ddl_statements_incrementing;
804804

805805
typedef struct YBUpdateOptimizationOptions
806806
{

src/postgres/src/test/regress/expected/yb.orig.catalog_version_increment.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- Test yb_make_all_ddl_statements_incrementing GUC.
1+
-- Test yb_test_make_all_ddl_statements_incrementing GUC.
22
-- All of the following DDL statements should increment current_version.
33
\set template1_db_oid 1
44
\set db_oid 'CASE WHEN (select count(*) from pg_yb_catalog_version) = 1 THEN :template1_db_oid ELSE (SELECT oid FROM pg_database WHERE datname = \'yugabyte\') END'
@@ -118,7 +118,7 @@ DROP TABLE temp_to_drop_guc;
118118
10012 | 10000
119119
(1 row)
120120

121-
-- Additional DDLs that should increment under yb_make_all_ddl_statements_incrementing=true.
121+
-- Additional DDLs that should increment under yb_test_make_all_ddl_statements_incrementing=true.
122122
CREATE OPERATOR ==# (
123123
LEFTARG = int,
124124
RIGHTARG = int,

src/postgres/src/test/regress/sql/yb.orig.catalog_version_increment.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- Test yb_make_all_ddl_statements_incrementing GUC.
1+
-- Test yb_test_make_all_ddl_statements_incrementing GUC.
22
-- All of the following DDL statements should increment current_version.
33
\set template1_db_oid 1
44
\set db_oid 'CASE WHEN (select count(*) from pg_yb_catalog_version) = 1 THEN :template1_db_oid ELSE (SELECT oid FROM pg_database WHERE datname = \'yugabyte\') END'
@@ -59,7 +59,7 @@ ALTER TABLE temp_to_drop_guc ADD COLUMN val int;
5959
DROP TABLE temp_to_drop_guc;
6060
:display_catalog_version;
6161

62-
-- Additional DDLs that should increment under yb_make_all_ddl_statements_incrementing=true.
62+
-- Additional DDLs that should increment under yb_test_make_all_ddl_statements_incrementing=true.
6363
CREATE OPERATOR ==# (
6464
LEFTARG = int,
6565
RIGHTARG = int,

src/postgres/src/test/regress/yb_misc_catalog_version_increment_schedule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
####################################################################################################
44
# This testsuite includes tests that test the catalog version increment when
5-
# yb_make_all_ddl_statements_incrementing is set to true. This needs to be a
5+
# yb_test_make_all_ddl_statements_incrementing is set to true. This needs to be a
66
# separate schedule because the flag requires a cluster restart to apply.
77
# The tests in this schedule are not ported from PostgreSQL original tests.
88
####################################################################################################

0 commit comments

Comments
 (0)