summaryrefslogtreecommitdiff
path: root/storage/innobase/sync
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2017-10-12 12:56:20 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2017-10-12 12:56:20 +0300
commita4fa940bad7f3a2c4afff776977ad5e46dfe95d3 (patch)
tree0af6070602bdcc2df6241b7584541096bcc14dc9 /storage/innobase/sync
parent4c9d19ee657b882fcb5a2daea702357a1a73b55f (diff)
downloadmariadb-git-a4fa940bad7f3a2c4afff776977ad5e46dfe95d3.tar.gz
MDEV-11336: Enable defragmentation on 10.2 when tests pass
Problem was that we could take page latches on different order than wat is entitled with SX-lock. To follow the latching order defined in WL#6326, acquire index->lock X-latch. This entitles us to acquire page latches in any order for the index. btr0btr.cc Document latch rules before and after MariaDB 10.2.2 sync0rw.cc Document latch compatibility rules better. btr_defragment_merge_pages Fix parameter value. btr_defragment_thread Acquire X-lock to dict_index_t::lock before restoring cursor position and continuing defragmentation. ha_innobase::optimize Restore defragment feature. Testing Add GIS-index and FT-index to table being defragmented. Defragmentation is not done to GIS-indexes and FT auxiliary tables.
Diffstat (limited to 'storage/innobase/sync')
-rw-r--r--storage/innobase/sync/sync0rw.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/storage/innobase/sync/sync0rw.cc b/storage/innobase/sync/sync0rw.cc
index 6322b14335f..37b64910713 100644
--- a/storage/innobase/sync/sync0rw.cc
+++ b/storage/innobase/sync/sync0rw.cc
@@ -84,10 +84,15 @@ lock_word < -(X_LOCK_DECR + X_LOCK_HALF_DECR):
2 - (lock_word + X_LOCK_DECR + X_LOCK_HALF_DECR)
LOCK COMPATIBILITY MATRIX
- S SX X
- S + + -
- SX + - -
- X - - -
+
+ | S|SX| X|
+ --+--+--+--+
+ S| +| +| -|
+ --+--+--+--+
+ SX| +| -| -|
+ --+--+--+--+
+ X| -| -| -|
+ --+--+--+--+
The lock_word is always read and updated atomically and consistently, so that
it always represents the state of the lock, and the state of the lock changes