BUGFIX: ddl only wait trans with a smaller schema version

This commit is contained in:
obdev
2023-05-25 04:47:07 +00:00
committed by ob-robot
parent 868693e33f
commit 295edddc6d
2 changed files with 4 additions and 2 deletions

View File

@ -344,7 +344,7 @@ int ObLockMemCtx::check_modify_schema_elapsed(
RDLockGuard guard(list_rwlock_);
DLIST_FOREACH(curr, lock_list_) {
if (curr->lock_op_.lock_id_ == lock_id &&
curr->lock_op_.create_schema_version_ <= schema_version) {
curr->lock_op_.create_schema_version_ < schema_version) {
// there is some trans that modify the tablet before schema version
// running.
ret = OB_EAGAIN;
@ -370,7 +370,7 @@ int ObLockMemCtx::check_modify_time_elapsed(
RDLockGuard guard(list_rwlock_);
DLIST_FOREACH(curr, lock_list_) {
if (curr->lock_op_.lock_id_ == lock_id &&
curr->lock_op_.create_timestamp_ <= timestamp) {
curr->lock_op_.create_timestamp_ < timestamp) {
// there is some trans that modify the tablet before timestamp
// running.
ret = OB_EAGAIN;

View File

@ -89,9 +89,11 @@ public:
const ObTableLockOpType op_type,
bool &is_exist,
ObTableLockMode &lock_mode_in_same_trans) const;
// wait all the trans that modify with a smaller schema_version finished.
int check_modify_schema_elapsed(
const ObLockID &lock_id,
const int64_t schema_version);
// wait all the trans that modify with a smaller timestamp finished.
int check_modify_time_elapsed(
const ObLockID &lock_id,
const int64_t timestamp);