From e22302afffe73ac70c2c53262af605566f74adb8 Mon Sep 17 00:00:00 2001 From: wxhwang Date: Wed, 18 Sep 2024 08:33:08 +0000 Subject: [PATCH] fix minor table which has backup cannot place into table store. --- src/storage/tablet/ob_tablet_table_store.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/storage/tablet/ob_tablet_table_store.cpp b/src/storage/tablet/ob_tablet_table_store.cpp index d6804c813..4d4565d30 100644 --- a/src/storage/tablet/ob_tablet_table_store.cpp +++ b/src/storage/tablet/ob_tablet_table_store.cpp @@ -1672,8 +1672,13 @@ int ObTabletTableStore::build_minor_tables( } } if (OB_SUCC(ret)) { + // If the new_table is generated by minor compaction, and all mini/minor sstables are purged, + // the result sstables will be empty. So, we need use old_sstables instead. + ObSEArray tmp_old_sstables; if (OB_NOT_NULL(new_table) && is_table_valid_mds_or_minor_sstable(*new_table, is_mds)) { - if (OB_FAIL(check_new_sstable_can_be_accepted_(sstables, new_table))) { + if (OB_FAIL(old_sstables.get_all_tables(tmp_old_sstables))) { + LOG_WARN("failed to get all tables", K(ret), K(old_sstables)); + } else if (OB_FAIL(check_new_sstable_can_be_accepted_(tmp_old_sstables, new_table))) { LOG_WARN("failed to check accept the compacted sstable", K(ret)); } else if (OB_FAIL(sstables.push_back(new_table))) { LOG_WARN("failed to add new minor table", K(ret), KPC(new_table));