push the memtable whose end_max_scn is 0 from max_end_scn to start_scn + 1 for replay multi-transaction commit log

This commit is contained in:
obdev
2023-05-11 13:58:38 +00:00
committed by ob-robot
parent c25187b07c
commit cf5be5d6f4
2 changed files with 13 additions and 8 deletions

View File

@ -642,11 +642,15 @@ int ObMemtable::save_multi_source_data_unit(const T *const multi_source_data_uni
&& OB_FAIL(set_max_end_scn(scn))) {
TRANS_LOG(WARN, "failed to set max_end_scn", K(ret), K(scn), KPC(this));
}
// commit log is replayed to empty memtable whitch is frozen after clog switch to follower gracefully, commit status mds will be lost.
// so push max_end_scn to start_scn + 1
else if (start_scn == get_end_scn()
&& OB_FAIL(set_end_scn(share::SCN::scn_inc(start_scn)))) {
TRANS_LOG(WARN, "failed to set max_end_scn", K(ret), K(scn), KPC(this));
// commit log is replayed to empty memtable which is frozen after clog switch to follower gracefully, commit status mds will be lost.
// so push end_scn to start_scn + 1
else if (get_max_end_scn().is_min() && get_end_scn().is_max()) {
TRANS_LOG(INFO, "empty memtable push end_scn to start_scn + 1", K(ret), K(scn), KPC(this));
if (OB_FAIL(set_end_scn(share::SCN::scn_inc(start_scn)))) {
TRANS_LOG(WARN, "failed to set max_end_scn", K(ret), K(scn), KPC(this));
}
}
if (OB_FAIL(ret)) {
} else if (OB_FAIL(set_rec_scn(scn))) {
TRANS_LOG(WARN, "failed to set rec_scn", K(ret), K(scn), KPC(this));
}