| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
THD::set_binlog_flags_for_alter
is fixed to reset binlog_cache_mngr::gtid_flags3 in the error return
from write_bin_log() of write_bin_log_start_alter().
In other error cases gtid_flags3 has been reset correctly for any flag
value.
|
|
|
|
|
|
|
|
| |
Can not apply to slave worker thread because of temporary table pool that is shared
by the worker pool. A table can be opened by one thread and closed by another one, or
not at all.
Hence the slave worker thread has to get exempted from the assert.
|
|
|
|
| |
This is 2nd amendment commit that covers ALTER.
|
|
|
|
|
| |
Fixed the assert to restore pre-refactoring condition for
calling set_error() equivalent.
|
|
|
|
|
|
|
|
|
|
|
| |
Two mysql_alter_table execution branches missed to invoke
write_bin_log_start_alter and wait_for_master prior to process_master_state.
This is corrected to indentify the need and call them inside
process_master_state.
As these branches are fast thanks to the goto, so calling the two
functions at the receiving end of the goto is fine for performance
as well.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Assertion `rgi->gtid_ev_flags_extra & Gtid_log_event::FL_COMMIT_ALTER_E1'
that unexectedly met RA which still was harmless.
Instead of the assert arg extending RA execution gets cut short
into binlogging, so the original assert indeed must not see RA
coming it anymore.
|
|
|
|
|
|
|
|
| |
Former commit did not fix a use case of repeated CoR
(added to the test file now).
Also the former fixes are refactored to cover two use
cases with one code branch change (in implicit commit).
|
|
|
|
|
|
|
|
|
|
| |
Gtid_log_event::FL_COMMIT_ALTER_E1' failed in write_bin_log_start_alter
The assert was caused by lack of proper cleanup of the sequential
slave's execution context, enriched by MDEV-11675 2 phase loggable
ALTER.
Fixed to conduct an explicit cleanup in non-parallel execution.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CREATE-OR-REPLACE SEQUENCE is not logged with Gtid event DDL flag
which affects its slave parallel execution.
Unlike other DDL:s it can occur in concurrent execution with following transactions
which can lead to various errors, including asserts like
(mdl_request->type != MDL_INTENTION_EXCLUSIVE && mdl_request->type != MDL_EXCLUSIVE) || !(get_thd()->rgi_slave && get_thd()->rgi_slave->is_parallel_exec && lock->check_if_conflicting_replication_locks(this)
in MDL_context::acquire_lock.
Fixed to wrap internal statement level commit with save-
and-restore of TRANS_THD::m_unsafe_rollback_flags.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The assert was caused by unexpected by the slave applier
appearance of a temporary table that shadowed the regular one
for START ALTER phase.
This situation however is not really a replication fault and can
occur practically 'cos of misconfiguration that would made
the master and slave table types diverge in the temporary attribute
sense.
Also a warning is added to catch cleared errors of bin-logged queries
such as CREATE-or-REPLACE.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The poisoning comaplaint was caused by that
Rollback ALTER does not assign anything to its THD::lex::sql_command,
so it found the value from a previous event and 'cos it was not
ALTER, an inmpropriate branch of ctor was attempted to be
executed.
Fixed with forcing THD::lex::sql_command to denote ALTER indeed.
|
|
|
|
|
|
|
|
|
|
| |
Binlogging temporary switch-off gets now checked instead of
a permanent switch-off, 'cos the latter leads to an assert
in slave skip binlogging setups.
MDL assert was not fully ready to accept possibility of concurrent
erroring out MDL and later gtid ordered SA.
That got fixed.
|
| |
|
|
|
|
|
|
|
|
|
| |
which occures when the former ends with an error;
related to that - STOP SLAVE could find FTWRL affected SA state
which is already COMPLETED, in which case the driver thread should not wait;
corrects MDL cleanup (as rollback to savepoint) at the of ALTER's
record_gtid. The rollback may be missed by a SA, which it should be
run unconditionally.
|
| |
|
| |
|
|
|
|
|
|
| |
Fixed with not letting into SA binlog function as OPTIMIZE
tries entering inadvertently (having binlogging capabilities
temporarily turned off).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The test is guarded to not run on embedded.
In a case of STOP SLAVE that separates SA (has been done) and CA
(will not 'cos of the stop), see rpl_start_alter_restart_slave.test,
an assert got fired when a "inadvertently" commented-out statement has
been finally identified and restored for action.
It turns out the split alter executing parallel workers did not fully comply
with the stop slave's worker stop protocol and could be on loose
at time the SQL thread thought their have been docked.
It's fixed (and somewhat simplified) with leveraging a "direct"
execution mode (by CA).
SA and the shutdowner threads continue communicating as before
but the latter sets the direct mode ON for a possible "unlikely" CA.
SA may also find its shutdown status at time of changing the slave
gtid state.
In terms of use case the slave stop schema works as the following.
Let's consider sequences of execution (comma separated below) events
1. SA, STOP-SLAVE, *no-more-events*
interrupts SA after its change to the (gtid) slave state.
ALTER query will be re-run by a matching CA (if it will show up).
2. SA, STOP-SLAVE, CA
The same as above and CA indeed re-runs the whole ALTER
in "direct" mode.
3. *no* SA, STOP-SLAVE, CA
The same as above in the part of re-running CA (SA might have
been tried to reach its wait-for-master decision state in the past).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A FTWRL hang reported in the previous commit's message is resolved.
SA is notified by FTWRL that set it to a state
start_alter_state::COMPLETED && direct_commit_alter <- true
forcing a "graceful"
no-error rollback. After FTWRL has done CA gets scheduled and behaves
by general rules.
That is it's first to wait for UNLOCK TABLES.
That's what an included test demonstrates.
Note,
start_alter_state::COMPLETED
is also reachable by another source of benign error, e.g SA deadlock.
(Then SA retries and sets to the state after unsuccessfully running out
of all attempts).
To facilitate the above
A. `rpl_parallel_entry` is augmented with
`rli` member so FTWRL can find the SA states;
(I picked `rli` not `mi` for some future)
B. `Master_info` receives mem_root for itself, now merely for
allocating links of sa_info list associated with an `mi`.
Some insignificant cleanup is done around places involved in above.
|
|
|
|
|
|
|
|
| |
Todo: fix FTWRL. In case the parallel slave executes
SA, FTWRL, CA in this order, there's a hang, as CA can't
be scheduled (because of FTWRL) to unlock FTWRL to complete its
processing.
A patch is following up tomorrow to fix that.
|
|
|
|
|
|
|
|
|
|
|
| |
- Two, incl a trivial line break, unnessary hunks are removed;
- RAII Write_log_with_flags made simplified, the only its invocation
with other than FL_START_ALTER_E1 is always preceeded to set the SA's
seq_no (log_event_server.cc:1736);
- types of accessers and setters to flags_extra made consistent with
the object itself (uchar);
- corrected the transaction type to be false in
write_bin_log_with_if_exists() of write_bin_log_start_alter().
|
|
|
|
| |
Also `--help` doc lines for @@binlog_alter_two_phase have been improved.
|
|
|
|
|
| |
The options, esp 'instant' make some '--error' noise which
is mostly that this commit aims to handle.
|
|
|
|
| |
logics as well as optimize memory usage.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit implements two phase binloggable ALTER.
When a new
@@session.binlog_alter_two_phase = YES
ALTER query gets logged in two parts, the START ALTER and the COMMIT
or ROLLBACK ALTER. START Alter is written in binlog as soon as at its
handling necessary locks are acquired for the table. The timing is
such that any concurrent DML:s that update the same table are either
committed, thus logged into binary log having done work on the old
version of the table, or will be queued for execution on its new
version.
The "COMPLETE" COMMIT or ROLLBACK ALTER are written after the most of
ALTER work is done. When its result is positive COMMIT ALTER is
written, otherwise when there were errors since START ALTER, ROLLBACK
ALTER is written. Replication of two-phase binloggable ALTER is
cross-version safe. Specifically the OLD slave merely does not
recognized the start alter part, still memorizing its gtid.
Two phase logged ALTER is read from binlog by mysqlbinlog to produce
BINLOG 'string', where 'string' contains base64 encoded
Query_log_event containing either the start part of ALTER, or a
completion part. The Query details can be displayed with `-v` flag,
similarly to ROW format events. Notice, mysqlbinlog output containing
parts of two-phase binloggable ALTER is processable correctly only by
binlog_alter_two_phase server.
Thanks to all people involved into early discussion of the feature
including Kristian Nielsen, those who helped to design, implement and
test: Sergei Golubchik, Andrei Elkin, Sujatha Sivakumar, Brandon
Nesterenko, Alice Sherepa.
|
|
|
|
|
|
|
| |
and galera_3nodes.galera_ipv6_mariabackup_section
until their corresponding MDEV's are fixed.
They fail almost everywhere.
|
|\ |
|
| |\ |
|
| | |
| | |
| | |
| | |
| | | |
- Addressing the format issue in deferred_dblwr() and changed the
function comment.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
InnoDB fails to identify the deferred tablespace after recovery.
Problem is that InnoDB fails to rename the tablespace present
in recovered tablespace. Fix is that InnoDB should try to rename the
recovered tablespace when tablespace is being deferred
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This patch reverts the commit cab8f4b552d234c8642f87fae28ecb098392c381.
InnoDB fails to restore page0 from doublewrite buffer when the
tablespace is being deferred. In that case, InnoDB doesn't find
INIT_PAGE redo log record for page0 and it leads to failure.
InnoDB should recovery page0 from doublewrite buffer for the
deferred tablespace before applying the redo log records.
Added deferred_dblwr() to restore page0 of deferred tablespace
from doublewrite buffer
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
SQL statments could have table entries added in lexer. This entries
should not invalidate `next_global` member.
Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
|
| | |
| | |
| | |
| | | |
with optimizer trace
|
|\ \ \
| |/ / |
|
| | | |
|
|\ \ \
| |/ / |
|
| | | |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In commit 49e2c8f0a6fefdeac50925f758090d6bd099768d (MDEV-25743)
some more use of the printf-style format "%.*s" was added.
The length parameter is of type int, not size_t.
On 64-bit platforms that follow the LLP64 convention (such as
64-bit Microsoft Windows), sizeof(int)==4 and sizeof(size_t)==8.
Let us explicitly cast the lengths to the correct type in order
to avoid any trouble.
|
| | | |
|
| |\ \
| | |/ |
|
| | |\ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
THE VIEW DEFINITION SELECT
test case only
|
| | | |
| | | |
| | | |
| | | | |
now when SLES12.3 is gone, we can enforce it
|
| | | | |
|
| | | |\ |
|