BUGFIX: fix tx data recycle

This commit is contained in:
obdev
2023-09-05 04:10:41 +00:00
committed by ob-robot
parent a91a0535f3
commit bed8398a6b
2 changed files with 3 additions and 1 deletions

View File

@ -641,7 +641,7 @@ TEST_F(TestLSTabletService, test_get_ls_min_end_scn)
share::SCN test_scn = share::SCN::min_scn(); share::SCN test_scn = share::SCN::min_scn();
share::SCN expect_scn; share::SCN expect_scn;
share::SCN orig_scn; share::SCN orig_scn;
expect_scn.val_ = 1; expect_scn.val_ = 0;
share::SCN min_end_scn_from_latest_tablets = SCN::max_scn(); share::SCN min_end_scn_from_latest_tablets = SCN::max_scn();
share::SCN min_end_scn_from_old_tablets = SCN::max_scn(); share::SCN min_end_scn_from_old_tablets = SCN::max_scn();

View File

@ -885,6 +885,8 @@ int ObTenantMetaMemMgr::get_min_end_scn_from_single_tablet(ObTablet *tablet,
} else { } else {
// step 3 : if minor sstable do not exist, us max{tablet_clog_checkpoint, ls_clog_checkpoint} as end_scn // step 3 : if minor sstable do not exist, us max{tablet_clog_checkpoint, ls_clog_checkpoint} as end_scn
end_scn = SCN::max(tablet->get_tablet_meta().clog_checkpoint_scn_, ls_checkpoint); end_scn = SCN::max(tablet->get_tablet_meta().clog_checkpoint_scn_, ls_checkpoint);
// the clog with scn of checkpoint scn may depend on the tx data with a commit scn of checkpoint scn
end_scn = SCN::max(SCN::scn_dec(end_scn), SCN::min_scn());
} }
if (end_scn < min_end_scn) { if (end_scn < min_end_scn) {