Commit 866cdc0a authored by Michael Widenius's avatar Michael Widenius

Fixed lp:902654 "MariaDB consistently crashes in collect_tables on Aria checkpoint execution"

This happend when you have more than 1024 open Aria tables during checkpoint.


mysql-test/mysql-test-run.pl:
  Fixed that variable names are consistent between external and internal server.
mysql-test/suite/maria/suite.pm:
  Test for aria-block-size instead of 'aria' as 'aria' is not set for embedded server.
  This should be ok for aria tests, as aria is never disabled for these.
storage/maria/ma_checkpoint.c:
  Fixed bug when there are more than 1024 open Aria tables during checkpoint.
parent 2fef5b52
...@@ -1758,8 +1758,11 @@ sub collect_mysqld_features { ...@@ -1758,8 +1758,11 @@ sub collect_mysqld_features {
# Put variables into hash # Put variables into hash
if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ ) if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ )
{ {
# print "$1=\"$2\"\n"; my $name= $1;
$mysqld_variables{$1}= $2; my $value=$2;
$name =~ s/_/-/g;
# print "$name=\"$value\"\n";
$mysqld_variables{$name}= $value;
} }
else else
{ {
...@@ -1813,8 +1816,11 @@ sub collect_mysqld_features_from_running_server () ...@@ -1813,8 +1816,11 @@ sub collect_mysqld_features_from_running_server ()
# Put variables into hash # Put variables into hash
if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ ) if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ )
{ {
# print "$1=\"$2\"\n"; my $name= $1;
$mysqld_variables{$1}= $2; my $value=$2;
$name =~ s/_/-/g;
# print "$name=\"$value\"\n";
$mysqld_variables{$name}= $value;
} }
} }
......
...@@ -2,7 +2,7 @@ package My::Suite::Maria; ...@@ -2,7 +2,7 @@ package My::Suite::Maria;
@ISA = qw(My::Suite); @ISA = qw(My::Suite);
return "Need Aria engine" unless $::mysqld_variables{'aria'} eq "ON"; return "Need Aria engine" unless $::mysqld_variables{'aria-block-size'} > 0;
bless { }; bless { };
...@@ -908,6 +908,9 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon) ...@@ -908,6 +908,9 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon)
*/ */
} }
translog_unlock(); translog_unlock();
if (state_copy == state_copies)
break; /* Nothing to do */
/** /**
We are going to flush these states. We are going to flush these states.
Before, all records describing how to undo such state must be Before, all records describing how to undo such state must be
...@@ -932,13 +935,13 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon) ...@@ -932,13 +935,13 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon)
if (translog_flush(state_copies_horizon)) if (translog_flush(state_copies_horizon))
goto err; goto err;
/* now we have cached states and they are WAL-safe*/ /* now we have cached states and they are WAL-safe*/
state_copies_end= state_copy; state_copies_end= state_copy-1;
state_copy= state_copies; state_copy= state_copies;
} }
/* locate our state among these cached ones */ /* locate our state among these cached ones */
for ( ; state_copy->index != i; state_copy++) for ( ; state_copy->index != i; state_copy++)
DBUG_ASSERT(state_copy < state_copies_end); DBUG_ASSERT(state_copy <= state_copies_end);
/* OS file descriptors are ints which we stored in 4 bytes */ /* OS file descriptors are ints which we stored in 4 bytes */
compile_time_assert(sizeof(int) <= 4); compile_time_assert(sizeof(int) <= 4);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment