[MDEV-26124] Minor LOAD INDEX output inconsistencies under XA Created: 2021-07-10  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, XA
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Minor
Reporter: Roel Van de Paar Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Whilst it does not seem to affect operation/data, the "Corrupt" error in the output below looks to be incorrect:

10.7.0 57f14eab20ae2733eb341f3d293515a10a40bc48 (Debug)

10.7.0-dbg>XA START 'a';
Query OK, 0 rows affected (0.000 sec)
 
10.7.0-dbg>LOAD INDEX INTO CACHE t KEY(PRIMARY);
+--------+--------------+----------+------------------------------+
| Table  | Op           | Msg_type | Msg_text                     |
+--------+--------------+----------+------------------------------+
| test.t | preload_keys | Error    | Table 'test.t' doesn't exist |
| test.t | preload_keys | status   | Operation failed             |
+--------+--------------+----------+------------------------------+
2 rows in set (0.000 sec)
 
10.7.0-dbg>XA END 'a';
Query OK, 0 rows affected (0.000 sec)
 
10.7.0-dbg>LOAD INDEX INTO CACHE t KEY(PRIMARY);
+--------+--------------+----------+-------------------------------------------------------------------------------------------+
| Table  | Op           | Msg_type | Msg_text                                                                                  |
+--------+--------------+----------+-------------------------------------------------------------------------------------------+
| test.t | preload_keys | Error    | XAER_RMFAIL: The command cannot be executed when global transaction is in the  IDLE state |
| test.t | preload_keys | Error    | XAER_RMFAIL: The command cannot be executed when global transaction is in the  IDLE state |
| test.t | preload_keys | error    | Corrupt                                                                                   |
+--------+--------------+----------+-------------------------------------------------------------------------------------------+
3 rows in set (0.000 sec)

Furthermore, the output in 10.2 (and 10.3) for the same commands is somewhat different (single XAER_RMFAIL output instead of repeated):

10.2.38 (Debug)

10.2.38-dbg>LOAD INDEX INTO CACHE t KEY(PRIMARY);
+--------+--------------+----------+-------------------------------------------------------------------------------------------+
| Table  | Op           | Msg_type | Msg_text                                                                                  |
+--------+--------------+----------+-------------------------------------------------------------------------------------------+
| test.t | preload_keys | Error    | XAER_RMFAIL: The command cannot be executed when global transaction is in the  IDLE state |
| test.t | preload_keys | error    | Corrupt                                                                                   |
+--------+--------------+----------+-------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

10.4, 10.5 and 10.6 also have double repeated XAER_RMFAIL messages. It is not clear why the messages are repeated now (could be a regression). It also does matter if the table exists or not, the output is the same.



 Comments   
Comment by Marko Mäkelä [ 2021-07-10 ]

This is the first time I became aware of the existence of such syntax. The initial implementation used the keyword PRELOAD.

For distributed transactions, InnoDB only allows operations to be executed while the transaction is in the active state. I think that this bug is best fixed by properly disallowing the operation while a distributed transaction is in a non-active state, just like we should do for any operation. InnoDB is only the messenger here, not the culprit.

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