[BUG] only check sequence set with the first one
This commit is contained in:
@ -117,11 +117,14 @@ struct ObMvccWriteResult {
|
||||
// tx_node_ is the node used for insert, whether it is inserted is decided by
|
||||
// has_insert()
|
||||
ObMvccTransNode *tx_node_;
|
||||
// is_checked_ is used to tell lock_rows_on_forzen_stores whether sequence_set_violation has finished its check
|
||||
bool is_checked_;
|
||||
|
||||
TO_STRING_KV(K_(can_insert),
|
||||
K_(need_insert),
|
||||
K_(is_new_locked),
|
||||
K_(lock_state),
|
||||
K_(is_checked),
|
||||
KPC_(tx_node));
|
||||
|
||||
ObMvccWriteResult()
|
||||
@ -129,7 +132,8 @@ struct ObMvccWriteResult {
|
||||
need_insert_(false),
|
||||
is_new_locked_(false),
|
||||
lock_state_(),
|
||||
tx_node_(NULL) {}
|
||||
tx_node_(NULL),
|
||||
is_checked_(false) {}
|
||||
|
||||
// has_insert indicates whether the insert is succeed
|
||||
// It is decided by both can_insert_ and need_insert_
|
||||
@ -142,6 +146,7 @@ struct ObMvccWriteResult {
|
||||
is_new_locked_ = false;
|
||||
lock_state_.reset();
|
||||
tx_node_ = NULL;
|
||||
is_checked_ = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -914,6 +914,7 @@ int ObMvccRow::mvcc_write_(ObIMemtableCtx &ctx,
|
||||
list_head_->get_dml_flag(),
|
||||
list_head_->get_seq_no()))) {
|
||||
TRANS_LOG(WARN, "check sequence set violation failed", K(ret), KPC(this));
|
||||
} else if (nullptr != list_head_ && FALSE_IT(res.is_checked_ = true)) {
|
||||
} else if (OB_SUCC(check_double_insert_(snapshot_version,
|
||||
writer_node,
|
||||
list_head_))) {
|
||||
|
||||
@ -1205,6 +1205,7 @@ int ObMemtable::lock_row_on_frozen_stores_(
|
||||
// We need check whether the same row is operated by same txn
|
||||
// concurrently to prevent undesirable resuly.
|
||||
if (res.has_insert() && // we only need check when the node is exactly inserted
|
||||
!res.is_checked_ && // we only need check when the active memtable check is missed
|
||||
OB_FAIL(concurrent_control::check_sequence_set_violation(ctx.mvcc_acc_ctx_.write_flag_,
|
||||
reader_seq_no,
|
||||
my_tx_id,
|
||||
|
||||
Reference in New Issue
Block a user