Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-22491

Support mariadb-check and CHECK TABLE with SEQUENCE

Details

    Description

      SEQUENCE is based on Storage engine like InnoDB or MyISAM but CHECK TABLE or mysqlcheck fail/not supported for such sequence.

      MariaDB [test]> show create sequence a;
      +-------+--------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                             |
      +-------+--------------------------------------------------------------------------------------------------------------------------+
      | a     | CREATE SEQUENCE `a` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB |
      +-------+--------------------------------------------------------------------------------------------------------------------------+
       

       
      MariaDB [test]> show create sequence b;
      +-------+--------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                             |
      +-------+--------------------------------------------------------------------------------------------------------------------------+
      | b     | CREATE SEQUENCE `b` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM |
      +-------+--------------------------------------------------------------------------------------------------------------------------+
      
      

      MariaDB [test]> select TABLE_NAME, TABLE_TYPE , ENGINE  from information_schema.tables where table_schema='test';
      +------------+------------+--------+
      | TABLE_NAME | TABLE_TYPE | ENGINE |
      +------------+------------+--------+
      | a          | SEQUENCE   | InnoDB |
      | t1         | BASE TABLE | InnoDB |
      | b          | SEQUENCE   | MyISAM |
      | t2         | BASE TABLE | MyISAM |
      +------------+------------+--------+
       
       
      MariaDB [test]> check table a;
      +--------+-------+----------+--------------------------------------------------------+
      | Table  | Op    | Msg_type | Msg_text                                               |
      +--------+-------+----------+--------------------------------------------------------+
      | test.a | check | note     | The storage engine for the table doesn't support check |
      +--------+-------+----------+--------------------------------------------------------+
      1 row in set (0.000 sec)
       
      MariaDB [test]> check table b;
      +--------+-------+----------+--------------------------------------------------------+
      | Table  | Op    | Msg_type | Msg_text                                               |
      +--------+-------+----------+--------------------------------------------------------+
      | test.b | check | note     | The storage engine for the table doesn't support check |
      +--------+-------+----------+--------------------------------------------------------+
      1 row in set (0.000 sec)
       
      MariaDB [test]> check table t1;
      +---------+-------+----------+----------+
      | Table   | Op    | Msg_type | Msg_text |
      +---------+-------+----------+----------+
      | test.t1 | check | status   | OK       |
      +---------+-------+----------+----------+
      1 row in set (0.001 sec)
       
      MariaDB [test]> check table t2;
      +---------+-------+----------+----------+
      | Table   | Op    | Msg_type | Msg_text |
      +---------+-------+----------+----------+
      | test.t2 | check | status   | OK       |
      +---------+-------+----------+----------+
      1 row in set (0.001 sec)
       
       
      [root@master_node_01 test]# mysqlcheck --databases test
      test.a
      note     : The storage engine for the table doesn't support check
      test.b
      note     : The storage engine for the table doesn't support check
      test.t1                                            OK
      test.t2                                            OK
      
      

      Attachments

        Issue Links

          Activity

            lstartseva Lena Startseva added a comment -

            Ok to push with MDEV-35866. Note that problem with mariadb-check --repair will be fixed in MDEV-35867 as separate task as discussed.

            lstartseva Lena Startseva added a comment - Ok to push with MDEV-35866 . Note that problem with mariadb-check --repair will be fixed in MDEV-35867 as separate task as discussed.
            ycp Yuchen Pei added a comment - - edited

            Thanks for the testing lstartseva.

            The plan was to base this issue and MDEV-35866 on a branch that includes MDEV-36032.

            But (AFAICT) as the (10.X-11.X) releases have been cut, MDEV-36032 did not make to 11.8 in the merge.

            Now there are several ways forward:

            1. Cherry pick MDEV-36032 to 12.0, then push MDEV-22491/MDEV-35866. sanja floated this idea before, but that was three days ago when the releasing situation was still evolving, and it is not clear whether this can be done now (I've never cherrypicked a lower-version bugfix to a feature release before).
            2. Push MDEV-22491/MDEV-35866 to 12.0 without MDEV-36032. serg said in general if a bug is in an earlier version it should not block a feature push because it is a known bug. The downside is that there are crashes as in the testcase of marko's first comment in MDEV-36032. The testcase is a scenario where one tries to construct corrupt sequence tables before CHECKing them. Therefore it is possible that with this change users are more likely encounter the crash by testing the CHECK. Is this a likely scenario? I can't predict. This option may also require further testing because the previous testing was on a patchset containing MDEV-36032 (see below for fresh commits not containing MDEV-36032) - up to lstartseva I think.
            3. Delay the push to 12.1, when MDEV-36032 will be included from merge up.

            1dc2575281f upstream/bb-12.0-mdev-22491-35866-no-36032 MDEV-35866 CHECK TABLE get number of rows without HA_STATS_RECORDS_IS_EXACT
            9e9523cdbb3 MDEV-22491 Support mariadb-check and CHECK TABLE with SEQUENCE
            

            I think unless I get a go-ahead from serg or sanja on Option 1 or 2, I will default to Option 3.

            ycp Yuchen Pei added a comment - - edited Thanks for the testing lstartseva . The plan was to base this issue and MDEV-35866 on a branch that includes MDEV-36032 . But (AFAICT) as the (10.X-11.X) releases have been cut, MDEV-36032 did not make to 11.8 in the merge. Now there are several ways forward: 1. Cherry pick MDEV-36032 to 12.0, then push MDEV-22491 / MDEV-35866 . sanja floated this idea before, but that was three days ago when the releasing situation was still evolving, and it is not clear whether this can be done now (I've never cherrypicked a lower-version bugfix to a feature release before). 2. Push MDEV-22491 / MDEV-35866 to 12.0 without MDEV-36032 . serg said in general if a bug is in an earlier version it should not block a feature push because it is a known bug. The downside is that there are crashes as in the testcase of marko 's first comment in MDEV-36032 . The testcase is a scenario where one tries to construct corrupt sequence tables before CHECKing them. Therefore it is possible that with this change users are more likely encounter the crash by testing the CHECK. Is this a likely scenario? I can't predict. This option may also require further testing because the previous testing was on a patchset containing MDEV-36032 (see below for fresh commits not containing MDEV-36032 ) - up to lstartseva I think. 3. Delay the push to 12.1, when MDEV-36032 will be included from merge up. 1dc2575281f upstream/bb-12.0-mdev-22491-35866-no-36032 MDEV-35866 CHECK TABLE get number of rows without HA_STATS_RECORDS_IS_EXACT 9e9523cdbb3 MDEV-22491 Support mariadb-check and CHECK TABLE with SEQUENCE I think unless I get a go-ahead from serg or sanja on Option 1 or 2, I will default to Option 3.
            serg Sergei Golubchik added a comment -

            I wasn't able to crash the bb-12.0-mdev-22491-35866-no-36032 branch with CHECK TABLE in a modified Marko's test case. It looks like MDEV-36032 is not really related to CHECK and can be treated completely separately. If this is the case, then it should be ok to push bb-12.0-mdev-22491-35866-no-36032 into 12.0.

            If' I'm wrong about it, then I'd suggest to cherry-pick the fix and still push this into 12.0, it looks like an important feature, lots of watchers

            serg Sergei Golubchik added a comment - I wasn't able to crash the bb-12.0-mdev-22491-35866-no-36032 branch with CHECK TABLE in a modified Marko's test case. It looks like MDEV-36032 is not really related to CHECK and can be treated completely separately. If this is the case, then it should be ok to push bb-12.0-mdev-22491-35866-no-36032 into 12.0. If' I'm wrong about it, then I'd suggest to cherry-pick the fix and still push this into 12.0, it looks like an important feature, lots of watchers
            ycp Yuchen Pei added a comment -

            Thanks for checking. What I was saying was that if a user wants to try CHECK TABLE on a sequence table with more than one row, they could easily get into a crash before being able to execute the CHECK TABLE statement, like the following, which is the simplest way to create a sequence with more than one row:

            --source include/have_innodb.inc
             
            create sequence s engine=innodb;
            alter table s sequence=0;
            insert into s values (3,1,9223372036854775806,1,1,1000,0,0);
            # crash
            alter table s sequence=1;
            check table s;
            drop sequence s;

            I just don't know how likely users will want to do that.

            ycp Yuchen Pei added a comment - Thanks for checking. What I was saying was that if a user wants to try CHECK TABLE on a sequence table with more than one row, they could easily get into a crash before being able to execute the CHECK TABLE statement, like the following, which is the simplest way to create a sequence with more than one row: --source include/have_innodb.inc   create sequence s engine=innodb; alter table s sequence =0; insert into s values (3,1,9223372036854775806,1,1,1000,0,0); # crash alter table s sequence =1; check table s; drop sequence s; I just don't know how likely users will want to do that.
            serg Sergei Golubchik added a comment - - edited

            Correct. But it's not a crash during CHECK, it'll be in 12.0 whether you push or not. Pushing CHECK doesn't make the situation worse.

            Thus, I think, it should be pushed into 12.0. Note that MDEV-36032 will reach 12.0 before it becomes GA

            serg Sergei Golubchik added a comment - - edited Correct. But it's not a crash during CHECK , it'll be in 12.0 whether you push or not. Pushing CHECK doesn't make the situation worse. Thus, I think, it should be pushed into 12.0. Note that MDEV-36032 will reach 12.0 before it becomes GA

            People

              ycp Yuchen Pei
              pramod.mahto@mariadb.com Pramod Mahto
              Votes:
              1 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.