[MDEV-24600] performance_schema.events_transactions_history_long.trx_id reports garbage Created: 2021-01-15  Updated: 2021-03-05  Resolved: 2021-01-15

Status: Closed
Project: MariaDB Server
Component/s: Performance Schema, Storage Engine - InnoDB
Affects Version/s: 10.5.2
Fix Version/s: 10.5.9

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: regression-10.5


 Description   

The table performance_schema.events_transactions_history_long that was imported from MySQL 5.7.28 to MariaDB Server 10.5.2 may report bogus trx_id values for InnoDB transactions:

--source include/not_embedded.inc
--source include/have_perfschema.inc
--source include/have_innodb.inc
 
TRUNCATE performance_schema.events_transactions_history_long;
 
START TRANSACTION WITH CONSISTENT SNAPSHOT;
COMMIT;
BEGIN;
SELECT COUNT(*)>=0 FROM mysql.innodb_index_stats LOCK IN SHARE MODE;
COMMIT;
 
SELECT state,trx_id,gtid
FROM performance_schema.events_transactions_history_long;

For the first reported row, the trx_id may not be deterministic between test runs, because it is based on the value of trx_t*, computed by the function trx_get_id_for_print() and passed to trans_register_ha() by innobase_register_trx().

Yes, it is possible that no transaction identifier has been assigned to a transaction at the time when innobase_register_trx() has been called. In this case, passing the dummy value trx->id=0 would result in a preferred outcome: the TRX_ID would be reported as NULL.

We can also observe that GTID} will be reported as a dummy value '0-0-0' instead of more appropriate NULL. I will not report or address that for now.


Generated at Thu Feb 08 09:31:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.