[Commits] 59834d6: refs #7 - handling lock queue granting in BF-BF conflict situation

Nirbhay Choubey nirbhay at mariadb.com
Tue Mar 31 00:39:20 EEST 2015


revision-id: 59834d6f8769784bd23ebb53435182a9367a8cfa
parent(s): 74fd6345bcc7daed7a7fa9cb62b5b4fda4aac849
committer: Nirbhay Choubey
branch nick: server
timestamp: 2015-03-30 17:39:20 -0400
message:

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

---
 storage/innobase/lock/lock0lock.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
index 98cb239..b245e85 100644
--- a/storage/innobase/lock/lock0lock.c
+++ b/storage/innobase/lock/lock0lock.c
@@ -982,14 +982,15 @@ enum lock_mode
 		}
 
 #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 */
-		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: %d \n",
+					for_locking);
 				lock_rec_print(stderr, lock2);
 			}
 
@@ -998,10 +999,17 @@ enum lock_mode
 			    (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\n");
-				lock_rec_print(stderr, lock2);
-				abort();
+				if (for_locking) {
+					/* exclusive lock conflicts are not 
+					   accepted */
+					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 {
 				/* if lock2->index->n_uniq <= 
 				   lock2->index->n_user_defined_cols


More information about the commits mailing list