diff options
author | unknown <guilhem@gbichot4.local> | 2007-11-14 12:51:16 +0100 |
---|---|---|
committer | unknown <guilhem@gbichot4.local> | 2007-11-14 12:51:16 +0100 |
commit | 1bc5e3b971e4f9c11df8e1be83614188c242eefc (patch) | |
tree | 85dad8c1d1718b2a2eb38776e36b3f4653c076c7 /storage/maria/ma_recovery.h | |
parent | ac590d9ce994cda6c6f000b1957ef059297245d5 (diff) | |
download | mariadb-git-1bc5e3b971e4f9c11df8e1be83614188c242eefc.tar.gz |
WL#3072 - Maria recovery
maria_read_log used to always print a warning message at startup
to say it is unsafe if ALTER TABLE was used. Now it prints it only
if the log does show the problem (=ALTER TABLE or CREATE SELECT, which
both disable logging of REDO_INSERT*).
For that, when ha_maria::external_lock() disables transactionality
it writes a LOGREC_INCOMPLETE_LOG to the log, which "maria_read_log -a"
picks up to write a warning.
REPAIR TABLE also disables those REDO_INSERT* but as maria_read_log
executes LOGREC_REDO_REPAIR no warning is needed.
storage/maria/ha_maria.cc:
as we now log a record when disabling transactionility, we need the
TRN to be set up first
storage/maria/ma_blockrec.c:
comment
storage/maria/ma_loghandler.c:
new type of log record
storage/maria/ma_loghandler.h:
new type of log record
storage/maria/ma_recovery.c:
* maria_apply_log() now returns a count of warnings. What currently
produces warnings is:
- skipping applying UNDOs though there are some (=> inconsistent table)
- replaying log (in maria_read_log) though the log contains some
ALTER TABLE or CREATE SELECT (log misses REDO_INSERT* for those
and is so incomplete).
Count of warnings affects the final message of maria_read_log and
recovery (though in recovery none of the two conditions above should
happen).
* maria_read_log used to always print a warning message at startup
to say it is unsafe if ALTER TABLE was used. Now it prints it only
if the log does show the problem, i.e. ALTER TABLE or CREATE SELECT
was used (both disable logging of REDO_INSERT* as those records are
not needed for recovery; those missing records in turn make
recreation-from-scratch, via maria_read_log, impossible). For that,
when ha_maria::external_lock() disables transactionality,
_ma_tmp_disable_logging_for_table() writes a LOGREC_INCOMPLETE_LOG to
the log, which maria_apply_log() picks up to write a warning.
storage/maria/ma_recovery.h:
maria_apply_log() returns a count of warnings
storage/maria/maria_def.h:
_ma_tmp_disable_logging_for_table() grows so becomes a function
storage/maria/maria_read_log.c:
maria_apply_log can now return a count of warnings, to temper the
"SUCCESS" message printed in the end by maria_read_log.
Advise users to make a backup first.
Diffstat (limited to 'storage/maria/ma_recovery.h')
-rw-r--r-- | storage/maria/ma_recovery.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/maria/ma_recovery.h b/storage/maria/ma_recovery.h index ea39fa3e98c..f44891a36df 100644 --- a/storage/maria/ma_recovery.h +++ b/storage/maria/ma_recovery.h @@ -30,5 +30,5 @@ int maria_recover(void); int maria_apply_log(LSN lsn, enum maria_apply_log_way apply, FILE *trace_file, my_bool execute_undo_phase, my_bool skip_DDLs, - my_bool take_checkpoints); + my_bool take_checkpoints, uint *warnings_count); C_MODE_END |