maria:bb-11.2-oalter-MDEV-31185

Last commit made on 2023-07-20
Get this branch:
git clone -b bb-11.2-oalter-MDEV-31185 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-11.2-oalter-MDEV-31185
Repository:
lp:maria

Recent commits

f5ba653... by Andrei <email address hidden>

MDEV-31755 Replica's DML event deadlocks wit online alter table

The deadlock was caused by too strong MDL acquired by the start ALTER.

While MDL is shared by the start ALTER wait for its 2nd part
to allow concurrent DML:s to grab the lock.
The fixes uses wait_for_master reentrancy.

08403d8... by Nikita Malyavin

MDEV-31677 Assertion failed upon online ALTER with binlog_row_image=NOBLOB

Make binlog_prepare_row_images accept image type as an argument.

a31b2a5... by Nikita Malyavin

MDEV-31646 untie from max_allowed_packet and opt_binlog_rows_event_max_size

8c774b1... by Nikita Malyavin

MDEV-31646 preserve DMLs in case of online binlog fault

A 32-bit server build has a limitation of 2^32 bytes max for IO_CACHE.
This is quite a reachable value for a single transaction.

If DML reaches it, and the engine is not rollback-capable, then the last
record operation will be lost after ALTER TABLE.

To avoid it, report the error to the ALTER TABLE side and ignore it on the
DML side. Thus, a DML will not fail because of an online alter log failure.

ca64ddc... by Nikita Malyavin

MDEV-31646 Online alter applies binlog cache limit to cache writes

1. Make online disk writes unlimited, same as filesort does.
2. Make proper error handling -- in 32-bit build IO_CACHE capacity limit is
4GB, so it is quite possible to overfill there.
3. Event_log::write_cache complicated with event reparsing, and as it was
proven by QA, contains some mistakes. Rewrite introbuce a simpler and much
faster version, not featuring reparsing and therefore copying a whole
buffer at once. This also disables checksums and crypto.

As a result, online alter is untied of several binlog variables, which was
a second aim of this patch.

f34c741... by Nikita Malyavin

MDEV-31601 Some ALTER TABLEs fail ... with a wrong error message

Report correct algorithm in the error message.

bcb4975... by Nikita Malyavin

fix -Werror build

8b0101a... by Nikita Malyavin

follow-up MDEV-30430: fix versioning.rpl

Don't skip row_end if it wasn't set explicitly.

Also another segfault was caused by accessing rpl_write_set on slave during
the row update/delete.
The reason was a default_column_bitmaps() call, which also sets
rpl_write_set to NULL.
Previously, the related behavior was changed in commit afd3ee97ad, where
one such call was removed from Update_rows_log_event::do_exec_row, but the
same one was mistakenly left in Delete_rows_log_event. Now it's also
removed.

ff775c7... by Nikita Malyavin

fix main.mysql57_virtual, main.alter_table, innodb.alter_algorithm

The correct (best) algorithm is now chosen for ALGORITHM=DEFAULT
and alter_algorithm=DEFAULT

See also MDEV-30906

dc71364... by Nikita Malyavin

MDEV-30984 Online ALTER table is denied with non-informative error messages

Group all the checks in online_alter_check_supported().

There is now two groups of checks:
1. A technical availability of online, that is checked before open_tables,
and affects table_list->lock_type. It's supposed to be safe to make it
TL_READ even if COPY algorithm will fall back to not-online, since MDL is
SHARED_UPGRADEABLE anyway.
2. An 'online' availability for a COPY algorithm. It can be done as late as
just before the copy_data_between_tables call. The lock_type influence is
disclosed above, so the only other place it affects is
Alter_info::supports_lock, where `online` flag is only used to decide
whether to report the error at the inplace preparation stage. We'd want to
make that at the last resort, which is COPY preparation, if no algorithm is
chosen by the user. So it's event better now.

Some changes are required to the autoinc support detection, as the check
now happens after mysql_prepare_alter_table:
* alter_info->drop_list is empty
* instead, dropped columns are in tmp_set
* alter_info->create_list now has every field that's in the new table.
* the column definition's change.str will be nonnull whether the column
  remains in the new table (vs whether it was changed, as before).
  But it also has `field` field set.
* IF EXISTS doesn't have to be dealt anymore

This infers that the changes are now checked in more detail: a field's
definition shouldn't be changed, vs a field shouldn't be mentioned in
the CHANGE list, as it was before. This is reflected by the line 193 test.