From ae138ca6d863d15ceabebf696c909880dd1fa48e Mon Sep 17 00:00:00 2001 From: obdev Date: Sun, 30 Oct 2022 14:05:08 +0000 Subject: [PATCH] fix backup defend issue --- src/storage/backup/ob_backup_task.cpp | 4 ++-- src/storage/backup/ob_backup_utils.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/storage/backup/ob_backup_task.cpp b/src/storage/backup/ob_backup_task.cpp index 552f1552c2..2e80571f00 100644 --- a/src/storage/backup/ob_backup_task.cpp +++ b/src/storage/backup/ob_backup_task.cpp @@ -3993,7 +3993,6 @@ int ObLSBackupPrepareTask::get_tablet_min_filled_tx_log_ts_( } else if (tablet->get_tablet_meta().tablet_id_.is_ls_inner_tablet()) { // skip inner tablet } else { - min_filled_tx_log_ts = tablet->get_tablet_meta().clog_checkpoint_ts_; ObTabletTableStore &table_store = tablet->get_table_store(); const ObSSTableArray &sstable_array = table_store.get_minor_sstables(); has_minor_sstable = !sstable_array.empty(); @@ -4008,7 +4007,8 @@ int ObLSBackupPrepareTask::get_tablet_min_filled_tx_log_ts_( LOG_WARN("table ptr type not expectedd", K(ret)); } else if (FALSE_IT(sstable = static_cast(table_ptr))) { } else { - min_filled_tx_log_ts = std::min(sstable->get_meta().get_basic_meta().filled_tx_log_ts_, min_filled_tx_log_ts); + min_filled_tx_log_ts = std::min( + std::max(sstable->get_meta().get_basic_meta().filled_tx_log_ts_, sstable->get_end_log_ts()), min_filled_tx_log_ts); } } } diff --git a/src/storage/backup/ob_backup_utils.cpp b/src/storage/backup/ob_backup_utils.cpp index a31f621b0c..9f6f220e91 100644 --- a/src/storage/backup/ob_backup_utils.cpp +++ b/src/storage/backup/ob_backup_utils.cpp @@ -252,7 +252,7 @@ int ObBackupUtils::check_tablet_minor_sstable_validity_(const storage::ObTabletH LOG_WARN("table ptr not correct", K(ret), KPC(last_table_ptr)); } else { const ObITable::TableKey &table_key = last_table_ptr->get_key(); - if (table_key.get_end_log_ts() != clog_checkpoint_ts) { + if (table_key.get_end_log_ts() < clog_checkpoint_ts) { ret = OB_ERR_UNEXPECTED; LOG_ERROR("tablet meta is not valid", K(ret), K(table_key), K(clog_checkpoint_ts)); }