[MDEV-11675] Lag Free Alter On Slave Created: 2016-12-28  Updated: 2023-12-18  Resolved: 2022-01-31

Status: Closed
Project: MariaDB Server
Component/s: Replication
Fix Version/s: 10.8.1

Type: Task Priority: Critical
Reporter: Sachin Setiya (Inactive) Assignee: Andrei Elkin
Resolution: Fixed Votes: 4
Labels: Preview_10.8, gsoc18, gsoc19

Issue Links:
Blocks
is blocked by MDEV-27528 Cluster nodes become unstable when a ... Closed
PartOf
is part of MDEV-27373 Q1 2022 release merge Closed
Problem/Incident
causes MDEV-33057 alter table form s3 to different engi... Open
Relates
relates to MDEV-742 LP:803649 - Xa recovery failed on cli... Closed
relates to MDEV-16223 Background ADD INDEX Closed
relates to MDEV-16281 Implement parallel CREATE INDEX, ALTE... Open
relates to MDEV-16329 Engine-independent online ALTER TABLE Closed
relates to MDEV-17567 Atomic DDL Closed
relates to MDEV-21742 Add recovery to MDEV-11675 and handle... Closed
relates to MDEV-27528 Cluster nodes become unstable when a ... Closed
relates to MDEV-7502 Automatic provisioning of slave Open
relates to MDEV-22777 Assertion `thd->rgi_slave' failed in ... Closed
relates to MDEV-22985 Assertion `!(thd->rgi_slave && thd->... Closed
relates to MDEV-27349 ASAN use-after-poison in Query_log_e... Closed
relates to MDEV-27628 Lag free ALTER statement breaks repli... Closed

 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



 Comments   
Comment by Marko Mäkelä [ 2018-10-25 ]

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).

Comment by Andrei Elkin [ 2019-02-04 ]

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.

Comment by Sachin Setiya (Inactive) [ 2019-08-09 ]

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

Comment by Ralf Gebhardt [ 2019-08-09 ]

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

Comment by Sergei Golubchik [ 2019-08-12 ]

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.

Comment by Sachin Setiya (Inactive) [ 2020-02-06 ]

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

Comment by Andrei Elkin [ 2021-12-13 ]

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.

Comment by Brandon Nesterenko [ 2021-12-14 ]

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

Comment by Andrei Elkin [ 2021-12-14 ]

Approving on the behalf of bnestere.

Comment by Brandon Nesterenko [ 2021-12-14 ]

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

Comment by Alice Sherepa [ 2022-01-27 ]

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

Generated at Thu Feb 08 07:51:48 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.