From bb37fd7a3c41c82f047d6932f54325c067114c24 Mon Sep 17 00:00:00 2001 From: JiahuaChen Date: Wed, 9 Nov 2022 15:05:57 +0000 Subject: [PATCH] Fix ObCreateTabletInfo wrongly assigned --- src/share/ob_rpc_struct.h | 6 ++++-- src/storage/tablet/ob_tablet_create_delete_helper.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/share/ob_rpc_struct.h b/src/share/ob_rpc_struct.h index 616dfe791..ad91f135c 100644 --- a/src/share/ob_rpc_struct.h +++ b/src/share/ob_rpc_struct.h @@ -2699,6 +2699,8 @@ public: common::ObSArray table_schema_index_; lib::Worker::CompatMode compat_mode_; bool is_create_bind_hidden_tablets_; +private: + DISALLOW_COPY_AND_ASSIGN(ObCreateTabletInfo); }; struct ObBatchCreateTabletArg @@ -7117,11 +7119,11 @@ public: dest_schema_id_(OB_INVALID_ID), schema_version_(0), snapshot_version_(0), ddl_type_(0), task_id_(0), parallelism_(0), execution_id_(0) {} bool is_valid() const { return OB_INVALID_ID != tenant_id_ && ls_id_.is_valid() && source_tablet_id_.is_valid() && dest_tablet_id_.is_valid() - && OB_INVALID_ID != source_table_id_ && OB_INVALID_ID != dest_schema_id_ && schema_version_ > 0 && snapshot_version_ > 0 + && OB_INVALID_ID != source_table_id_ && OB_INVALID_ID != dest_schema_id_ && schema_version_ > 0 && snapshot_version_ > 0 && task_id_ > 0 && parallelism_ > 0; } int assign(const ObDDLBuildSingleReplicaRequestArg &other); - TO_STRING_KV(K_(tenant_id), K_(ls_id), K_(source_tablet_id), K_(dest_tablet_id), + TO_STRING_KV(K_(tenant_id), K_(ls_id), K_(source_tablet_id), K_(dest_tablet_id), K_(source_table_id), K_(dest_schema_id), K_(schema_version), K_(snapshot_version), K_(task_id), K_(parallelism), K_(execution_id)); public: uint64_t tenant_id_; diff --git a/src/storage/tablet/ob_tablet_create_delete_helper.cpp b/src/storage/tablet/ob_tablet_create_delete_helper.cpp index 3a60a16d2..e698b40d5 100644 --- a/src/storage/tablet/ob_tablet_create_delete_helper.cpp +++ b/src/storage/tablet/ob_tablet_create_delete_helper.cpp @@ -1732,7 +1732,7 @@ int ObTabletCreateDeleteHelper::build_tablet_create_info( // find hidden lob info int64_t aux_idx = -1; if (find_related_aux_info(arg, tablet_create_info.data_tablet_id_, aux_idx)) { - const ObCreateTabletInfo aux_info = arg.tablets_.at(aux_idx); + const ObCreateTabletInfo &aux_info = arg.tablets_.at(aux_idx); if (OB_FAIL(fill_aux_infos(arg, aux_info, tablet_create_info))) { LOG_WARN("failed to fill aux info", K(ret), K(PRINT_CREATE_ARG(arg)), K(aux_idx)); } else if (OB_FAIL(skip_idx.push_back(aux_idx))) {