diff --git a/src/storage/high_availability/ob_ls_migration.cpp b/src/storage/high_availability/ob_ls_migration.cpp index 1e3a86e307acc776a82a79c6ab97322d1f9fa25b..7a155cc84d148100091b2af044869504b1a5ac3c 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 8a0da133ce36c49b54d1509881bb3b99d8fae726..5a3de2ccb85e766a486038ecf83c0a37a75b4c99 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_;