Skip to content

Commit

Permalink
refs #7 - merged fix from 5.5 branch. However, 5.6 branch has not (ye…
Browse files Browse the repository at this point in the history
…t) surfaced similar applier hang as 5.5
  • Loading branch information
sjaakola authored and Nirbhay Choubey committed May 8, 2015
1 parent 13a9bcc commit 91417b4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 27 deletions.
34 changes: 20 additions & 14 deletions storage/innobase/lock/lock0lock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1067,12 +1067,13 @@ lock_rec_has_to_wait(
#ifdef WITH_WSREP
/* if BF thread is locking and has conflict with another BF
thread, we need to look at trx ordering and lock types */
if (for_locking &&
wsrep_thd_is_BF(trx->mysql_thd, FALSE) &&
if (wsrep_thd_is_BF(trx->mysql_thd, FALSE) &&
wsrep_thd_is_BF(lock2->trx->mysql_thd, TRUE)) {

if (wsrep_debug) {
fprintf(stderr, "\n BF-BF lock conflict \n");
fprintf(stderr,
"BF-BF lock conflict, locking: %lu\n",
for_locking);
lock_rec_print(stderr, lock2);
}

Expand All @@ -1081,16 +1082,21 @@ lock_rec_has_to_wait(
(type_mode & LOCK_MODE_MASK) == LOCK_X &&
(lock2->type_mode & LOCK_MODE_MASK) == LOCK_X)
{
/* exclusive lock conflicts are not accepted */
fprintf(stderr, "BF-BF X lock conflict,"
"type_mode: %lu supremum: %lu\n",
type_mode, lock_is_on_supremum);
fprintf(stderr, "conflicts states: my %d locked %d\n",
wsrep_thd_conflict_state(trx->mysql_thd, FALSE),
wsrep_thd_conflict_state(lock2->trx->mysql_thd, FALSE) );
lock_rec_print(stderr, lock2);
return FALSE;
//abort();
if (for_locking || wsrep_debug) {
/* exclusive lock conflicts are not
accepted */
fprintf(stderr,
"BF-BF X lock conflict,"
"mode: %lu supremum: %lu\n",
type_mode, lock_is_on_supremum);
fprintf(stderr,
"conflicts states: my %d locked %d\n",
wsrep_thd_conflict_state(trx->mysql_thd, FALSE),
wsrep_thd_conflict_state(lock2->trx->mysql_thd, FALSE) );
lock_rec_print(stderr, lock2);
if (for_locking) return FALSE;
//abort();
}
} else {
/* if lock2->index->n_uniq <=
lock2->index->n_user_defined_cols
Expand All @@ -1110,7 +1116,7 @@ lock_rec_has_to_wait(
#endif /* WITH_WSREP */
return(TRUE);
}

return(FALSE);
}

Expand Down
32 changes: 19 additions & 13 deletions storage/xtradb/lock/lock0lock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1068,12 +1068,13 @@ lock_rec_has_to_wait(
#ifdef WITH_WSREP
/* if BF thread is locking and has conflict with another BF
thread, we need to look at trx ordering and lock types */
if (for_locking &&
wsrep_thd_is_BF(trx->mysql_thd, FALSE) &&
if (wsrep_thd_is_BF(trx->mysql_thd, FALSE) &&
wsrep_thd_is_BF(lock2->trx->mysql_thd, TRUE)) {

if (wsrep_debug) {
fprintf(stderr, "\n BF-BF lock conflict \n");
fprintf(stderr,
"BF-BF lock conflict, locking: %lu\n",
for_locking);
lock_rec_print(stderr, lock2);
}

Expand All @@ -1082,16 +1083,21 @@ lock_rec_has_to_wait(
(type_mode & LOCK_MODE_MASK) == LOCK_X &&
(lock2->type_mode & LOCK_MODE_MASK) == LOCK_X)
{
/* exclusive lock conflicts are not accepted */
fprintf(stderr, "BF-BF X lock conflict,"
"type_mode: %lu supremum: %lu\n",
type_mode, lock_is_on_supremum);
fprintf(stderr, "conflicts states: my %d locked %d\n",
wsrep_thd_conflict_state(trx->mysql_thd, FALSE),
wsrep_thd_conflict_state(lock2->trx->mysql_thd, FALSE) );
lock_rec_print(stderr, lock2);
return FALSE;
//abort();
if (for_locking || wsrep_debug) {
/* exclusive lock conflicts are not
accepted */
fprintf(stderr,
"BF-BF X lock conflict,"
"mode: %lu supremum: %lu\n",
type_mode, lock_is_on_supremum);
fprintf(stderr,
"conflicts states: my %d locked %d\n",
wsrep_thd_conflict_state(trx->mysql_thd, FALSE),
wsrep_thd_conflict_state(lock2->trx->mysql_thd, FALSE) );
lock_rec_print(stderr, lock2);
if (for_locking) return FALSE;
//abort();
}
} else {
/* if lock2->index->n_uniq <=
lock2->index->n_user_defined_cols
Expand Down

0 comments on commit 91417b4

Please sign in to comment.