Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17887

MyRocks-Gap-Lock: information about current lock waits

Details

    Description

      MyRocks has a deadlock detector that one can turn on/off.

      TokuDB's Fractal Tree also has one (and there is no way to turn it off currently).

      However, some MTR tests that rely on deadlock detection still fail.

      Attachments

        Issue Links

          Activity

            One of the reasons: information_schema.rocksdb_trx and information_schema.rocksdb_deadlock tables. These expose information about current transactions and last N deadlocks, respectively. The information is not present in range locking mode.

            The first thing that is not present (and causes rocksdb.i_s_deadlock to fail) is information_schema.rocksdb_trx.WAITING_KEY field.

            psergei Sergei Petrunia added a comment - One of the reasons: information_schema.rocksdb_trx and information_schema.rocksdb_deadlock tables. These expose information about current transactions and last N deadlocks, respectively. The information is not present in range locking mode. The first thing that is not present (and causes rocksdb.i_s_deadlock to fail) is information_schema.rocksdb_trx.WAITING_KEY field.

            Regular lock manager (TransactionLockMgr) "notifies" transactions about other transactions that are waiting for it (see stack trace below). This happens even when deadlock detection is OFF.

            (gdb) wher
              #0  rocksdb::PessimisticTransaction::SetWaitingTxn (this=0x7fffd800aa20, ids=..., column_family_id=0, key=0x7ffff42d04a0) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/rocksdb/utilities/transactions/pessimistic_transaction.h:80
              #1  0x0000555556f6e732 in rocksdb::TransactionLockMgr::AcquireWithTimeout (this=0x555558200670, txn=0x7fffd800aa20, lock_map=0x5555581d3f40, stripe=0x5555581d6d10, column_family_id=0, key="\000\000\001\004\200\000\000\001", env=0x555557e77360 <rocksdb::Env::Default()::default_env>, timeout=10000000000, lock_info=...) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/rocksdb/utilities/transactions/transaction_lock_mgr.cc:442
              #2  0x0000555556f6de94 in rocksdb::TransactionLockMgr::TryLock (this=0x555558200670, txn=0x7fffd800aa20, column_family_id=0, key="\000\000\001\004\200\000\000\001", env=0x555557e77360 <rocksdb::Env::Default()::default_env>, exclusive=true) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/rocksdb/utilities/transactions/transaction_lock_mgr.cc:315
              #3  0x0000555556f5c741 in rocksdb::PessimisticTransactionDB::TryLock (this=0x5555582005f0, txn=0x7fffd800aa20, cfh_id=0, key="\000\000\001\004\200\000\000\001", exclusive=true) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/rocksdb/utilities/transactions/pessimistic_transaction_db.cc:389
              #4  0x000055555706c253 in rocksdb::PessimisticTransaction::TryLock (this=0x7fffd800aa20, column_family=0x5555581d3280, key=..., read_only=true, exclusive=true, skip_validate=false) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/rocksdb/utilities/transactions/pessimistic_transaction.cc:529
              #5  0x0000555557075644 in rocksdb::TransactionBaseImpl::GetForUpdate (this=0x7fffd800aa20, read_options=..., column_family=0x5555581d3280, key=..., pinnable_val=0x7fffd800e838, exclusive=true) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/rocksdb/utilities/transactions/transaction_base.cc:238
              #6  0x0000555556b3edb4 in myrocks::Rdb_transaction_impl::get_for_update (this=0x7fffd800a810, column_family=0x5555581d3280, key=..., value=0x7fffd800e838, exclusive=true) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/storage/rocksdb/ha_rocksdb.cc:2942
              #7  0x0000555556b1b907 in myrocks::ha_rocksdb::get_for_update (this=0x7fffd800e300, tx=0x7fffd800a810, column_family=0x5555581d3280, key=..., value=0x7fffd800e838) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/storage/rocksdb/ha_rocksdb.cc:8659
              #8  0x0000555556b1bee7 in myrocks::ha_rocksdb::get_row_by_rowid (this=0x7fffd800e300, buf=0x7fffd800baf0 "\320\001", rowid=0x7fffd800ddc0 "", rowid_size=8, skip_lookup=false, skip_ttl_check=false) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/storage/rocksdb/ha_rocksdb.cc:8733
              #9  0x0000555556b384a7 in myrocks::ha_rocksdb::get_row_by_rowid (this=0x7fffd800e300, buf=0x7fffd800baf0 "\320\001", rowid=0x7fffd800ddc0 "", rowid_size=8, skip_lookup=false, skip_ttl_check=false) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/storage/rocksdb/./ha_rocksdb.h:685
              #10 0x0000555556b1a0eb in myrocks::ha_rocksdb::index_read_map_impl (this=0x7fffd800e300, buf=0x7fffd800baf0 "\320\001", key=0x7fffd80078a8 "\001", keypart_map=1, find_flag=HA_READ_KEY_EXACT, end_key=0x0) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/storage/rocksdb/ha_rocksdb.cc:8227
            

            psergei Sergei Petrunia added a comment - Regular lock manager (TransactionLockMgr) "notifies" transactions about other transactions that are waiting for it (see stack trace below). This happens even when deadlock detection is OFF. (gdb) wher #0 rocksdb::PessimisticTransaction::SetWaitingTxn (this=0x7fffd800aa20, ids=..., column_family_id=0, key=0x7ffff42d04a0) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/rocksdb/utilities/transactions/pessimistic_transaction.h:80 #1 0x0000555556f6e732 in rocksdb::TransactionLockMgr::AcquireWithTimeout (this=0x555558200670, txn=0x7fffd800aa20, lock_map=0x5555581d3f40, stripe=0x5555581d6d10, column_family_id=0, key="\000\000\001\004\200\000\000\001", env=0x555557e77360 <rocksdb::Env::Default()::default_env>, timeout=10000000000, lock_info=...) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/rocksdb/utilities/transactions/transaction_lock_mgr.cc:442 #2 0x0000555556f6de94 in rocksdb::TransactionLockMgr::TryLock (this=0x555558200670, txn=0x7fffd800aa20, column_family_id=0, key="\000\000\001\004\200\000\000\001", env=0x555557e77360 <rocksdb::Env::Default()::default_env>, exclusive=true) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/rocksdb/utilities/transactions/transaction_lock_mgr.cc:315 #3 0x0000555556f5c741 in rocksdb::PessimisticTransactionDB::TryLock (this=0x5555582005f0, txn=0x7fffd800aa20, cfh_id=0, key="\000\000\001\004\200\000\000\001", exclusive=true) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/rocksdb/utilities/transactions/pessimistic_transaction_db.cc:389 #4 0x000055555706c253 in rocksdb::PessimisticTransaction::TryLock (this=0x7fffd800aa20, column_family=0x5555581d3280, key=..., read_only=true, exclusive=true, skip_validate=false) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/rocksdb/utilities/transactions/pessimistic_transaction.cc:529 #5 0x0000555557075644 in rocksdb::TransactionBaseImpl::GetForUpdate (this=0x7fffd800aa20, read_options=..., column_family=0x5555581d3280, key=..., pinnable_val=0x7fffd800e838, exclusive=true) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/rocksdb/utilities/transactions/transaction_base.cc:238 #6 0x0000555556b3edb4 in myrocks::Rdb_transaction_impl::get_for_update (this=0x7fffd800a810, column_family=0x5555581d3280, key=..., value=0x7fffd800e838, exclusive=true) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/storage/rocksdb/ha_rocksdb.cc:2942 #7 0x0000555556b1b907 in myrocks::ha_rocksdb::get_for_update (this=0x7fffd800e300, tx=0x7fffd800a810, column_family=0x5555581d3280, key=..., value=0x7fffd800e838) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/storage/rocksdb/ha_rocksdb.cc:8659 #8 0x0000555556b1bee7 in myrocks::ha_rocksdb::get_row_by_rowid (this=0x7fffd800e300, buf=0x7fffd800baf0 "\320\001", rowid=0x7fffd800ddc0 "", rowid_size=8, skip_lookup=false, skip_ttl_check=false) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/storage/rocksdb/ha_rocksdb.cc:8733 #9 0x0000555556b384a7 in myrocks::ha_rocksdb::get_row_by_rowid (this=0x7fffd800e300, buf=0x7fffd800baf0 "\320\001", rowid=0x7fffd800ddc0 "", rowid_size=8, skip_lookup=false, skip_ttl_check=false) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/storage/rocksdb/./ha_rocksdb.h:685 #10 0x0000555556b1a0eb in myrocks::ha_rocksdb::index_read_map_impl (this=0x7fffd800e300, buf=0x7fffd800baf0 "\320\001", key=0x7fffd80078a8 "\001", keypart_map=1, find_flag=HA_READ_KEY_EXACT, end_key=0x0) at /home/psergey/dev-git/mysql-5.6-rangelocking2-rebase1/storage/rocksdb/ha_rocksdb.cc:8227

            OK, lock wait should call these methods in rocksdb::PessimisticTransaction

              void SetWaitingTxn(autovector<TransactionID> ids, uint32_t column_family_id,
                                 const std::string* key) ;  
            void ClearWaitingTxn() ;
            

            psergei Sergei Petrunia added a comment - OK, lock wait should call these methods in rocksdb::PessimisticTransaction void SetWaitingTxn(autovector<TransactionID> ids, uint32_t column_family_id, const std::string* key) ; void ClearWaitingTxn() ;

            People

              psergei Sergei Petrunia
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.