This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 6c515e0c76a38116332e998ec1650228941d6d3b Author: huanghaibin <284824...@qq.com> AuthorDate: Tue May 14 09:50:29 2024 +0800 [fix](group commit) Make compatibility issues on serializing and deserializing wal file more clear (#34793) --- be/src/agent/be_exec_version_manager.h | 1 + be/src/vec/exec/format/wal/wal_reader.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/be/src/agent/be_exec_version_manager.h b/be/src/agent/be_exec_version_manager.h index 32a520cc4bd..248bcfc7e1a 100644 --- a/be/src/agent/be_exec_version_manager.h +++ b/be/src/agent/be_exec_version_manager.h @@ -77,5 +77,6 @@ constexpr inline int BeExecVersionManager::min_be_exec_version = 0; /// functional constexpr inline int BITMAP_SERDE = 3; constexpr inline int USE_NEW_SERDE = 4; // release on DORIS version 2.1 +constexpr inline int OLD_WAL_SERDE = 3; // use to solve compatibility issues, see pr #32299 } // namespace doris diff --git a/be/src/vec/exec/format/wal/wal_reader.cpp b/be/src/vec/exec/format/wal/wal_reader.cpp index 1fbd395ad26..0d15c198b0e 100644 --- a/be/src/vec/exec/format/wal/wal_reader.cpp +++ b/be/src/vec/exec/format/wal/wal_reader.cpp @@ -17,6 +17,7 @@ #include "wal_reader.h" +#include "agent/be_exec_version_manager.h" #include "common/logging.h" #include "common/sync_point.h" #include "gutil/strings/split.h" @@ -52,9 +53,10 @@ Status WalReader::get_next_block(Block* block, size_t* read_rows, bool* eof) { // in the latest version. So if a wal is created by 2.1.0 (wal version=0 && be_exec_version=3), // it should upgrade the be_exec_version to 4 to use the new way to deserialize pblock to solve // compatibility issues.see https://github.com/apache/doris/pull/32299 - if (_version == 0 && pblock.has_be_exec_version() && pblock.be_exec_version() == 3) { + if (_version == 0 && pblock.has_be_exec_version() && + pblock.be_exec_version() == OLD_WAL_SERDE) { VLOG_DEBUG << "need to set be_exec_version to 4 to solve compatibility issues"; - pblock.set_be_exec_version(4); + pblock.set_be_exec_version(USE_NEW_SERDE); } if (st.is<ErrorCode::END_OF_FILE>()) { LOG(INFO) << "read eof on wal:" << _wal_path; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org