[MDEV-26261] [ERROR] Event Scheduler: Got error 170 "It is not possible to log this statement" from storage engine InnoDB Created: 2021-07-28  Updated: 2023-11-08

Status: Open
Project: MariaDB Server
Component/s: Events
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: Critical
Reporter: Roel Van de Paar Assignee: Brandon Nesterenko
Resolution: Unresolved Votes: 0
Labels: affects-tests


 Description   

The issue starts happening as soon as the table is created. This may prove not to be a bug, however even in that case the error is unclear in the error log (i.e. it would be hard for any DBA to discover what the cause was especially if multiple events were scheduled). If not a bug, then this can be a feature request to add the failing query to the error message.

The reason it may be a bug however is that when the INSERT statement is executed manually at the command line (after creating a table with two columns and with a similar setup), the issue does not happen (or is not reported given that the event scheduler is not active in that case, though no other error is reported either).

# mysqld options required for replay: --log-bin
SET GLOBAL binlog_format=STATEMENT,GLOBAL event_scheduler=1;
CREATE EVENT e ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t VALUES (1);
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
CREATE TABLE t (c INT);

Leads to:

10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Debug)

2021-07-28 19:49:57 6105 [ERROR] Event Scheduler: [root@localhost][test.e] Got error 170 "It is not possible to log this statement" from storage engine InnoDB

Yet,

# mysqld options required for replay: --log-bin
SET GLOBAL binlog_format=STATEMENT,GLOBAL event_scheduler=1;
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
CREATE TABLE t (c INT);
INSERT INTO t VALUES (1);

Produces no such issue. This is somewhat expected as the error is reported by the event scheduler in the first case. However, no other error is produced either, thus; either the statement should be loggable (alike to the second example) or an error needs to be produced in this case also (alike to the first example) - and in such case the error can be improved by adding the failing-to-be-logged query to it.



 Comments   
Comment by Roel Van de Paar [ 2021-07-28 ]

It may be that creating the event before the isolation level set affects things?

Comment by Andrei Elkin [ 2022-01-29 ]

bnestere, salve. This one provides an opportunity to learn about another server feature !

As Roel hints in the description there's no info what exact query made ES angry.
It feels it tried to INSERT into a table yet created in the first block (so ES might got engaged too soon [from CREATE TABLE pov naturally]).

Cheers,

Andrei

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