summaryrefslogtreecommitdiff
path: root/storage/maria
diff options
context:
space:
mode:
Diffstat (limited to 'storage/maria')
-rw-r--r--storage/maria/ha_maria.cc3
-rw-r--r--storage/maria/ma_init.c2
-rw-r--r--storage/maria/ma_recovery.c8
-rwxr-xr-xstorage/maria/unittest/ma_test_recovery.pl23
4 files changed, 30 insertions, 6 deletions
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 6fe00e52081..04b684ed132 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -3662,7 +3662,8 @@ static int ha_maria_init(void *p)
TRANSLOG_DEFAULT_FLAGS, 0) ||
maria_recovery_from_log() ||
((force_start_after_recovery_failures != 0 ||
- maria_recovery_changed_data) && mark_recovery_success()) ||
+ maria_recovery_changed_data || recovery_failures) &&
+ mark_recovery_success()) ||
ma_checkpoint_init(checkpoint_interval);
maria_multi_threaded= maria_in_ha_maria= TRUE;
maria_create_trn_hook= maria_create_trn_for_mysql;
diff --git a/storage/maria/ma_init.c b/storage/maria/ma_init.c
index 7157f9e4c98..7244d95b184 100644
--- a/storage/maria/ma_init.c
+++ b/storage/maria/ma_init.c
@@ -81,6 +81,7 @@ int maria_init(void)
void maria_end(void)
{
+ DBUG_ENTER("maria_end");
if (maria_inited)
{
TrID trid;
@@ -111,6 +112,7 @@ void maria_end(void)
mysql_mutex_destroy(&THR_LOCK_maria);
my_hash_free(&maria_stored_state);
}
+ DBUG_VOID_RETURN;
}
/**
diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c
index dbb8d46bdbc..ae52b9191de 100644
--- a/storage/maria/ma_recovery.c
+++ b/storage/maria/ma_recovery.c
@@ -473,7 +473,13 @@ int maria_apply_log(LSN from_lsn, LSN end_lsn,
fflush(stderr);
}
- set_if_bigger(max_trid_in_control_file, max_long_trid);
+ if (max_long_trid > max_trid_in_control_file)
+ {
+ if (ma_control_file_write_and_force(last_checkpoint_lsn, last_logno,
+ max_long_trid, recovery_failures))
+ goto err;
+ }
+
if (take_checkpoints && checkpoint_useful)
{
/* No dirty pages, all tables are closed, no active transactions, save: */
diff --git a/storage/maria/unittest/ma_test_recovery.pl b/storage/maria/unittest/ma_test_recovery.pl
index f081f2741e2..fdc7ee689b2 100755
--- a/storage/maria/unittest/ma_test_recovery.pl
+++ b/storage/maria/unittest/ma_test_recovery.pl
@@ -298,11 +298,11 @@ sub check_table_is_same
$com= "$maria_exe_path/aria_chk$suffix -dvv $table | grep -v \"Creation time:\" | grep -v \"recover time:\"";
$com.= "| grep -v \"file length\" | grep -v \"LSNs:\" | grep -v \"UUID:\" > $tmp/aria_chk_message.txt 2>&1";
- $res= `$com`;
+ $res= my_exec2($com);
print MY_LOG $res;
- $res= `$maria_exe_path/aria_chk$suffix -ss -e --read-only $table`;
+ $res= my_exec2("$maria_exe_path/aria_chk$suffix -ss -e --read-only $table");
print MY_LOG $res;
- $checksum2= `$maria_exe_path/aria_chk$suffix -dss $table`;
+ $checksum2= my_exec2("$maria_exe_path/aria_chk$suffix -dss $table");
if ("$checksum" ne "$checksum2")
{
print MY_LOG "checksum differs for $table before and after recovery\n";
@@ -311,7 +311,7 @@ sub check_table_is_same
$com= "diff $tmp/aria_chk_message.good.txt $tmp/aria_chk_message.txt ";
$com.= "> $tmp/aria_chk_diff.txt || true";
- $res= `$com`;
+ $res= my_exec2($com);
print MY_LOG $res;
if (-s "$tmp/aria_chk_diff.txt")
@@ -455,6 +455,21 @@ sub my_exec
return $res;
}
+sub my_exec2
+{
+ my($command)= @_;
+ my $res, $err;
+ $res= `$command`;
+ if ($? != 0 && $opt_abort_on_error)
+ {
+ $err= $?;
+ print "$command\n";
+ print "failed with error: $err\n";
+ exit(1);
+ }
+ return $res;
+}
+
####
#### usage