Skip to content

Commit

Permalink
YSQL: Disable random warmup of connections in Connection Manager
Browse files Browse the repository at this point in the history
Summary: This diff disables the random mode of warmup and allocation of connections when using Connection Manager, while keeping it only enabled for java tests.

Test Plan:
Jenkins: enable connection manager, all tests

Verified locally using test logs that random warmup is still enabled, and using a local cluster to verify that warmup mode is disabled by default for regular use

Reviewers: skumar, mkumar, devansh.saxena, vpatibandla, stiwary

Reviewed By: skumar

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D39488
  • Loading branch information
Rahul Barigidad committed Oct 30, 2024
1 parent 4ea408c commit ec40a8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions java/yb-pgsql/src/test/java/org/yb/pgsql/BasePgSQLTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ protected void customizeMiniClusterBuilder(MiniYBClusterBuilder builder) {
builder.enableYsqlConnMgr(true);
builder.addCommonTServerFlag("ysql_conn_mgr_stats_interval",
Integer.toString(CONNECTIONS_STATS_UPDATE_INTERVAL_SECS));
builder.addCommonTServerFlag("TEST_ysql_conn_mgr_dowarmup_all_pools_mode",
warmupMode.toString().toLowerCase());
builder.addCommonTServerFlag("ysql_conn_mgr_superuser_sticky", "false");
}
}
Expand Down Expand Up @@ -665,12 +667,8 @@ void setConnMgrWarmupModeAndRestartCluster(ConnectionManagerWarmupMode wm) throw
return;
}

Map<String, String> tsFlagMap = getTServerFlags();
tsFlagMap.put("TEST_ysql_conn_mgr_dowarmup_all_pools_mode",
wm.toString().toLowerCase());
warmupMode = wm;
Map<String, String> masterFlagMap = getMasterFlags();
restartClusterWithFlags(masterFlagMap, tsFlagMap);
restartCluster();
}

protected boolean isConnMgrWarmupRoundRobinMode() {
Expand Down
2 changes: 1 addition & 1 deletion src/yb/yql/pggate/ybc_pggate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ DEFINE_UNKNOWN_bool(ysql_disable_server_file_access, false,

DEFINE_NON_RUNTIME_bool(ysql_enable_profile, false, "Enable PROFILE feature.");

DEFINE_test_flag(string, ysql_conn_mgr_dowarmup_all_pools_mode, "random",
DEFINE_test_flag(string, ysql_conn_mgr_dowarmup_all_pools_mode, "none",
"Enable precreation of server connections in every pool in Ysql Connection Manager and "
"choose the mode of attachment of idle server connections to clients to serve their queries. "
"ysql_conn_mgr_dowarmup is responsible for creating server connections only in "
Expand Down

0 comments on commit ec40a8e

Please sign in to comment.