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 1398f112461b528c4925aa9c48b68fc2e57aa4d2 Author: huanghaibin <[email protected]> AuthorDate: Thu Feb 29 23:35:35 2024 +0800 [improvement](group_commit) Empty wal should be deleted when replaying it (#31427) * [improvement](group_commit) Corrupt wal should be deleted when replaying it * edit --- be/src/olap/wal/wal_reader.cpp | 3 +++ be/src/olap/wal/wal_table.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/be/src/olap/wal/wal_reader.cpp b/be/src/olap/wal/wal_reader.cpp index 0dfaa18a241..d1263daf1c5 100644 --- a/be/src/olap/wal/wal_reader.cpp +++ b/be/src/olap/wal/wal_reader.cpp @@ -86,6 +86,9 @@ Status WalReader::read_block(PBlock& block) { } Status WalReader::read_header(std::string& col_ids) { + if (file_reader->size() == 0) { + return Status::DataQualityError("empty file"); + } size_t bytes_read = 0; std::string magic_str; magic_str.resize(k_wal_magic_length); diff --git a/be/src/olap/wal/wal_table.cpp b/be/src/olap/wal/wal_table.cpp index 93cd12765f8..0389c6fed21 100644 --- a/be/src/olap/wal/wal_table.cpp +++ b/be/src/olap/wal/wal_table.cpp @@ -98,7 +98,7 @@ Status WalTable::_relay_wal_one_by_one() { doris::wal_fail << 1; LOG(WARNING) << "failed to replay wal=" << wal_info->get_wal_path() << ", st=" << st.to_string(); - if (!st.is<ErrorCode::NOT_FOUND>()) { + if (!st.is<ErrorCode::NOT_FOUND>() && !st.is<ErrorCode::DATA_QUALITY_ERROR>()) { need_retry_wals.push_back(wal_info); } else { need_delete_wals.push_back(wal_info); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
