[improvement](group_commit) Empty wal should be deleted when replaying it (#31427)

* [improvement](group_commit) Corrupt wal should be deleted when replaying it

* edit
This commit is contained in:
huanghaibin
2024-02-29 23:35:35 +08:00
committed by yiguolei
parent 6b2af74a63
commit 1398f11246
2 changed files with 4 additions and 1 deletions

View File

@ -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);

View File

@ -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);