summaryrefslogtreecommitdiff
path: root/storage/maria/ma_recovery.c
diff options
context:
space:
mode:
authorunknown <guilhem@gbichot4.local>2007-12-30 23:16:18 +0100
committerunknown <guilhem@gbichot4.local>2007-12-30 23:16:18 +0100
commit345451ce7644253988ba75bb1644d851dd659147 (patch)
tree7262e5d48f0f97f07f7fd7f29ad057610e69f91a /storage/maria/ma_recovery.c
parentf21390874d1325bd829edc952501eb4381ed8732 (diff)
downloadmariadb-git-345451ce7644253988ba75bb1644d851dd659147.tar.gz
Maria: when logs have been manually deleted, last_logno and last_checkpoint_lsn
must be updated correctly. And Recovery should not assume that log 1 is available but just use first available log. mysql-test/r/maria-purge.result: result update mysql-test/t/maria-purge.test: like in other Maria tests (4294967296 is too big, causes warning) storage/maria/ma_loghandler.c: When log handler starts and discovers that logs are missing though control file says they should be there (they have been manually deleted), it decides to create a log with number last_logno+1. It needs to update control file with this new number, and also reset last_checkpoint_lsn to LSN_IMPOSSIBLE (last checkpoint went away when log was deleted). Fix for when translog_init() fails before allocating id_to_share (translog_destroy() tried to free NULL). storage/maria/ma_recovery.c: When logs have been manually deleted, translog_first_theoretical_lsn() always fails (it looks for log number 1). Recovery now uses translog_first_lsn_in_log() which just picks the first available log.
Diffstat (limited to 'storage/maria/ma_recovery.c')
-rw-r--r--storage/maria/ma_recovery.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c
index bc594127296..2f378912862 100644
--- a/storage/maria/ma_recovery.c
+++ b/storage/maria/ma_recovery.c
@@ -312,13 +312,8 @@ int maria_apply_log(LSN from_lsn, enum maria_apply_log_way apply,
{
if (last_checkpoint_lsn == LSN_IMPOSSIBLE)
{
- from_lsn= translog_first_theoretical_lsn();
- /*
- as far as we have not yet any checkpoint then the very first
- log file should be present.
- */
- if (unlikely((from_lsn == LSN_IMPOSSIBLE) ||
- (from_lsn == LSN_ERROR)))
+ from_lsn= translog_first_lsn_in_log();
+ if (unlikely(from_lsn == LSN_ERROR))
goto err;
}
else