[CP] Fixed the inconsistency issue with PDML update index

This commit is contained in:
leslieyuchen
2024-01-08 10:42:53 +00:00
committed by ob-robot
parent 52615b8a85
commit 49394811fb
2 changed files with 17 additions and 1 deletions

View File

@ -1026,6 +1026,13 @@ int ObDMLService::lock_row(const ObDASLockCtDef &dlock_ctdef,
stored_row);
}
/*
* Note: During the update process,
* ObDMLService::check_row_whether_changed() and ObDMLService::update_row() must be executed together
* within a single iteration,
* because the update_row process relies on check_row_whether_changed to determine
* whether the new and old values of the row being updated have changed.
**/
int ObDMLService::update_row(const ObUpdCtDef &upd_ctdef,
ObUpdRtDef &upd_rtdef,
const ObDASTabletLoc *old_tablet_loc,

View File

@ -100,7 +100,16 @@ int ObPxMultiPartUpdateOp::update_row_to_das(const ObDASTabletLoc *tablet_loc)
{
int ret = OB_SUCCESS;
ObChunkDatumStore::StoredRow* stored_row = nullptr;
if (OB_FAIL(ObDMLService::update_row(MY_SPEC.upd_ctdef_, upd_rtdef_, tablet_loc, tablet_loc, dml_rtctx_, stored_row, stored_row, stored_row))) {
if (OB_FAIL(ObDMLService::check_row_whether_changed(MY_SPEC.upd_ctdef_, upd_rtdef_, eval_ctx_))) {
LOG_WARN("check row whether changed failed", K(ret));
} else if (OB_FAIL(ObDMLService::update_row(MY_SPEC.upd_ctdef_,
upd_rtdef_,
tablet_loc,
tablet_loc,
dml_rtctx_,
stored_row,
stored_row,
stored_row))) {
LOG_WARN("insert row with das failed", K(ret));
}
return ret;