fix minor table which has backup cannot place into table store.

This commit is contained in:
wxhwang 2024-09-18 08:33:08 +00:00 committed by ob-robot
parent 6b0e52faba
commit e22302afff

View File

@ -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<ObITable *, MAX_SSTABLE_CNT_IN_STORAGE> 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));