From 4d673a8b075deddd4b93d5a8ab66cbd05fea5bef Mon Sep 17 00:00:00 2001 From: godyangfight Date: Fri, 3 Mar 2023 06:40:58 +0000 Subject: [PATCH] Fix migration streaming rpc time out bug --- src/storage/high_availability/ob_ls_migration.cpp | 6 ++++-- src/storage/high_availability/ob_ls_migration.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/storage/high_availability/ob_ls_migration.cpp b/src/storage/high_availability/ob_ls_migration.cpp index 1e3a86e30..7a155cc84 100644 --- a/src/storage/high_availability/ob_ls_migration.cpp +++ b/src/storage/high_availability/ob_ls_migration.cpp @@ -3115,7 +3115,8 @@ int ObDataTabletsMigrationTask::build_tablet_group_info_() LOG_WARN("failed to push tablet id into array", K(ret), K(tablet_id)); } else { total_size = tablet_simple_info.data_size_; - for (int64_t j = i + 1; OB_SUCC(ret) && j < tablet_id_array.count(); ++j) { + int64_t max_tablet_count = 0; + for (int64_t j = i + 1; OB_SUCC(ret) && j < tablet_id_array.count() && max_tablet_count < MAX_TABLET_COUNT; ++j) { const ObTabletID &tmp_tablet_id = tablet_id_array.at(j); ObCopyTabletSimpleInfo tmp_tablet_simple_info; @@ -3134,6 +3135,7 @@ int ObDataTabletsMigrationTask::build_tablet_group_info_() LOG_WARN("failed to set tablet into set", K(ret), K(tmp_tablet_id)); } else { total_size += tmp_tablet_simple_info.data_size_; + max_tablet_count++; } } } @@ -3142,7 +3144,7 @@ int ObDataTabletsMigrationTask::build_tablet_group_info_() if (OB_FAIL(ctx_->tablet_group_mgr_.build_tablet_group_ctx(tablet_group_id_array))) { LOG_WARN("failed to build tablet group ctx", K(ret), K(tablet_group_id_array), KPC(ctx_)); } else { - LOG_INFO("succeed build tablet group ctx", K(tablet_group_id_array)); + LOG_INFO("succeed build tablet group ctx", K(tablet_group_id_array), "count", tablet_group_id_array.count()); } } } diff --git a/src/storage/high_availability/ob_ls_migration.h b/src/storage/high_availability/ob_ls_migration.h index 8a0da133c..5a3de2ccb 100644 --- a/src/storage/high_availability/ob_ls_migration.h +++ b/src/storage/high_availability/ob_ls_migration.h @@ -422,6 +422,7 @@ private: private: static const int64_t MAX_TABLET_GROUP_SIZE = 2 * 1024L * 1024L * 1024L; //2G + static const int64_t MAX_TABLET_COUNT = 100; bool is_inited_; ObLSHandle ls_handle_; ObMigrationCtx *ctx_; -- GitLab