Skip to content

Commit

Permalink
Don't need to report waits for temporary conflicts.
Browse files Browse the repository at this point in the history
If the extra retry before wait succeeds, the wait callback need not be
invoked.
  • Loading branch information
knielsen committed Aug 30, 2016
1 parent 3ee25da commit 6888239
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion sql/rpl_parallel.cc
Expand Up @@ -674,7 +674,6 @@ retry_event_group(rpl_group_info *rgi, rpl_parallel_thread *rpt,
Format_description_log_event *description_event= NULL;

do_retry:

event_count= 0;
err= 0;
errmsg= NULL;
Expand Down
6 changes: 3 additions & 3 deletions storage/tokudb/PerconaFT/locktree/lock_request.cc
Expand Up @@ -151,7 +151,6 @@ bool lock_request::deadlock_exists(const txnid_set &conflicts) {
bool deadlock = wait_graph.cycle_exists_from_txnid(m_txnid);

wait_graph.destroy();

return deadlock;
}

Expand Down Expand Up @@ -240,10 +239,11 @@ int lock_request::wait(uint64_t wait_time_ms, uint64_t killed_time_ms,
GrowableArray<TXNID> conflicts_collector;
conflicts_collector.init();
retry(&conflicts_collector);
if (m_state != state::PENDING) {
if (m_state == state::PENDING) {
report_waits(&conflicts_collector, lock_wait_callback);
} else {
fprintf(stderr, "%s %u %s retry %p %" PRIu64 " worked\n", __FILE__, __LINE__, "lock_request::wait", this, m_txnid);
}
report_waits(&conflicts_collector, lock_wait_callback);
conflicts_collector.deinit();
}

Expand Down
1 change: 0 additions & 1 deletion storage/tokudb/PerconaFT/src/ydb_row_lock.cc
Expand Up @@ -226,7 +226,6 @@ int toku_db_wait_range_lock(DB *db, DB_TXN *txn, toku::lock_request *request) {
if (r == 0) {
db_txn_note_row_lock(db, txn_anc, left_key, right_key);
} else if (r == DB_LOCK_NOTGRANTED) {
// ToDo: handle lock_wait_needed callback here?
lock_timeout_callback callback = txn->mgrp->i->lock_wait_timeout_callback;
if (callback != nullptr) {
callback(db, txn_anc->id64(txn_anc), left_key, right_key,
Expand Down

0 comments on commit 6888239

Please sign in to comment.