Skip to content

Commit

Permalink
Cut down the wait time for sync schema in restart (#7672)
Browse files Browse the repository at this point in the history
close #7671
  • Loading branch information
hongyunyan authored Jun 16, 2023
1 parent 41c1317 commit cf98d94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dbms/src/Interpreters/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ struct Settings
M(SettingUInt64, recv_queue_size, 0, "size of ExchangeReceiver queue, 0 means the size is set to data_source_mpp_task_num * 50") \
M(SettingUInt64, shallow_copy_cross_probe_threshold, 0, "minimum right rows to use shallow copy probe mode for cross join, default is max(1, max_block_size/10)") \
M(SettingInt64, max_buffered_bytes_in_executor, 200LL * 1024 * 1024, "The max buffered size in each executor, 0 mean unlimited, use 200MB as the default value") \
M(SettingUInt64, bg_ddl_sync_schema_interval, 60, "The interval of background DDL sync schema in seconds")
M(SettingUInt64, bg_ddl_sync_schema_interval, 60, "The interval of background DDL sync schema in seconds") \
M(SettingUInt64, ddl_restart_wait_seconds, 180, "The wait time for sync schema in seconds when restart")


// clang-format on
Expand Down
3 changes: 2 additions & 1 deletion dbms/src/Server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,8 @@ void syncSchemaWithTiDB(
/// If in API V2 mode, each keyspace's schema is fetch lazily.
if (storage_config.api_version == 1)
{
for (int i = 0; i < 60; i++) // retry for 3 mins
Stopwatch watch;
while (watch.elapsedSeconds() < global_context->getSettingsRef().ddl_restart_wait_seconds) // retry for 3 mins
{
try
{
Expand Down

0 comments on commit cf98d94

Please sign in to comment.