From 5a74bfa054e652238d40d01fd05c8c08f01dc172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 30 Sep 2025 10:11:56 +0300 Subject: [PATCH] MDEV-35049 fixup: Fix SUX_LOCK_GENERIC xtrabackup_backup_func(): Invoke btr_search_sys_create(), because innodb_shutdown() assumes that it will have been called. srv_boot(): Invoke btr_search_sys_create(). This fixes assertion failures in the test innodb.temporary_table. btr_sea::create(): Do not invoke enable(). buf_pool_t::create(): Instead of invoking btr_sea::create(), invoke btr_sea::enable() when needed. --- extra/mariabackup/xtrabackup.cc | 1 + storage/innobase/btr/btr0sea.cc | 2 -- storage/innobase/buf/buf0buf.cc | 5 ++++- storage/innobase/srv/srv0srv.cc | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 5229f707f97..090bd99ac4a 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -5510,6 +5510,7 @@ fail: srv_thread_pool_init(); /* Reset the system variables in the recovery module. */ trx_pool_init(); + btr_search_sys_create(); recv_sys.create(); xb_filters_init(); diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc index 7604d61d4ee..1472334e2e1 100644 --- a/storage/innobase/btr/btr0sea.cc +++ b/storage/innobase/btr/btr0sea.cc @@ -118,8 +118,6 @@ void btr_sea::create() noexcept { for (partition &part : parts) part.init(); - if (enabled) - enable(); } void btr_sea::alloc(ulint hash_size) noexcept diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index fadd50dc898..0df5ac48845 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1506,7 +1506,10 @@ bool buf_pool_t::create() noexcept last_activity_count= srv_get_activity_count(); buf_LRU_old_ratio_update(100 * 3 / 8, false); - btr_search_sys_create(); +#ifdef BTR_CUR_HASH_ADAPT + if (btr_search.enabled) + btr_search.enable(); +#endif #ifdef __linux__ if (srv_operation == SRV_OPERATION_NORMAL) diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 82d5d040b52..dabc7f4b492 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -604,6 +604,7 @@ void srv_boot() buf_dblwr.init(); srv_thread_pool_init(); trx_pool_init(); + btr_search_sys_create(); srv_init(); }