diff --git a/src/storage/ls/ob_ls_tablet_service.cpp b/src/storage/ls/ob_ls_tablet_service.cpp index 5366ca0556..2ecf7195b1 100644 --- a/src/storage/ls/ob_ls_tablet_service.cpp +++ b/src/storage/ls/ob_ls_tablet_service.cpp @@ -3240,12 +3240,12 @@ int ObLSTabletService::build_ha_tablet_new_table_store( if (OB_FAIL(ret)) { } else if (OB_FAIL(ObTabletSlogHelper::write_create_tablet_slog(new_tablet_handle, disk_addr))) { LOG_WARN("fail to write update tablet slog", K(ret), K(new_tablet_handle), K(disk_addr)); + } else if (OB_FAIL(old_tablet->set_memtable_clog_checkpoint_scn(param.tablet_meta_))) { + LOG_WARN("failed to set memtable clog checkpoint ts", K(ret), KPC(old_tablet), K(param)); } else if (OB_FAIL(t3m->compare_and_swap_tablet(key, disk_addr, old_tablet_handle, new_tablet_handle))) { LOG_ERROR("failed to compare and swap tablet", K(ret), K(key), K(disk_addr)); ob_usleep(1000 * 1000); ob_abort(); - } else if (OB_FAIL(old_tablet->set_memtable_clog_checkpoint_scn(param.tablet_meta_))) { - LOG_WARN("failed to set memtable clog checkpoint ts", K(ret), KPC(old_tablet), K(param)); } else { LOG_INFO("succeed to build ha tablet new table store", K(ret), K(key), K(disk_addr), K(param)); } diff --git a/src/storage/ob_storage_table_guard.cpp b/src/storage/ob_storage_table_guard.cpp index 3e553b8372..0c2a0de562 100644 --- a/src/storage/ob_storage_table_guard.cpp +++ b/src/storage/ob_storage_table_guard.cpp @@ -317,7 +317,7 @@ int ObStorageTableGuard::check_freeze_to_inc_write_ref(ObITable *table, bool &bo if (0 == write_ref) { SCN clog_checkpoint_scn; bool need_create_memtable = true; - const SCN migration_clog_checkpoint_scn = static_cast(memtable)->get_migration_clog_checkpoint_scn(); + SCN migration_clog_checkpoint_scn; ObIMemtableMgr *memtable_mgr = tablet_->get_memtable_mgr(); if (OB_ISNULL(memtable_mgr)) { @@ -325,6 +325,7 @@ int ObStorageTableGuard::check_freeze_to_inc_write_ref(ObITable *table, bool &bo LOG_WARN("memtable mgr is null", K(ret), K(bool_ret), K(ls_id), K(tablet_id), KP(memtable_mgr)); } else if (OB_FAIL(memtable_mgr->get_newest_clog_checkpoint_scn(clog_checkpoint_scn))) { LOG_WARN("failed to get newest clog_checkpoint_scn", K(ret), K(ls_id), K(tablet_id), K(clog_checkpoint_scn)); + } else if (FALSE_IT(migration_clog_checkpoint_scn = static_cast(memtable)->get_migration_clog_checkpoint_scn())) { } else if (for_replay_ && !migration_clog_checkpoint_scn.is_min()) { static_cast(memtable)->resolve_right_boundary(); if (replay_scn_ <= clog_checkpoint_scn) { @@ -426,4 +427,4 @@ bool ObStorageTableGuard::check_if_need_log() return need_log; } } // namespace storage -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase