Details

    Description

      Desc:- This will split Alter into 2 different commits. START ALTER and COMMIT
      /ROLLBACK ALTER , Start Alter will be written in binlog as soon as we get the
      locks for the table, alter will proceeds as usual and at the time of writing
      binlog if alter is successful we will write COMMIT Alter other wise ROLLBACK
      Alter.

      Implementation details are in develop list
      https://lists.launchpad.net/maria-developers/msg12067.html

      Attachments

        Issue Links

          Activity

            sachin.setiya.007 Sachin Setiya (Inactive) created issue -
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Field Original Value New Value
            Description Currently no true LOCK=NONE exists on slave.
            Alter table is first committed on master then it is replicated on slaves.
            The purpose of this task is to create a true LOCK=NONE
            Currently no true LOCK=NONE exists on slave.
            Alter table is first committed on master then it is replicated on slaves.
            The purpose of this task is to create a true LOCK=NONE

            Implementation Idea

            Master will write BEGIN_DDL_EVENT in binlog after it hits ha_prepare_inplace_alter_table.
            Then master will write QUERY_EVENT on binlog with actual alter query .
            On commit/rollback master will write COMMIT_DDL_EVENT/ROLLBACK_DDL_EVENT.

            On slave there will be pool of threads(configurable global variable), which
            will apply these DDLs. On reciving BEGIN_DDL_EVENT slave thread will pass the
            QUERY_EVENT to one of the worker thread. Worker thread will execute untill
            ha_inplace_alter_table. Actual commit_inplace_alter will be called by sql thread.
            If sql thread recieve some kind of rollback event , then it will somehow signal
            worker thread to stop executing alter. If none of the worker threads are avaliable
            then event will be enqueued, then If we recieved rollback event the we will simply
            discard event from queue, If we recieved commit event then SQL thread will syncrolysly
            process DDL event.
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Summary True LOCK=NONE on slave. True ALTER LOCK=NONE on slave.
            serg Sergei Golubchik made changes -
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.2 [ 14601 ]
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Labels gsoc18
            serg Sergei Golubchik made changes -
            Description Currently no true LOCK=NONE exists on slave.
            Alter table is first committed on master then it is replicated on slaves.
            The purpose of this task is to create a true LOCK=NONE

            Implementation Idea

            Master will write BEGIN_DDL_EVENT in binlog after it hits ha_prepare_inplace_alter_table.
            Then master will write QUERY_EVENT on binlog with actual alter query .
            On commit/rollback master will write COMMIT_DDL_EVENT/ROLLBACK_DDL_EVENT.

            On slave there will be pool of threads(configurable global variable), which
            will apply these DDLs. On reciving BEGIN_DDL_EVENT slave thread will pass the
            QUERY_EVENT to one of the worker thread. Worker thread will execute untill
            ha_inplace_alter_table. Actual commit_inplace_alter will be called by sql thread.
            If sql thread recieve some kind of rollback event , then it will somehow signal
            worker thread to stop executing alter. If none of the worker threads are avaliable
            then event will be enqueued, then If we recieved rollback event the we will simply
            discard event from queue, If we recieved commit event then SQL thread will syncrolysly
            process DDL event.
            Currently no true LOCK=NONE exists on slave.
            Alter table is first committed on master then it is replicated on slaves.
            The purpose of this task is to create a true LOCK=NONE

            *Implementation Idea*

            Master will write BEGIN_DDL_EVENT in binlog after it hits ha_prepare_inplace_alter_table.
            Then master will write QUERY_EVENT on binlog with actual alter query .
            On commit/rollback master will write COMMIT_DDL_EVENT/ROLLBACK_DDL_EVENT.

            On slave there will be pool of threads(configurable global variable), which
            will apply these DDLs. On reciving BEGIN_DDL_EVENT slave thread will pass the
            QUERY_EVENT to one of the worker thread. Worker thread will execute untill
            ha_inplace_alter_table. Actual commit_inplace_alter will be called by sql thread.
            If sql thread recieve some kind of rollback event , then it will somehow signal
            worker thread to stop executing alter. If none of the worker threads are avaliable
            then event will be enqueued, then If we recieved rollback event the we will simply
            discard event from queue, If we recieved commit event then SQL thread will syncrolysly
            process DDL event.
            serg Sergei Golubchik made changes -
            Summary True ALTER LOCK=NONE on slave. True ALTER LOCK=NONE on slave
            serg Sergei Golubchik made changes -
            Fix Version/s 10.3 [ 22126 ]
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Fix Version/s 10.4 [ 22408 ]
            julien.fritsch Julien Fritsch made changes -
            Epic Link PT-76 [ 68557 ]
            marko Marko Mäkelä added a comment - - edited

            A variation of the same idea is in MDEV-16223, for initiating ADD INDEX in the background.

            This solution would be preferred instead of that one (MDEV-16223).

            marko Marko Mäkelä added a comment - - edited A variation of the same idea is in MDEV-16223 , for initiating ADD INDEX in the background. This solution would be preferred instead of that one ( MDEV-16223 ).
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Elkin Andrei Elkin added a comment -

            Note MDEV-7974 is actually to provide an infrastructure to replicate the prepare and commit parts of an object not being limited to XA trx.
            Specifically crash-safety (recovery) property of the prepare part are common.

            Elkin Andrei Elkin added a comment - Note MDEV-7974 is actually to provide an infrastructure to replicate the prepare and commit parts of an object not being limited to XA trx. Specifically crash-safety (recovery) property of the prepare part are common.
            Elkin Andrei Elkin made changes -
            ratzpo Rasmus Johansson (Inactive) made changes -
            Labels gsoc18 gsoc18 gsoc19
            marko Marko Mäkelä made changes -
            Fix Version/s 10.5 [ 23123 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            NRE Projects RM_104_others RM_105_CANDIDATE RM_105_CANDIDATE
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.4 [ 22408 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Epic Link PT-76 [ 68557 ]

            Hi ralf.gebhardt@mariadb.com
            There is no update , because we there was no proposal for this project .

            sachin.setiya.007 Sachin Setiya (Inactive) added a comment - Hi ralf.gebhardt@mariadb.com There is no update , because we there was no proposal for this project .
            serg Sergei Golubchik made changes -
            ralf.gebhardt Ralf Gebhardt added a comment -

            sachin.setiya.007 I only asked because there are the gsoc labels. I guess that they can be removed, no?

            ralf.gebhardt Ralf Gebhardt added a comment - sachin.setiya.007 I only asked because there are the gsoc labels. I guess that they can be removed, no?
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Labels gsoc18 gsoc19
            serg Sergei Golubchik made changes -
            Labels gsoc18 gsoc19

            No-no, they should not be removed. They mean that the task was offered for GSoC 2018 and GSoC 2019.
            It's a historical fact, that it was, so the labels should be there, indicating that fact.

            serg Sergei Golubchik added a comment - No-no, they should not be removed. They mean that the task was offered for GSoC 2018 and GSoC 2019. It's a historical fact, that it was, so the labels should be there, indicating that fact.
            marko Marko Mäkelä made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            stephane@skysql.com VAROQUI Stephane made changes -
            stephane@skysql.com VAROQUI Stephane made changes -
            stephane@skysql.com VAROQUI Stephane made changes -
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Summary True ALTER LOCK=NONE on slave Lag Free Alter On Slave
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Description Currently no true LOCK=NONE exists on slave.
            Alter table is first committed on master then it is replicated on slaves.
            The purpose of this task is to create a true LOCK=NONE

            *Implementation Idea*

            Master will write BEGIN_DDL_EVENT in binlog after it hits ha_prepare_inplace_alter_table.
            Then master will write QUERY_EVENT on binlog with actual alter query .
            On commit/rollback master will write COMMIT_DDL_EVENT/ROLLBACK_DDL_EVENT.

            On slave there will be pool of threads(configurable global variable), which
            will apply these DDLs. On reciving BEGIN_DDL_EVENT slave thread will pass the
            QUERY_EVENT to one of the worker thread. Worker thread will execute untill
            ha_inplace_alter_table. Actual commit_inplace_alter will be called by sql thread.
            If sql thread recieve some kind of rollback event , then it will somehow signal
            worker thread to stop executing alter. If none of the worker threads are avaliable
            then event will be enqueued, then If we recieved rollback event the we will simply
            discard event from queue, If we recieved commit event then SQL thread will syncrolysly
            process DDL event.
            Desc:- This will split Alter into 2 different commits. START ALTER and COMMIT
            /ROLLBACK ALTER , Start Alter will be written in binlog as soon as we get the
            locks for the table, alter will proceeds as usual and at the time of writing
            binlog if alter is successful we will write COMMIT Alter other wise ROLLBACK
            Alter.

            Implementation details are in develop list
            https://lists.launchpad.net/maria-developers/msg12067.html

            So currently I am working on issue , when we write START ALTER gtid_slave_pos table is not updated, Which is normal because thread is hanging/waiting in
            mysql_alter_table , So we cant call do_update_pos (we are still inside QUery_log_event::do_apply_event)
            So I am thinking of calling ::stmt_done inside mysql_alter_table(after writing START ALTER into binlog), I have stored the log_pos in thd (debatable )
            So the issue which I am facing is , we call lock_tables in mysql_alter_table (normal table , which we want to change), and after that writing START ALTER into binlog we will write into gtid_slave_pos , but when ::stmt_done calls lock_tables its assert is failing because thd->lock is not NULL

            So I am thinking of something like lock gtid_slave_pos when I acquire lock for normal table and release the lock when it is updated , NOt sure if it is possible

            sachin.setiya.007 Sachin Setiya (Inactive) added a comment - So currently I am working on issue , when we write START ALTER gtid_slave_pos table is not updated, Which is normal because thread is hanging/waiting in mysql_alter_table , So we cant call do_update_pos (we are still inside QUery_log_event::do_apply_event) So I am thinking of calling ::stmt_done inside mysql_alter_table(after writing START ALTER into binlog), I have stored the log_pos in thd (debatable ) So the issue which I am facing is , we call lock_tables in mysql_alter_table (normal table , which we want to change), and after that writing START ALTER into binlog we will write into gtid_slave_pos , but when ::stmt_done calls lock_tables its assert is failing because thd->lock is not NULL So I am thinking of something like lock gtid_slave_pos when I acquire lock for normal table and release the lock when it is updated , NOt sure if it is possible
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Assignee Sachin Setiya [ sachin.setiya.007 ] Andrei Elkin [ elkin ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            Elkin Andrei Elkin made changes -
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.5 [ 23123 ]
            Elkin Andrei Elkin made changes -
            Priority Critical [ 2 ] Major [ 3 ]
            Elkin Andrei Elkin made changes -
            Assignee Andrei Elkin [ elkin ] Sachin Setiya [ sachin.setiya.007 ]
            Elkin Andrei Elkin made changes -
            julien.fritsch Julien Fritsch made changes -
            Comment [ A comment with security level 'Developers' was removed. ]
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            Elkin Andrei Elkin made changes -
            Status Stalled [ 10000 ] Open [ 1 ]
            Elkin Andrei Elkin made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.6 [ 24028 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.7 [ 24805 ]
            serg Sergei Golubchik made changes -
            Priority Critical [ 2 ] Major [ 3 ]
            serg Sergei Golubchik made changes -
            Assignee Sachin Setiya [ sachin.setiya.007 ] Andrei Elkin [ elkin ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.8 [ 26121 ]
            Fix Version/s 10.7 [ 24805 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            Elkin Andrei Elkin made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 79004 ] MariaDB v4 [ 131819 ]
            Elkin Andrei Elkin added a comment -

            The about to be created preview branch misses out FTWRL fixes that we've discussed today
            and it's just too late night for me to complete with them into the branch.
            This will be done tomorrow.

            Elkin Andrei Elkin added a comment - The about to be created preview branch misses out FTWRL fixes that we've discussed today and it's just too late night for me to complete with them into the branch. This will be done tomorrow.
            Elkin Andrei Elkin made changes -
            Assignee Andrei Elkin [ elkin ] Brandon Nesterenko [ JIRAUSER48702 ]
            Status In Progress [ 3 ] In Review [ 10002 ]

            I approve the current patch c592a5e. Note that it will still need the FTWRL fixes.

            bnestere Brandon Nesterenko added a comment - I approve the current patch c592a5e . Note that it will still need the FTWRL fixes.
            Elkin Andrei Elkin made changes -
            Assignee Brandon Nesterenko [ JIRAUSER48702 ] Andrei Elkin [ elkin ]
            Elkin Andrei Elkin added a comment -

            Approving on the behalf of bnestere.

            Elkin Andrei Elkin added a comment - Approving on the behalf of bnestere .
            Elkin Andrei Elkin made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            Elkin Andrei Elkin made changes -
            Status Stalled [ 10000 ] In Testing [ 10301 ]
            Elkin Andrei Elkin made changes -
            Assignee Andrei Elkin [ elkin ] Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Alice Sherepa [ alice ]

            Confirmed Andrei's approval on my behalf, I had to step away momentarily

            bnestere Brandon Nesterenko added a comment - Confirmed Andrei's approval on my behalf, I had to step away momentarily
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            ramesh Ramesh Sivaraman made changes -
            jplindst Jan Lindström (Inactive) made changes -
            serg Sergei Golubchik made changes -
            ramesh Ramesh Sivaraman made changes -
            alice Alice Sherepa made changes -
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            alice Alice Sherepa made changes -
            Assignee Alice Sherepa [ alice ] Andrei Elkin [ elkin ]
            alice Alice Sherepa added a comment -

            I think it's fine to push the feature into 10.8.

            alice Alice Sherepa added a comment - I think it's fine to push the feature into 10.8.
            serg Sergei Golubchik made changes -
            Fix Version/s 10.8.1 [ 26815 ]
            Fix Version/s 10.8 [ 26121 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Labels gsoc18 gsoc19 Preview_10.8 gsoc18 gsoc19
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            stephane@skysql.com VAROQUI Stephane made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            ParadoxV5 Jimmy Hú made changes -
            bnestere Brandon Nesterenko made changes -
            ParadoxV5 Jimmy Hú made changes -
            ParadoxV5 Jimmy Hú made changes -
            ParadoxV5 Jimmy Hú made changes -

            People

              Elkin Andrei Elkin
              sachin.setiya.007 Sachin Setiya (Inactive)
              Votes:
              4 Vote for this issue
              Watchers:
              20 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.