diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-04-21 14:09:23 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-04-21 14:09:23 +0300 |
commit | fdec842fd7f82b6ed9aec54f82ac50b5eea925b3 (patch) | |
tree | 71bc5b6b1480955c1c21a1eb004aeafb2cb3b09a | |
parent | 580cbd18b38b1104da49b6eb4f1c10954d6ae183 (diff) | |
download | mariadb-git-fdec842fd7f82b6ed9aec54f82ac50b5eea925b3.tar.gz |
MDEV-28371 Assertion fold == id.fold() failed in buf_flush_check_neighbor()
Due to 32-bit arithmetics, SRV_TMP_SPACE_ID page number 0x200002 would be
folded to 0, which is incompatible with the assumption that was made in
commit 7cffb5f6e8a231a041152447be8980ce35d2c9b8 (MDEV-23399).
page_id_t::fold(): Compute in the native word width instead of uint32_t.
On 64-bit platforms, an alternative would be to return the 64-bit m_id
directly, but that was measured to cause a performance regression.
fil_space_t::open(): Invoke fil_node_t::find_metadata() when the
tablespace is being created. In this way, we will actually detect
that the temporary tablespace resides on SSD. (During database
creation, also the system tablespace will correctly be detected as
residing on SSD.)
-rw-r--r-- | storage/innobase/fil/fil0fil.cc | 3 | ||||
-rw-r--r-- | storage/innobase/include/buf0types.h | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 7bac0843036..f0326b3634c 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -1171,7 +1171,10 @@ err_exit: } if (create_new_db) + { + node->find_metadata(node->handle); continue; + } if (skip_read) { size+= node->size; diff --git a/storage/innobase/include/buf0types.h b/storage/innobase/include/buf0types.h index 5dd581097f9..3c5db853fe9 100644 --- a/storage/innobase/include/buf0types.h +++ b/storage/innobase/include/buf0types.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2019, 2021, MariaDB Corporation. +Copyright (c) 2019, 2022, 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 @@ -162,7 +162,7 @@ public: /** Retrieve the fold value. @return fold value */ - ulint fold() const { return (space() << 20) + space() + page_no(); } + ulint fold() const { return (ulint{space()} << 20) + space() + page_no(); } /** Reset the page number only. @param[in] page_no page number */ |