Commit f7cac5e2 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-12288/MDEV-15132/MDEV-15158: Adjust a comment

parent ff0000cd
...@@ -77,16 +77,19 @@ can still remove old versions from the bottom of the stack. */ ...@@ -77,16 +77,19 @@ can still remove old versions from the bottom of the stack. */
------------------------------------------------------------------- -------------------------------------------------------------------
latches? latches?
------- -------
The contention of the trx_sys_t::mutex should be minimized. When a transaction The contention of the trx_sys.mutex should be minimized. When a transaction
does its first insert or modify in an index, an undo log is assigned for it. does its first insert or modify in an index, an undo log is assigned for it.
Then we must have an x-latch to the rollback segment header. Then we must have an x-latch to the rollback segment header.
When the transaction does more modifys or rolls back, the undo log is When the transaction performs modifications or rolls back, its
protected with undo_mutex in the transaction. undo log is protected by undo page latches and trx_t::undo_mutex.
When the transaction commits, its insert undo log is either reset and Only the thread that is associated with the transaction may hold multiple
cached for a fast reuse, or freed. In these cases we must have an x-latch on undo page latches at a time. Undo pages are always private to a single
the rollback segment page. The update undo log is put to the history list. If transaction. Other threads that are performing MVCC reads
it is not suitable for reuse, its slot in the rollback segment is reset. In or checking for implicit locks will lock at most one undo page at a time
both cases, an x-latch must be acquired on the rollback segment. in trx_undo_get_undo_rec_low(), without holding any undo_mutex.
When the transaction commits, its persistent undo log is added
to the history list. If it is not suitable for reuse, its slot is reset.
In both cases, an x-latch must be acquired on the rollback segment header page.
The purge operation steps through the history list without modifying The purge operation steps through the history list without modifying
it until a truncate operation occurs, which can remove undo logs from the end it until a truncate operation occurs, which can remove undo logs from the end
of the list and release undo log segments. In stepping through the list, of the list and release undo log segments. In stepping through the list,
......
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