Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我最近正在阅读 InnoDB 代码,需要在上面写一些代码。我知道在 S2PL 中,冲突的事务完成后将恢复被阻止的事务。但是,我不确定 InnoDB 如何在块后恢复事务,是否有处理此类工作的线程?非常感谢。
当需要锁但无法授予时,锁会进入页面级别的锁队列。当任何锁被释放时,释放事务会搜索队列并从队列中授予下一个新的非冲突锁。请参阅MySQL 源代码中的lock_rec_enqueue_waiting、lock_rec_dequeue_from_page、lock_grant等。storage/innobase/lock/lock0lock.c
lock_rec_enqueue_waiting
lock_rec_dequeue_from_page
lock_grant
storage/innobase/lock/lock0lock.c