remove a defense code which will case restart failed in cornor case

This commit is contained in:
HaHaJeff
2023-07-11 14:25:42 +00:00
committed by ob-robot
parent 957f63a256
commit 4d44fedfa1
7 changed files with 554 additions and 350 deletions

View File

@ -1455,7 +1455,7 @@ int LogEngine::try_clear_up_holes_and_check_storage_integrity_(
block_id_t min_block_id = LOG_INVALID_BLOCK_ID;
block_id_t max_block_id = LOG_INVALID_BLOCK_ID;
int64_t logical_block_size = 0;
const LSN log_storage_tail = log_storage_.get_end_lsn();
if (OB_FAIL(log_storage_.get_logical_block_size(logical_block_size))) {
PALF_LOG(WARN, "get_logical_block_size failed", K(ret), K_(palf_id), K_(is_inited));
} else if (FALSE_IT(base_block_id = lsn_2_block(base_lsn, logical_block_size))) {
@ -1475,7 +1475,10 @@ int LogEngine::try_clear_up_holes_and_check_storage_integrity_(
} else {
ret = OB_SUCCESS;
}
} else if (!last_group_entry_header.is_valid()) {
// If log_storage_ is not empty but last_group_entry_header is invalid, unexpected error.
// For rebuild, the base_lsn may be greater than the log_tail of LogStorage because we
// update LogSnapshotMeta firstly.
} else if (log_storage_.get_end_lsn() != base_lsn && !last_group_entry_header.is_valid()) {
ret = OB_ERR_UNEXPECTED;
PALF_LOG(ERROR, "unexpected error, LogStorage are not empty bus last log entry is invalid",
K(last_entry_begin_lsn), K(expected_next_block_id), K(last_group_entry_header));