Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Rdb_transaction_impl::get_trx safe to call from other threads #1512

Open
wants to merge 1 commit into
base: fb-mysql-8.0.32
Choose a base branch
from

Conversation

laurynas-biveinis
Copy link
Contributor

  • Introduce Rdb_transaction_impl::m_rdb_tx_mutex to protect writes to
    m_rocksdb_tx[USER_TABLE] from the query thread and reads from other threads.
  • To protect query thread writes, add critical sections to begin_rdb_tx and
    release_tx methods.
  • Make get_rdb_trx lock this mutex before returning the RocksDB transaction
    pointer and introduce unlock_rdb_trx method to unlock this mutex.
  • Call the above methods in Rdb_trx_info_aggregator::process_tran. Move
    unrelated code out of this critical section.

- Introduce Rdb_transaction_impl::m_rdb_tx_mutex to protect writes to
  m_rocksdb_tx[USER_TABLE] from the query thread and reads from other threads.
- To protect query thread writes, add critical sections to begin_rdb_tx and
  release_tx methods.
- Make get_rdb_trx lock this mutex before returning the RocksDB transaction
  pointer and introduce unlock_rdb_trx method to unlock this mutex.
- Call the above methods in Rdb_trx_info_aggregator::process_tran. Move
  unrelated code out of this critical section.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants