Commit 91417b40 authored by sjaakola's avatar sjaakola Committed by Nirbhay Choubey

refs #7 - merged fix from 5.5 branch. However, 5.6 branch has not (yet)...

refs #7 - merged fix from 5.5 branch. However, 5.6 branch has not (yet) surfaced similar applier hang as 5.5
parent 13a9bcc6
...@@ -1067,12 +1067,13 @@ lock_rec_has_to_wait( ...@@ -1067,12 +1067,13 @@ 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 is locking and 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: %lu\n",
for_locking);
lock_rec_print(stderr, lock2); lock_rec_print(stderr, lock2);
} }
...@@ -1081,16 +1082,21 @@ lock_rec_has_to_wait( ...@@ -1081,16 +1082,21 @@ 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 || wsrep_debug) {
fprintf(stderr, "BF-BF X lock conflict," /* exclusive lock conflicts are not
"type_mode: %lu supremum: %lu\n", accepted */
type_mode, lock_is_on_supremum); fprintf(stderr,
fprintf(stderr, "conflicts states: my %d locked %d\n", "BF-BF X lock conflict,"
wsrep_thd_conflict_state(trx->mysql_thd, FALSE), "mode: %lu supremum: %lu\n",
wsrep_thd_conflict_state(lock2->trx->mysql_thd, FALSE) ); type_mode, lock_is_on_supremum);
lock_rec_print(stderr, lock2); fprintf(stderr,
return FALSE; "conflicts states: my %d locked %d\n",
//abort(); 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 { } else {
/* if lock2->index->n_uniq <= /* if lock2->index->n_uniq <=
lock2->index->n_user_defined_cols lock2->index->n_user_defined_cols
...@@ -1110,7 +1116,7 @@ lock_rec_has_to_wait( ...@@ -1110,7 +1116,7 @@ lock_rec_has_to_wait(
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
return(TRUE); return(TRUE);
} }
return(FALSE); return(FALSE);
} }
......
...@@ -1068,12 +1068,13 @@ lock_rec_has_to_wait( ...@@ -1068,12 +1068,13 @@ 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 is locking and 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: %lu\n",
for_locking);
lock_rec_print(stderr, lock2); lock_rec_print(stderr, lock2);
} }
...@@ -1082,16 +1083,21 @@ lock_rec_has_to_wait( ...@@ -1082,16 +1083,21 @@ 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 || wsrep_debug) {
fprintf(stderr, "BF-BF X lock conflict," /* exclusive lock conflicts are not
"type_mode: %lu supremum: %lu\n", accepted */
type_mode, lock_is_on_supremum); fprintf(stderr,
fprintf(stderr, "conflicts states: my %d locked %d\n", "BF-BF X lock conflict,"
wsrep_thd_conflict_state(trx->mysql_thd, FALSE), "mode: %lu supremum: %lu\n",
wsrep_thd_conflict_state(lock2->trx->mysql_thd, FALSE) ); type_mode, lock_is_on_supremum);
lock_rec_print(stderr, lock2); fprintf(stderr,
return FALSE; "conflicts states: my %d locked %d\n",
//abort(); 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 { } 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