Commit c2b840be authored by unknown's avatar unknown

Multigroup record write fixed.

Memory leak fixed.
Some other small cahnges.


mysql-test/include/wait_until_connected_again.inc:
  increased time for recovery (to be able use with --debug)
mysql-test/r/maria-recovery.result:
  Result fixed.
storage/maria/ma_loghandler.c:
  Multigroup record write fixed.
  Function for skipping to the next page while filling buffer with
    unlocked handler added.
  Removed possible memory leaks.
  More debug.
storage/maria/ma_recovery.c:
  Memory leak fixed.
parent 2a9d6a0c
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# You should have done --enable_reconnect first # You should have done --enable_reconnect first
--disable_result_log --disable_result_log
--disable_query_log --disable_query_log
let $counter= 500; let $counter= 5000;
let $mysql_errno= 1; let $mysql_errno= 1;
while ($mysql_errno) while ($mysql_errno)
{ {
......
...@@ -273,7 +273,7 @@ drop table t1; ...@@ -273,7 +273,7 @@ drop table t1;
* shut down mysqld, removed logs, restarted it * shut down mysqld, removed logs, restarted it
use mysqltest; use mysqltest;
set @@max_allowed_packet=32000000; set @@max_allowed_packet=32000000;
create table t1 (a int, b longtext) engine=maria; create table t1 (a int, b longtext) engine=maria table_checksum=1;
* copied t1 for feeding_recovery * copied t1 for feeding_recovery
insert into t1 values (1,"123456789012345678901234567890"),(2,"09876543210987654321"); insert into t1 values (1,"123456789012345678901234567890"),(2,"09876543210987654321");
flush table t1; flush table t1;
......
This diff is collapsed.
...@@ -2335,6 +2335,8 @@ static int run_redo_phase(LSN lsn, enum maria_apply_log_way apply) ...@@ -2335,6 +2335,8 @@ static int run_redo_phase(LSN lsn, enum maria_apply_log_way apply)
{ {
tprint(tracef, "Cannot read record's body: read %u of" tprint(tracef, "Cannot read record's body: read %u of"
" %u bytes\n", read_len, rec2.record_length); " %u bytes\n", read_len, rec2.record_length);
translog_destroy_scanner(&scanner2);
translog_free_record_header(&rec2);
goto err; goto err;
} }
} }
...@@ -2342,23 +2344,27 @@ static int run_redo_phase(LSN lsn, enum maria_apply_log_way apply) ...@@ -2342,23 +2344,27 @@ static int run_redo_phase(LSN lsn, enum maria_apply_log_way apply)
display_and_apply_record(log_desc2, &rec2)) display_and_apply_record(log_desc2, &rec2))
{ {
translog_destroy_scanner(&scanner2); translog_destroy_scanner(&scanner2);
translog_free_record_header(&rec2);
goto err; goto err;
} }
} }
translog_free_record_header(&rec2);
len= translog_read_next_record_header(&scanner2, &rec2); len= translog_read_next_record_header(&scanner2, &rec2);
if (len < 0) /* EOF or error */ if (len < 0) /* EOF or error */
{ {
tprint(tracef, "Cannot find record where it should be\n"); tprint(tracef, "Cannot find record where it should be\n");
translog_destroy_scanner(&scanner2);
translog_free_record_header(&rec2);
goto err; goto err;
} }
} }
while (rec2.lsn < rec.lsn); while (rec2.lsn < rec.lsn);
translog_free_record_header(&rec2);
/* group finished */ /* group finished */
all_active_trans[sid].group_start_lsn= LSN_IMPOSSIBLE; all_active_trans[sid].group_start_lsn= LSN_IMPOSSIBLE;
current_group_end_lsn= LSN_IMPOSSIBLE; /* for debugging */ current_group_end_lsn= LSN_IMPOSSIBLE; /* for debugging */
display_record_position(log_desc, &rec, 0); display_record_position(log_desc, &rec, 0);
translog_destroy_scanner(&scanner2); translog_destroy_scanner(&scanner2);
translog_free_record_header(&rec2);
} }
} }
if (apply == MARIA_LOG_APPLY && if (apply == MARIA_LOG_APPLY &&
...@@ -2377,6 +2383,7 @@ static int run_redo_phase(LSN lsn, enum maria_apply_log_way apply) ...@@ -2377,6 +2383,7 @@ static int run_redo_phase(LSN lsn, enum maria_apply_log_way apply)
all_active_trans[sid].group_start_lsn= rec.lsn; all_active_trans[sid].group_start_lsn= rec.lsn;
} }
} }
translog_free_record_header(&rec);
len= translog_read_next_record_header(&scanner, &rec); len= translog_read_next_record_header(&scanner, &rec);
if (len < 0) if (len < 0)
{ {
...@@ -2403,6 +2410,7 @@ static int run_redo_phase(LSN lsn, enum maria_apply_log_way apply) ...@@ -2403,6 +2410,7 @@ static int run_redo_phase(LSN lsn, enum maria_apply_log_way apply)
err: err:
translog_destroy_scanner(&scanner); translog_destroy_scanner(&scanner);
translog_free_record_header(&rec);
return 1; return 1;
} }
...@@ -2559,8 +2567,10 @@ static int run_undo_phase(uint uncommitted) ...@@ -2559,8 +2567,10 @@ static int run_undo_phase(uint uncommitted)
{ {
eprint(tracef, "Got error %d when executing undo %s", my_errno, eprint(tracef, "Got error %d when executing undo %s", my_errno,
log_desc->name); log_desc->name);
translog_free_record_header(&rec);
DBUG_RETURN(1); DBUG_RETURN(1);
} }
translog_free_record_header(&rec);
} }
if (trnman_rollback_trn(trn)) if (trnman_rollback_trn(trn))
......
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