Details

    Description

      MDEV-27734 disabled the problematic InnoDB change buffer by default, and MDEV-27735 deprecated the parameter in MariaDB Server 10.9.

      The next logical step is to remove the parameter altogether, along with any code that would create the change buffer or add records to it. An attempt to downgrade to an earlier version will be caught and prevented by MDEV-30106.

      In order to be able to simplify the buffer pool interfaces, upgrading will be split in two parts: First, check if an upgrade is needed. If it is, we will apply all redo log, possibly upgrade the redo log to the current format, and then attempt to upgrade the change buffer:

      1. Apply any buffered changes and clear the corresponding change buffer bitmap bits.
      2. Create an empty the change buffer root page.
      3. Free any pages that were allocated to the change buffer.
      4. Reset the change buffer root page, to mark the upgrade as completed and to prevent a downgrade to an earlier version.

      If an error occurs during before the final upgrade step, it should be possible to downgrade to MariaDB Server 10.8 or a later version (using the currently latest redo log format that was changed in MDEV-14425).

      As noted in MDEV-11634, the change buffer may improve performance in some cases, but it is also missing a lot of potential. The main motivation for removing the change buffer in its current form is that difficult-to-reproduce corruption bugs keep popping up, such as MDEV-24449, MDEV-26917, MDEV-30009.

      Attachments

        Issue Links

          Activity

            Scenario:
            1. Start the server with the combination of innodb_fast_shutdown and innodb_change_buffering values mentioned.
            2. Create a InnoDB table and fill it with records
            3. Shutdown+Restart
            4. CHECK TABLE test.t1 EXTENDED
             
            OLD_MARIADB: origin/10.6 commit 6d40274f65b8d145fbf496e9b1b1d46f258de227 (HEAD, origin/10.6)
            NEW_MARIADB: origin/bb-10.11-MDEV-29694 commit acc6ac8f6fc460df3d551f61fcdff5f5d0276cac
            FAST_SHUTDOWN: 0 -- CHANGE_BUFFERING: 'inserts'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 0 -- CHANGE_BUFFERING: 'none'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 0 -- CHANGE_BUFFERING: 'deletes'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 0 -- CHANGE_BUFFERING: 'purges'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 0 -- CHANGE_BUFFERING: 'changes'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 0 -- CHANGE_BUFFERING: 'all'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 1 -- CHANGE_BUFFERING: 'inserts'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 1 -- CHANGE_BUFFERING: 'none'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 1 -- CHANGE_BUFFERING: 'deletes'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 1 -- CHANGE_BUFFERING: 'purges'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 1 -- CHANGE_BUFFERING: 'changes'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 1 -- CHANGE_BUFFERING: 'all'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 2 -- CHANGE_BUFFERING: 'inserts'
            Table   Op  Msg_type    Msg_text
            test.t1 check   Error   Unknown storage engine 'InnoDB'
            test.t1 check   error   Corrupt
            2022-12-05 11:15:01 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.12. You must start up and shut down MariaDB 10.7 or earlier.
            2022-12-05 11:15:01 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1562] with error Generic error
            2022-12-05 11:15:01 0 [ERROR] Plugin 'InnoDB' init function returned error.
            2022-12-05 11:15:01 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
            FAST_SHUTDOWN: 2 -- CHANGE_BUFFERING: 'none'
            Table   Op  Msg_type    Msg_text
            test.t1 check   Error   Unknown storage engine 'InnoDB'
            test.t1 check   error   Corrupt
            2022-12-05 11:15:09 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.12. You must start up and shut down MariaDB 10.7 or earlier.
            2022-12-05 11:15:09 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1562] with error Generic error
            2022-12-05 11:15:09 0 [ERROR] Plugin 'InnoDB' init function returned error.
            2022-12-05 11:15:09 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
            FAST_SHUTDOWN: 2 -- CHANGE_BUFFERING: 'deletes'
            Table   Op  Msg_type    Msg_text
            test.t1 check   Error   Unknown storage engine 'InnoDB'
            test.t1 check   error   Corrupt
            2022-12-05 11:15:17 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.12. You must start up and shut down MariaDB 10.7 or earlier.
            2022-12-05 11:15:17 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1562] with error Generic error
            2022-12-05 11:15:17 0 [ERROR] Plugin 'InnoDB' init function returned error.
            2022-12-05 11:15:17 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
            FAST_SHUTDOWN: 2 -- CHANGE_BUFFERING: 'purges'
            Table   Op  Msg_type    Msg_text
            test.t1 check   Error   Unknown storage engine 'InnoDB'
            test.t1 check   error   Corrupt
            2022-12-05 11:15:25 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.12. You must start up and shut down MariaDB 10.7 or earlier.
            2022-12-05 11:15:25 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1562] with error Generic error
            2022-12-05 11:15:25 0 [ERROR] Plugin 'InnoDB' init function returned error.
            2022-12-05 11:15:25 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
            FAST_SHUTDOWN: 2 -- CHANGE_BUFFERING: 'changes'
            Table   Op  Msg_type    Msg_text
            test.t1 check   Error   Unknown storage engine 'InnoDB'
            test.t1 check   error   Corrupt
            2022-12-05 11:15:33 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.12. You must start up and shut down MariaDB 10.7 or earlier.
            2022-12-05 11:15:33 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1562] with error Generic error
            2022-12-05 11:15:33 0 [ERROR] Plugin 'InnoDB' init function returned error.
            2022-12-05 11:15:33 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
            FAST_SHUTDOWN: 2 -- CHANGE_BUFFERING: 'all'
            Table   Op  Msg_type    Msg_text
            test.t1 check   Error   Unknown storage engine 'InnoDB'
            test.t1 check   error   Corrupt
            2022-12-05 11:15:41 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.12. You must start up and shut down MariaDB 10.7 or earlier.
            2022-12-05 11:15:41 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1562] with error Generic error
            2022-12-05 11:15:41 0 [ERROR] Plugin 'InnoDB' init function returned error.
            2022-12-05 11:15:41 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
            FAST_SHUTDOWN: 3 -- CHANGE_BUFFERING: 'inserts'
            able   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 3 -- CHANGE_BUFFERING: 'none'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 3 -- CHANGE_BUFFERING: 'deletes'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 3 -- CHANGE_BUFFERING: 'purges'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 3 -- CHANGE_BUFFERING: 'changes'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            FAST_SHUTDOWN: 3 -- CHANGE_BUFFERING: 'all'
            Table   Op  Msg_type    Msg_text
            test.t1 check   status  OK
            
            

            mleich Matthias Leich added a comment - Scenario: 1. Start the server with the combination of innodb_fast_shutdown and innodb_change_buffering values mentioned. 2. Create a InnoDB table and fill it with records 3. Shutdown+Restart 4. CHECK TABLE test.t1 EXTENDED   OLD_MARIADB: origin/10.6 commit 6d40274f65b8d145fbf496e9b1b1d46f258de227 (HEAD, origin/10.6) NEW_MARIADB: origin/bb-10.11-MDEV-29694 commit acc6ac8f6fc460df3d551f61fcdff5f5d0276cac FAST_SHUTDOWN: 0 -- CHANGE_BUFFERING: 'inserts' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 0 -- CHANGE_BUFFERING: 'none' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 0 -- CHANGE_BUFFERING: 'deletes' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 0 -- CHANGE_BUFFERING: 'purges' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 0 -- CHANGE_BUFFERING: 'changes' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 0 -- CHANGE_BUFFERING: 'all' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 1 -- CHANGE_BUFFERING: 'inserts' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 1 -- CHANGE_BUFFERING: 'none' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 1 -- CHANGE_BUFFERING: 'deletes' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 1 -- CHANGE_BUFFERING: 'purges' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 1 -- CHANGE_BUFFERING: 'changes' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 1 -- CHANGE_BUFFERING: 'all' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 2 -- CHANGE_BUFFERING: 'inserts' Table Op Msg_type Msg_text test.t1 check Error Unknown storage engine 'InnoDB' test.t1 check error Corrupt 2022-12-05 11:15:01 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.12. You must start up and shut down MariaDB 10.7 or earlier. 2022-12-05 11:15:01 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1562] with error Generic error 2022-12-05 11:15:01 0 [ERROR] Plugin 'InnoDB' init function returned error. 2022-12-05 11:15:01 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. FAST_SHUTDOWN: 2 -- CHANGE_BUFFERING: 'none' Table Op Msg_type Msg_text test.t1 check Error Unknown storage engine 'InnoDB' test.t1 check error Corrupt 2022-12-05 11:15:09 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.12. You must start up and shut down MariaDB 10.7 or earlier. 2022-12-05 11:15:09 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1562] with error Generic error 2022-12-05 11:15:09 0 [ERROR] Plugin 'InnoDB' init function returned error. 2022-12-05 11:15:09 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. FAST_SHUTDOWN: 2 -- CHANGE_BUFFERING: 'deletes' Table Op Msg_type Msg_text test.t1 check Error Unknown storage engine 'InnoDB' test.t1 check error Corrupt 2022-12-05 11:15:17 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.12. You must start up and shut down MariaDB 10.7 or earlier. 2022-12-05 11:15:17 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1562] with error Generic error 2022-12-05 11:15:17 0 [ERROR] Plugin 'InnoDB' init function returned error. 2022-12-05 11:15:17 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. FAST_SHUTDOWN: 2 -- CHANGE_BUFFERING: 'purges' Table Op Msg_type Msg_text test.t1 check Error Unknown storage engine 'InnoDB' test.t1 check error Corrupt 2022-12-05 11:15:25 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.12. You must start up and shut down MariaDB 10.7 or earlier. 2022-12-05 11:15:25 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1562] with error Generic error 2022-12-05 11:15:25 0 [ERROR] Plugin 'InnoDB' init function returned error. 2022-12-05 11:15:25 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. FAST_SHUTDOWN: 2 -- CHANGE_BUFFERING: 'changes' Table Op Msg_type Msg_text test.t1 check Error Unknown storage engine 'InnoDB' test.t1 check error Corrupt 2022-12-05 11:15:33 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.12. You must start up and shut down MariaDB 10.7 or earlier. 2022-12-05 11:15:33 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1562] with error Generic error 2022-12-05 11:15:33 0 [ERROR] Plugin 'InnoDB' init function returned error. 2022-12-05 11:15:33 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. FAST_SHUTDOWN: 2 -- CHANGE_BUFFERING: 'all' Table Op Msg_type Msg_text test.t1 check Error Unknown storage engine 'InnoDB' test.t1 check error Corrupt 2022-12-05 11:15:41 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.12. You must start up and shut down MariaDB 10.7 or earlier. 2022-12-05 11:15:41 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1562] with error Generic error 2022-12-05 11:15:41 0 [ERROR] Plugin 'InnoDB' init function returned error. 2022-12-05 11:15:41 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. FAST_SHUTDOWN: 3 -- CHANGE_BUFFERING: 'inserts' able Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 3 -- CHANGE_BUFFERING: 'none' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 3 -- CHANGE_BUFFERING: 'deletes' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 3 -- CHANGE_BUFFERING: 'purges' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 3 -- CHANGE_BUFFERING: 'changes' Table Op Msg_type Msg_text test.t1 check status OK FAST_SHUTDOWN: 3 -- CHANGE_BUFFERING: 'all' Table Op Msg_type Msg_text test.t1 check status OK

            origin/bb-10.11-new-innodb-defaults c434f870a346fb11a6b5932dbdf860ed7e2d2f74 2022-12-12T10:05:22+02:00
            which contains MDEV-29986, MDEV-19506, MDEV-29694, MDEV-30136, MDEV-29983
            performed well in RQG testing. No new problems

            mleich Matthias Leich added a comment - origin/bb-10.11-new-innodb-defaults c434f870a346fb11a6b5932dbdf860ed7e2d2f74 2022-12-12T10:05:22+02:00 which contains MDEV-29986 , MDEV-19506 , MDEV-29694 , MDEV-30136 , MDEV-29983 performed well in RQG testing. No new problems
            marko Marko Mäkelä added a comment - - edited

            It is worth noting that starting with MDEV-30400, the test innodb.ibuf_not_empty no longer actually uses the change buffer, because the debug parameter innodb_change_buffering_debug lost many ‘teeth’ because of the locking changes. I retested an upgrade from 10.8 right before the merge to 11.0 with MDEV-30400, using my above patch to the 10.8 innodb.ibuf_not_empty test:

            2023-01-25  9:58:03 0 [Note] InnoDB: Upgrading the change buffer
            2023-01-25  9:58:03 0 [Note] InnoDB: Upgraded the change buffer: 1 tablespaces, 14 pages
            

            marko Marko Mäkelä added a comment - - edited It is worth noting that starting with MDEV-30400 , the test innodb.ibuf_not_empty no longer actually uses the change buffer, because the debug parameter innodb_change_buffering_debug lost many ‘teeth’ because of the locking changes. I retested an upgrade from 10.8 right before the merge to 11.0 with MDEV-30400 , using my above patch to the 10.8 innodb.ibuf_not_empty test: 2023-01-25 9:58:03 0 [Note] InnoDB: Upgrading the change buffer 2023-01-25 9:58:03 0 [Note] InnoDB: Upgraded the change buffer: 1 tablespaces, 14 pages

            Users should beware of dormant corruption, such as that one caused by MDEV-32132 a.k.a. MDEV-30009. We got a case of that in MDEV-32044.

            greenman, I think that we must amend the recommended upgrade procedure from 10.x to 11.x along the following lines:

            1. If the change buffer had been enabled in the past (MDEV-27734 disabled it by default in 10.5.15, 10.6.7), and
            2. if DROP INDEX and CREATE INDEX had been executed such that buffered changes existed for the index that had been dropped,
            3. it would best to execute a shutdown with innodb_fast_shutdown=0 before upgrading, to prevent corruption of data.

            The upgrade procedure ignores the "change buffer bitmaps" and trusts that all records in the change buffer are valid. The slow shutdown procedure of 10.4 (MDEV-20934; revised in MDEV-30009 for 10.5 and later) will discard bogus entries for pages to which there are exist buffered changes according to the change buffer bitmap.

            We might choose to revise the upgrade logic in 11.0 to work in a similar fashion. Until or unless that is done, I think that we must document this.

            marko Marko Mäkelä added a comment - Users should beware of dormant corruption, such as that one caused by MDEV-32132 a.k.a. MDEV-30009 . We got a case of that in MDEV-32044 . greenman , I think that we must amend the recommended upgrade procedure from 10.x to 11.x along the following lines: If the change buffer had been enabled in the past ( MDEV-27734 disabled it by default in 10.5.15, 10.6.7), and if DROP INDEX and CREATE INDEX had been executed such that buffered changes existed for the index that had been dropped, it would best to execute a shutdown with innodb_fast_shutdown=0 before upgrading, to prevent corruption of data. The upgrade procedure ignores the "change buffer bitmaps" and trusts that all records in the change buffer are valid. The slow shutdown procedure of 10.4 ( MDEV-20934 ; revised in MDEV-30009 for 10.5 and later) will discard bogus entries for pages to which there are exist buffered changes according to the change buffer bitmap. We might choose to revise the upgrade logic in 11.0 to work in a similar fashion. Until or unless that is done, I think that we must document this.

            My plan is to revise the upgrade logic in MDEV-32044.

            marko Marko Mäkelä added a comment - My plan is to revise the upgrade logic in MDEV-32044 .

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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