Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL)
-
64-bit
Description
The setting innodb_flush_neighbors is broken on 64-bit platforms ever since the code was refactored in MDEV-23399 to avoid recomputing page_id_t::fold() in buf_flush_check_neighbors(). The following fixes the problem that was repeatable when attempting to flush pages in the temporary tablespace around page number 0x200002:
diff --git a/storage/innobase/include/buf0types.h b/storage/innobase/include/buf0types.h
|
--- a/storage/innobase/include/buf0types.h
|
+++ b/storage/innobase/include/buf0types.h
|
@@ -162,7 +162,10 @@ class page_id_t
|
|
/** Retrieve the fold value.
|
@return fold value */
|
- ulint fold() const { return (space() << 20) + space() + page_no(); }
|
+ ulint fold() const
|
+ {
|
+ return sizeof(ulint) == 8 ? m_id : (space() << 20) + space() + page_no();
|
+ }
|
|
/** Reset the page number only.
|
@param[in] page_no page number */ |
The problem is that the return type of page_id_t::space() is uint32_t, and therefore on 64-bit systems the fold value would not be the nonzero value (((ulint)0xfffffffe)<<20)+0xfffffffe+0x200002 (as it could be assumed on a quick read of the code), but 0, because that is what (((uint32_t)0xfffffffe)<<20)+0xfffffffe+0x200002 evaluates to.
Furthermore, there is some indication that despite MDEV-17380, neighbour flushing was attempted on a NVMe device (major number: 259, minor number 0).
The performance of the above patch will have to be tested.
Attachments
Issue Links
- is caused by
-
MDEV-23399 10.5 performance regression with IO-bound tpcc
- Closed