mariadb/storage/innobase
Alessandro Vetere e151cb583d SAMU-322: avoid spurious AHI params setting
In btr_search_info_update_hash, when hash potential is reset,
make sure that AHI params are properly reset too.

Before this changes, when cmp == 0, this assignment could be done
if cursor.low_match == 0 and cursor.low_bytes == 0:

info.left_bytes_field= 0x80010000;  // 1-byte left prefix

Since the code is not fully thread safe by design, another thread
could have already taken the !n_hash_potential branch before,
and got to where the potential of the hash is increased:

info.n_hash_potential= ++n_hash_potential;

If the reset to 0x80010000 happened right before the hash potential increment,
then an AHI index with 1-byte left prefix could be later (possibly wrongly)
built on the page.

With this change, the assignment in case cmp == 0 becomes the
same that the resetting code applied:

info.left_bytes_field= 0x80000001;  // 1-field left prefix

This is more in-line pre-MDEV-35049 code behavior.

A more coherent albeit possibly more costly solution would be to merge
all the AHI "status" variables into one 64 bits atomic word, so that
by design the above concurrency issues could not be applicable.

Many thanks to Marko Mäkelä <marko.makela@mariadb.com> for spotting the
relevant code and for the collaboration.
2025-09-24 15:39:09 +00:00
..
btr SAMU-322: avoid spurious AHI params setting 2025-09-24 15:39:09 +00:00
buf Fix assertion failures with SUX_LOCK_GENERIC 2025-09-22 10:46:00 +00:00
data MDEV-35049: Use CRC-32C and avoid allocating heap 2025-01-10 16:39:44 +02:00
dict Merge branch '11.4' into 11.8 2025-05-21 15:57:16 +02:00
eval MDEV-26938 Support descending indexes internally in InnoDB 2022-01-26 18:43:05 +01:00
fil Merge branch '11.7' into 11.8 2025-02-11 20:29:43 +01:00
fsp Merge remote-tracking branch 'github/bb-11.4-release' into bb-11.8-serg 2025-04-27 19:40:00 +02:00
fts Merge 11.4 into 11.8 2025-03-05 20:39:47 +02:00
fut MDEV-35689 InnoDB system tables cannot be optimized or defragmented 2025-04-10 17:13:34 +05:30
gis Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
ha MDEV-35472 Server crash in ha_storage_put_memlim upon reading from INNODB_LOCKS 2024-11-25 10:31:57 +02:00
handler squash! 7430887b80 2025-09-22 10:46:00 +00:00
ibuf MDEV-29445: Reimplement SET GLOBAL innodb_buffer_pool_size 2025-03-26 17:05:44 +02:00
include squash! 7430887b80 2025-09-22 10:46:00 +00:00
lock Merge branch '10.11' into 11.4 2025-04-26 10:53:02 +02:00
log Merge remote-tracking branch 'github/bb-11.4-release' into bb-11.8-serg 2025-04-27 19:40:00 +02:00
mem MDEV-35049: btr_search_check_free_space_in_heap() is a bottleneck 2025-01-10 16:30:42 +02:00
mtr Merge branch '11.4' into 11.8 2025-05-21 15:57:16 +02:00
mysql-test/storage_engine Remove dates from all rdiff files 2025-01-05 16:40:11 +02:00
os Merge remote-tracking branch 'github/bb-11.4-release' into bb-11.8-serg 2025-04-27 19:40:00 +02:00
page MDEV-35849: index records in a wrong order 2025-01-15 07:31:33 +02:00
pars Merge 11.4 into 11.8 2025-03-05 20:39:47 +02:00
que MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing disruption and replication failure 2024-12-12 18:02:00 +02:00
read MDEV-34515: Contention between purge and workload 2024-08-26 12:23:06 +03:00
rem MDEV-35049: Use CRC-32C and avoid allocating heap 2025-01-10 16:39:44 +02:00
row Merge remote-tracking branch 'github/bb-11.4-release' into bb-11.8-serg 2025-04-27 19:40:00 +02:00
srv Fix assertion failures with SUX_LOCK_GENERIC 2025-09-22 10:46:00 +00:00
sync fixup! 8aafa20ec2 2025-09-22 10:46:00 +00:00
trx Merge remote-tracking branch 'github/bb-11.4-release' into bb-11.8-serg 2025-04-27 19:40:00 +02:00
unittest fixup! 1234090d59 2025-09-22 10:46:00 +00:00
ut MDEV-36759: Huge performance drop 2025-05-13 12:27:50 +03:00
.clang-format-old switch off storage/innobase/.clang-format: InnoDB uses a common formatting style for all new code 2021-03-17 11:01:15 +03:00
CMakeLists.txt Merge 11.4 into 11.8 2025-03-05 20:39:47 +02:00
COPYING.Google
COPYING.Percona