Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-7894

Wrong error when query interrupted due to MAX_EXECUTION_TIME

Details

    • Yes

    Description

      If a query to MyRocks table interrupted due to the option MAX_EXECUTION time wrong error message reported.

      How to Repeat

      mysql> create table test_table_inno (id int not null primary key, value char(32)) engine=innodb;
      Query OK, 0 rows affected (0,02 sec)
      
      mysql> insert into test_table_inno values(1, 'one'); 
      Query OK, 1 row affected (0,02 sec)
      
      <cks (id int not null primary key, value char(32)) engine=rocksdb;                               
      Query OK, 0 rows affected (0,01 sec)
      
      mysql> insert into test_table_rocks values(1, 'one'); 
      Query OK, 1 row affected (0,01 sec)
      
      mysql> SET SESSION innodb_lock_wait_timeout=10; 
      Query OK, 0 rows affected (0,00 sec)
      
      mysql> SET SESSION rocksdb_lock_wait_timeout=10; 
      Query OK, 0 rows affected (0,00 sec)
      

      Then open another session and run:

      mysql2> begin;
      Query OK, 0 rows affected (0.00 sec)
      
      mysql2> select /*+ MAX_EXECUTION_TIME(5) */ * from test_table_inno where id=1 for update; 
      +----+-------+
      | id | value |
      +----+-------+
      |  1 | one   |
      +----+-------+
      1 row in set (0.00 sec)
      
      mysql2> select /*+ MAX_EXECUTION_TIME(5) */ * from test_table_rocks where id=1 for update; 
      +----+-------+
      | id | value |
      +----+-------+
      |  1 | one   |
      +----+-------+
      1 row in set (0.00 sec)
      

      Do not close the transaction, keep the client open!

      In the original session:

      mysql> select /*+ MAX_EXECUTION_TIME(5) */ * from test_table_rocks where id=1 for update; 
      ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
      mysql> select * from test_table_rocks where id=1 for update;                              
      ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
      

      Compare with queries to the InnoDB table:

      mysql> select /*+ MAX_EXECUTION_TIME(5) */ * from test_table_inno where id=1 for update; 
      ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded
      mysql> select * from test_table_inno where id=1 for update;  
      ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded
      

      Suggested fix

      Print correct error message.

      Attachments

        Issue Links

          Activity

            People

              marcelo.altmann Marcelo Altmann
              sveta.smirnova Sveta Smirnova
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Time Spent - 4 hours, 8 minutes Remaining Estimate - 52 minutes
                  52m
                  Logged:
                  Time Spent - 4 hours, 8 minutes Remaining Estimate - 52 minutes
                  4h 8m

                  Smart Checklist