[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:
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user