-
Committer:
Stewart Smith
-
Author(s):
Sunny Bains, Stewart Smith
-
Date:
2010-11-17 05:08:52 UTC
-
mto:
(2021.1.2 build)
-
mto:
This revision was merged to the branch mainline in
revision
1971.
-
Revision ID:
stewart@flamingspork.com-20101117050852-909hubhlcqt477hx
Merge Revision revid:sunny.bains@oracle.com-20100625081841-ppulnkjk1qlazh82 from MySQL InnoDB
Original revid:sunny.bains@oracle.com-20100625081841-ppulnkjk1qlazh82
Original Authors: Sunny Bains <Sunny.Bains@Oracle.Com>
Original commit message:
Fix bug#54583. This change reverses rsvn:1350 by getting rid of a bogus assertion
and clarifies the invariant in dict_table_get_on_id().
In Mar 2007 Marko observed a crash during recovery, the crash resulted from
an UNDO operation on a system table. His solution was to acquire an X lock on
the data dictionary, this in hindsight was an overkill. It is unclear what
caused the crash, current hypothesis is that it was a memory corruption.
The X lock results in performance issues by when undoing changes due to
rollback during normal operation on regular tables.
Why the change is safe:
======================
The InnoDB code has changed since the original X lock change was made. In the
new code we always lock the data dictionary in X mode during startup when
UNDOing operations on the system tables (this is a given). This ensures that
the crash Marko observed cannot happen as long as all transactions that update
the system tables follow the standard rules by setting the appropriate DICT_OP
flag when writing the log records when they make the changes.
If transactions violate the above mentioned rule then during recovery (at
startup) the rollback code (see trx0roll.c) will not acquire the X lock
and we will see the crash again. This will however be a different bug.