summaryrefslogtreecommitdiff
path: root/storage/innobase/include/page0page.ic
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-01-17 10:37:25 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-01-17 14:27:28 +0200
commit3e38d15585f03e794a83a1d141ead33e8c878f27 (patch)
tree1e0adc3042f944cb299ed52d8488982fac1497da /storage/innobase/include/page0page.ic
parent9cae7bdcc0055776064b3ba08830b1577b18f5c8 (diff)
downloadmariadb-git-3e38d15585f03e794a83a1d141ead33e8c878f27.tar.gz
MDEV-21509 Possible hang during purge of history, or rollback
WL#6326 in MariaDB 10.2.2 introduced a potential hang on purge or rollback when an index tree is being shrunk by multiple levels. This fix is based on mysql/mysql-server@f2c58526300c0d84837effa26d37cbd5d2694967 with the main difference that our version of the test case uses DEBUG_SYNC instrumentation on ROLLBACK, not on purge. btr_cur_will_modify_tree(): Simplify the check further. This is the actual bug fix. row_undo_mod_remove_clust_low(), row_undo_mod_clust(): Add DEBUG_SYNC instrumentation for the test case.
Diffstat (limited to 'storage/innobase/include/page0page.ic')
-rw-r--r--storage/innobase/include/page0page.ic24
1 files changed, 22 insertions, 2 deletions
diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic
index 98b518187b5..75bfa56e2a6 100644
--- a/storage/innobase/include/page0page.ic
+++ b/storage/innobase/include/page0page.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2019, MariaDB Corporation.
+Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -359,6 +359,26 @@ page_rec_is_last(
}
/************************************************************//**
+true if distance between the records (measured in number of times we have to
+move to the next record) is at most the specified value */
+UNIV_INLINE
+bool
+page_rec_distance_is_at_most(
+/*=========================*/
+ const rec_t* left_rec,
+ const rec_t* right_rec,
+ ulint val)
+{
+ for (ulint i = 0; i <= val; i++) {
+ if (left_rec == right_rec) {
+ return (true);
+ }
+ left_rec = page_rec_get_next_const(left_rec);
+ }
+ return (false);
+}
+
+/************************************************************//**
true if the record is the second last user record on a page.
@return true if the second last user record */
UNIV_INLINE