From bd2c5092917fd3e0a148c398d33918c77993f6f9 Mon Sep 17 00:00:00 2001 From: Tsunaou <895254752@qq.com> Date: Mon, 29 Jul 2024 04:13:02 +0000 Subject: [PATCH] placeholder for newly add with_cs_replica_ filed in ddl start log and redo info, for column store replica feature --- src/storage/ddl/ob_ddl_clog.cpp | 5 +++-- src/storage/ddl/ob_ddl_clog.h | 3 ++- src/storage/ddl/ob_ddl_inc_redo_log_writer.cpp | 1 + src/storage/ddl/ob_ddl_struct.cpp | 7 +++++-- src/storage/ddl/ob_ddl_struct.h | 4 +++- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/storage/ddl/ob_ddl_clog.cpp b/src/storage/ddl/ob_ddl_clog.cpp index 524516f95b..fecaeda8fe 100644 --- a/src/storage/ddl/ob_ddl_clog.cpp +++ b/src/storage/ddl/ob_ddl_clog.cpp @@ -397,7 +397,7 @@ DEFINE_GET_SERIALIZE_SIZE(ObDDLClogHeader) ObDDLStartLog::ObDDLStartLog() : table_key_(), data_format_version_(0), execution_id_(-1), direct_load_type_(ObDirectLoadType::DIRECT_LOAD_DDL) /*for compatibility*/, - lob_meta_tablet_id_(ObDDLClog::COMPATIBLE_LOB_META_TABLET_ID) + lob_meta_tablet_id_(ObDDLClog::COMPATIBLE_LOB_META_TABLET_ID), with_cs_replica_(false) { } @@ -419,11 +419,12 @@ int ObDDLStartLog::init( execution_id_ = execution_id; direct_load_type_ = direct_load_type; lob_meta_tablet_id_ = lob_meta_tablet_id; + with_cs_replica_ = false; // TODO(chengkong): placeholder for column store replica feature } return ret; } -OB_SERIALIZE_MEMBER(ObDDLStartLog, table_key_, data_format_version_, execution_id_, direct_load_type_, lob_meta_tablet_id_); +OB_SERIALIZE_MEMBER(ObDDLStartLog, table_key_, data_format_version_, execution_id_, direct_load_type_, lob_meta_tablet_id_, with_cs_replica_); ObDDLRedoLog::ObDDLRedoLog() : redo_info_() diff --git a/src/storage/ddl/ob_ddl_clog.h b/src/storage/ddl/ob_ddl_clog.h index 7625b2d380..b786fd5bce 100644 --- a/src/storage/ddl/ob_ddl_clog.h +++ b/src/storage/ddl/ob_ddl_clog.h @@ -203,13 +203,14 @@ public: int64_t get_execution_id() const { return execution_id_; } ObDirectLoadType get_direct_load_type() const { return direct_load_type_; } const ObTabletID &get_lob_meta_tablet_id() const { return lob_meta_tablet_id_; } - TO_STRING_KV(K_(table_key), K_(data_format_version), K_(execution_id), K_(direct_load_type), K_(lob_meta_tablet_id)); + TO_STRING_KV(K_(table_key), K_(data_format_version), K_(execution_id), K_(direct_load_type), K_(lob_meta_tablet_id), K_(with_cs_replica)); private: ObITable::TableKey table_key_; // use table type to distinguish column store, column group id is valid uint64_t data_format_version_; // used for compatibility int64_t execution_id_; ObDirectLoadType direct_load_type_; ObTabletID lob_meta_tablet_id_; // avoid replay get newest mds data + bool with_cs_replica_; }; class ObDDLRedoLog final diff --git a/src/storage/ddl/ob_ddl_inc_redo_log_writer.cpp b/src/storage/ddl/ob_ddl_inc_redo_log_writer.cpp index e76ac18b3d..3ee0348d53 100644 --- a/src/storage/ddl/ob_ddl_inc_redo_log_writer.cpp +++ b/src/storage/ddl/ob_ddl_inc_redo_log_writer.cpp @@ -738,6 +738,7 @@ int ObDDLIncRedoLogWriterCallback::write( redo_info_.data_format_version_ = data_format_version_; redo_info_.type_ = direct_load_type_; redo_info_.trans_id_ = trans_id_; + redo_info_.with_cs_replica_ = false; // TODO(chengkong): placeholder for column store replica feature if (OB_FAIL(ddl_inc_writer_.write_inc_redo_log_with_retry(redo_info_, macro_block_id_, task_id_, tx_desc_))) { LOG_WARN("write ddl inc redo log fail", K(ret)); } diff --git a/src/storage/ddl/ob_ddl_struct.cpp b/src/storage/ddl/ob_ddl_struct.cpp index 2b20d93f9e..1538c48250 100644 --- a/src/storage/ddl/ob_ddl_struct.cpp +++ b/src/storage/ddl/ob_ddl_struct.cpp @@ -321,7 +321,8 @@ ObDDLMacroBlockRedoInfo::ObDDLMacroBlockRedoInfo() data_format_version_(0/*for compatibility*/), end_row_id_(-1), type_(ObDirectLoadType::DIRECT_LOAD_INVALID), - trans_id_() + trans_id_(), + with_cs_replica_(false) { } @@ -336,6 +337,7 @@ void ObDDLMacroBlockRedoInfo::reset() end_row_id_ = -1; type_ = ObDirectLoadType::DIRECT_LOAD_INVALID; trans_id_.reset(); + with_cs_replica_ = false; } bool ObDDLMacroBlockRedoInfo::is_valid() const @@ -360,7 +362,8 @@ OB_SERIALIZE_MEMBER(ObDDLMacroBlockRedoInfo, data_format_version_, end_row_id_, type_, - trans_id_); + trans_id_, + with_cs_replica_); ObTabletDirectLoadMgrHandle::ObTabletDirectLoadMgrHandle() : tablet_mgr_(nullptr) diff --git a/src/storage/ddl/ob_ddl_struct.h b/src/storage/ddl/ob_ddl_struct.h index add0371fc0..8a221fffe6 100644 --- a/src/storage/ddl/ob_ddl_struct.h +++ b/src/storage/ddl/ob_ddl_struct.h @@ -185,7 +185,8 @@ public: K_(data_format_version), K_(end_row_id), K_(type), - K_(trans_id)); + K_(trans_id), + K_(with_cs_replica)); public: storage::ObITable::TableKey table_key_; ObString data_buffer_; @@ -196,6 +197,7 @@ public: int64_t end_row_id_; storage::ObDirectLoadType type_; transaction::ObTransID trans_id_; // for incremental direct load only + bool with_cs_replica_; }; class ObTabletDirectLoadMgr;