[MDEV-32788] CMAKE_BUILD_TYPE=Debug build failure with SUX_LOCK_GENERIC Created: 2023-11-13  Updated: 2023-11-13  Resolved: 2023-11-13

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Storage Engine - InnoDB
Affects Version/s: 10.6, 10.10, 10.11, 11.0, 11.1, 11.2
Fix Version/s: 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3, 11.3.2

Type: Bug Priority: Critical
Reporter: Dmitry Shulga Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: regression

Issue Links:
Problem/Incident
is caused by MDEV-32050 UNDO logs still growing for write-int... Closed
Relates
relates to MDEV-26476 InnoDB is missing futex support on so... Closed

 Description   

Attempt to build server on MacOS fails with error like the following ones:

server-10.6/storage/innobase/trx/trx0purge.cc:855:21: error: no member named 'is_write_locked' in 'srw_lock_impl<true>'
  ut_ad(rseg->latch.is_write_locked());
        ~~~~~~~~~~~ ^
server-10.6/storage/innobase/include/ut0dbg.h:62:15: note: expanded from macro 'ut_ad'
#define ut_ad   DBUG_SLOW_ASSERT
 
server-10.6/storage/innobase/trx/trx0purge.cc:971:21: error: no member named 'is_write_locked' in 'srw_lock_impl<true>'
  ut_ad(rseg->latch.is_write_locked());
        ~~~~~~~~~~~ ^
server-10.6/storage/innobase/include/ut0dbg.h:62:15: note: expanded from macro 'ut_ad'
#define ut_ad   DBUG_SLOW_ASSERT



 Comments   
Comment by Marko Mäkelä [ 2023-11-13 ]

I think that this affects CMAKE_BUILD_TYPE=Debug builds of platforms where futex-like system calls (MDEV-26476) have not been implemented.

I can reproduce this on GNU/Linux if I add -DSUX_LOCK_GENERIC to CMAKE_CXX_FLAGS. I will fix this.

Comment by Marko Mäkelä [ 2023-11-13 ]

diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc
index 592b8a5371c..0f55892a105 100644
--- a/storage/innobase/trx/trx0purge.cc
+++ b/storage/innobase/trx/trx0purge.cc
@@ -852,7 +852,9 @@ void purge_sys_t::rseg_get_next_history_log()
 {
   fil_addr_t prev_log_addr;
 
+#ifndef SUX_LOCK_GENERIC
   ut_ad(rseg->latch.is_write_locked());
+#endif
   ut_a(rseg->last_page_no != FIL_NULL);
 
   tail.trx_no= rseg->last_trx_no() + 1;
@@ -968,7 +970,9 @@ inline trx_purge_rec_t purge_sys_t::get_next_rec(roll_ptr_t roll_ptr)
 {
   ut_ad(next_stored);
   ut_ad(tail.trx_no < low_limit_no());
+#ifndef SUX_LOCK_GENERIC
   ut_ad(rseg->latch.is_write_locked());
+#endif
 
   if (!offset)
   {

Comment by Dmitry Shulga [ 2023-11-13 ]

The branch for review is bb-10.6-MDEV-32788

Generated at Thu Feb 08 10:34:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.