Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.2(EOL)
-
None
Description
Engine-independent online alter table (MDEV-16329) brings an extra data-modification stage to the COPY alter table – online log changes application.
For the normal copy stage, the row-by-row logging was disabled in MDEV-11415. This can be extended to the online log application.
Attachments
Issue Links
- is caused by
-
MDEV-16329 Engine-independent online ALTER TABLE
-
- Closed
-
- relates to
-
MDEV-33087 ALTER TABLE...ALGORITHM=COPY should build indexes more efficiently
-
- Closed
-
-
MDEV-11415 Remove excessive undo logging during ALTER TABLE…ALGORITHM=COPY
-
- Closed
-
Row-by-row logging is enabled for CREATE...SELECT in select_create::prepare.
But it's turned off for IGNORE and REPLACE
table->file->extra(HA_EXTRA_BEGIN_ALTER_COPY);
git show c411393a844becf91a560ac8e53ab04cb4fb9219
commit c411393a844becf91a560ac8e53ab04cb4fb9219
Author: Marko Mäkelä <marko.makela@mariadb.com>
Date: Thu Jan 28 15:26:53 2021 +0200
MDEV-24715 Assertion !node->table->skip_alter_undo in CREATE...REPLACE SELECT
In commit 3cef4f8f0fc88ae5bfae4603d8d600ec84cc70a9 (MDEV-515)
we inadvertently broke CREATE TABLE...REPLACE SELECT statements
by wrongly disabling row-level undo logging.
select_create::prepare(): Only invoke extra(HA_EXTRA_BEGIN_ALTER_COPY)
if no special treatment of duplicates is needed.
REPLACE operation has a special treatment in comparison with UPDATE and DELETE – it needs row-grained logging to carefully rollback the failed row insertion inside the statement. In comparison, this would lead to a statement failure in INSERT/UPDATE/DELETE/CREATE...SELECT/ALTER TABLE.
Online ALTER does not allow the replace behavior for the online log application (neither it does for the copy stage as of now), so it should be safe