Commit 9ed0c744 authored by Marko Mäkelä's avatar Marko Mäkelä

lock_rec_queue_validate(): Disable a bogus check that

a transaction that holds a lock on a clustered index record
also holds a lock on the secondary index record.
parent 0c0a3b9a
...@@ -4538,13 +4538,34 @@ lock_rec_queue_validate( ...@@ -4538,13 +4538,34 @@ lock_rec_queue_validate(
rec, impl_trx)); rec, impl_trx));
} }
} }
#if 0
if (index && !(index->type & DICT_CLUSTERED)) { if (index && !(index->type & DICT_CLUSTERED)) {
/* The kernel mutex may get released temporarily in the /* The kernel mutex may get released temporarily in the
next function call: we have to release lock table mutex next function call: we have to release lock table mutex
to obey the latching order */ to obey the latching order */
/* NOTE: This is a bogus check that would fail in the
following case: Our transaction is updating a
row. After it has updated the clustered index record,
it goes to a secondary index record and finds someone
else holding an explicit S- or X-lock on that
secondary index record, presumably from a locking
read. Our transaction cannot update the secondary
index immediately, but places a waiting X-lock request
on the secondary index record. There is nothing
illegal in this. The assertion is simply too strong. */
/* From the locking point of view, each secondary
index is a separate table. A lock that is held on
secondary index rec does not give any rights to modify
or read the clustered index rec. Therefore, we can
think of the sec index as a separate 'table' from the
clust index 'table'. Conversely, a transaction that
has acquired a lock on and modified a clustered index
record may need to wait for a lock on the
corresponding record in a secondary index. */
impl_trx = lock_sec_rec_some_has_impl_off_kernel( impl_trx = lock_sec_rec_some_has_impl_off_kernel(
rec, index, offsets); rec, index, offsets);
...@@ -4555,7 +4576,7 @@ lock_rec_queue_validate( ...@@ -4555,7 +4576,7 @@ lock_rec_queue_validate(
rec, impl_trx)); rec, impl_trx));
} }
} }
#endif
lock = lock_rec_get_first(rec); lock = lock_rec_get_first(rec);
while (lock) { while (lock) {
......
...@@ -4710,6 +4710,7 @@ lock_rec_queue_validate( ...@@ -4710,6 +4710,7 @@ lock_rec_queue_validate(
ut_a(lock_rec_has_expl(LOCK_X | LOCK_REC_NOT_GAP, ut_a(lock_rec_has_expl(LOCK_X | LOCK_REC_NOT_GAP,
block, heap_no, impl_trx)); block, heap_no, impl_trx));
} }
#if 0
} else { } else {
/* The kernel mutex may get released temporarily in the /* The kernel mutex may get released temporarily in the
...@@ -4720,6 +4721,27 @@ lock_rec_queue_validate( ...@@ -4720,6 +4721,27 @@ lock_rec_queue_validate(
(fil_space_t::latch), the following check WILL break (fil_space_t::latch), the following check WILL break
latching order and may cause a deadlock of threads. */ latching order and may cause a deadlock of threads. */
/* NOTE: This is a bogus check that would fail in the
following case: Our transaction is updating a
row. After it has updated the clustered index record,
it goes to a secondary index record and finds someone
else holding an explicit S- or X-lock on that
secondary index record, presumably from a locking
read. Our transaction cannot update the secondary
index immediately, but places a waiting X-lock request
on the secondary index record. There is nothing
illegal in this. The assertion is simply too strong. */
/* From the locking point of view, each secondary
index is a separate table. A lock that is held on
secondary index rec does not give any rights to modify
or read the clustered index rec. Therefore, we can
think of the sec index as a separate 'table' from the
clust index 'table'. Conversely, a transaction that
has acquired a lock on and modified a clustered index
record may need to wait for a lock on the
corresponding record in a secondary index. */
impl_trx = lock_sec_rec_some_has_impl_off_kernel( impl_trx = lock_sec_rec_some_has_impl_off_kernel(
rec, index, offsets); rec, index, offsets);
...@@ -4730,6 +4752,7 @@ lock_rec_queue_validate( ...@@ -4730,6 +4752,7 @@ lock_rec_queue_validate(
ut_a(lock_rec_has_expl(LOCK_X | LOCK_REC_NOT_GAP, ut_a(lock_rec_has_expl(LOCK_X | LOCK_REC_NOT_GAP,
block, heap_no, impl_trx)); block, heap_no, impl_trx));
} }
#endif
} }
lock = lock_rec_get_first(block, heap_no); lock = lock_rec_get_first(block, heap_no);
......
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