From 01d017adfcae50519e1f9ae5f67b4e5385ae4b38 Mon Sep 17 00:00:00 2001 From: chinaxing Date: Mon, 3 Jul 2023 10:18:17 +0000 Subject: [PATCH] [master] repeated rollback savepoint on deleted ls will caused tx aborted --- src/storage/tx/ob_trans_define_v4.cpp | 4 ++-- src/storage/tx/ob_trans_define_v4.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/storage/tx/ob_trans_define_v4.cpp b/src/storage/tx/ob_trans_define_v4.cpp index 0ab0c1dca..8d8896c1e 100644 --- a/src/storage/tx/ob_trans_define_v4.cpp +++ b/src/storage/tx/ob_trans_define_v4.cpp @@ -561,7 +561,7 @@ int ObTxDesc::update_part_(ObTxPart &a, const bool append) if (p.id_ == a.id_) { hit = true; if (p.epoch_ == ObTxPart::EPOCH_DEAD) { - if (a.epoch_ != ObTxPart::EPOCH_DEAD) { + if (a.epoch_ > 0) { // unexpected: from dead to alive flags_.PART_EPOCH_MISMATCH_ = true; ret = OB_TRANS_NEED_ROLLBACK; TRANS_LOG(WARN, "epoch missmatch", K(ret), K(a), K(p)); @@ -635,7 +635,7 @@ int ObTxDesc::update_parts(const share::ObLSArray &list) auto &it = list[i]; ObTxPart n; n.id_ = it; - n.epoch_ = -1; + n.epoch_ = ObTxPart::EPOCH_UNKNOWN; n.first_scn_ = INT64_MAX; n.last_scn_ = INT64_MAX; if (OB_TMP_FAIL(update_part_(n))) { diff --git a/src/storage/tx/ob_trans_define_v4.h b/src/storage/tx/ob_trans_define_v4.h index 21b377e76..f7bb8e23c 100644 --- a/src/storage/tx/ob_trans_define_v4.h +++ b/src/storage/tx/ob_trans_define_v4.h @@ -178,6 +178,7 @@ struct ObTxParam struct ObTxPart { + static const int64_t EPOCH_UNKNOWN = -1; static const int64_t EPOCH_DEAD = -2; ObTxPart(); ~ObTxPart();