diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index 323994fa14f..246af942419 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2021, MariaDB Corporation. +Copyright (c) 2017, 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 @@ -811,7 +811,7 @@ public: /** TRX_RSEG_HISTORY list length (number of committed transactions to purge) */ - MY_ALIGNED(CACHE_LINE_SIZE) Atomic_counter rseg_history_len; + MY_ALIGNED(CACHE_LINE_SIZE) Atomic_counter rseg_history_len; /** Mutex protecting trx_list. */ MY_ALIGNED(CACHE_LINE_SIZE) mutable TrxSysMutex mutex; diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 01a31b41662..a5ac7de0a92 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -4602,14 +4602,14 @@ lock_print_info_summary( fprintf(file, "Purge done for trx's n:o < " TRX_ID_FMT " undo n:o < " TRX_ID_FMT " state: %s\n" - "History list length %u\n", + "History list length %zu\n", purge_sys.tail.trx_no, purge_sys.tail.undo_no, purge_sys.enabled() ? (purge_sys.running() ? "running" : purge_sys.paused() ? "stopped" : "running but idle") : "disabled", - uint32_t{trx_sys.rseg_history_len}); + size_t{trx_sys.rseg_history_len}); #ifdef PRINT_NUM_OF_LOCK_STRUCTS fprintf(file, diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 0caf5b9033f..47e0fe13053 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -2393,7 +2393,7 @@ static bool srv_purge_should_exit() return true; /* Slow shutdown was requested. */ - if (const uint32_t history_size= trx_sys.rseg_history_len) + if (const size_t history_size= trx_sys.rseg_history_len) { static time_t progress_time; time_t now= time(NULL); @@ -2402,7 +2402,7 @@ static bool srv_purge_should_exit() progress_time= now; #if defined HAVE_SYSTEMD && !defined EMBEDDED_LIBRARY service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL, - "InnoDB: to purge %u transactions", + "InnoDB: to purge %zu transactions", history_size); ib::info() << "to purge " << history_size << " transactions"; #endif @@ -2516,17 +2516,17 @@ DECLARE_THREAD(srv_worker_thread)( /** Do the actual purge operation. @param[in,out] n_total_purged total number of purged pages @return length of history list before the last purge batch. */ -static uint32_t srv_do_purge(ulint* n_total_purged +static size_t srv_do_purge(ulint* n_total_purged #ifdef UNIV_DEBUG - , srv_slot_t* slot /*!< purge coordinator */ + , srv_slot_t* slot /*!< purge coordinator */ #endif - ) + ) { ulint n_pages_purged; static ulint count = 0; static ulint n_use_threads = 0; - static uint32_t rseg_history_len = 0; + static size_t rseg_history_len = 0; ulint old_activity_count = srv_get_activity_count(); const ulint n_threads = srv_n_purge_threads; @@ -2606,7 +2606,7 @@ srv_purge_coordinator_suspend( /*==========================*/ srv_slot_t* slot, /*!< in/out: Purge coordinator thread slot */ - uint32_t rseg_history_len) /*!< in: history list length + size_t rseg_history_len) /*!< in: history list length before last purge */ { ut_ad(!srv_read_only_mode); @@ -2697,7 +2697,7 @@ DECLARE_THREAD(srv_purge_coordinator_thread)( rw_lock_create(PFS_NOT_INSTRUMENTED, &slot->debug_sync_lock, SYNC_NO_ORDER_CHECK); #endif - uint32_t rseg_history_len = trx_sys.rseg_history_len; + size_t rseg_history_len = trx_sys.rseg_history_len; do { /* If there are no records to purge or the last