Commit 68fe3a39 authored by sjaakola's avatar sjaakola Committed by Nirbhay Choubey

refs #7 - handling lock queue granting in BF-BF conflict situation

parent 51744b3f
...@@ -982,14 +982,15 @@ lock_rec_has_to_wait( ...@@ -982,14 +982,15 @@ lock_rec_has_to_wait(
} }
#ifdef WITH_WSREP #ifdef WITH_WSREP
/* if BF thread is locking and has conflict with another BF /* if BF thread has conflict with another BF
thread, we need to look at trx ordering and lock types */ thread, we need to look at trx ordering and lock types */
if (for_locking && if (wsrep_thd_is_BF(trx->mysql_thd, FALSE) &&
wsrep_thd_is_BF(trx->mysql_thd, FALSE) &&
wsrep_thd_is_BF(lock2->trx->mysql_thd, TRUE)) { wsrep_thd_is_BF(lock2->trx->mysql_thd, TRUE)) {
if (wsrep_debug) { if (wsrep_debug) {
fprintf(stderr, "\n BF-BF lock conflict \n"); fprintf(stderr,
"BF-BF lock conflict, locking: %d \n",
for_locking);
lock_rec_print(stderr, lock2); lock_rec_print(stderr, lock2);
} }
...@@ -998,10 +999,17 @@ lock_rec_has_to_wait( ...@@ -998,10 +999,17 @@ lock_rec_has_to_wait(
(type_mode & LOCK_MODE_MASK) == LOCK_X && (type_mode & LOCK_MODE_MASK) == LOCK_X &&
(lock2->type_mode & LOCK_MODE_MASK) == LOCK_X) (lock2->type_mode & LOCK_MODE_MASK) == LOCK_X)
{ {
/* exclusive lock conflicts are not accepted */ if (for_locking) {
fprintf(stderr, "BF-BF X lock conflict\n"); /* exclusive lock conflicts are not
lock_rec_print(stderr, lock2); accepted */
abort(); fprintf(stderr,
"BF-BF X lock conflict\n");
lock_rec_print(stderr, lock2);
abort();
} else if (wsrep_debug) {
fprintf(stderr,
"BF-BF X lock conflict\n");
}
} else { } else {
/* if lock2->index->n_uniq <= /* if lock2->index->n_uniq <=
lock2->index->n_user_defined_cols lock2->index->n_user_defined_cols
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment