Skip to content

Commit c52e62a

Browse files
committed
Improve logging of Aria redo's and undo's
- Remove extra ',' and quotes - Remove extra newline and remove double newlines - Added options --lsn-redo-end and --lsn-undo-end to aria_read_log - Allow one to give the aria_read_log lsn aruments as number,0xhexnumber, the same way as lsn's are written by aria_read_log - Don't write full pages to redo log with EXTRA_DEBUG as this takes up a lot of disk and there has not been a need for this extra loggging for a long time. Instead one should use EXTRA_ARIA_DEBUG instead.
1 parent 514533e commit c52e62a

File tree

6 files changed

+212
-85
lines changed

6 files changed

+212
-85
lines changed

storage/maria/ma_blockrec.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3682,6 +3682,15 @@ my_bool _ma_write_abort_block_record(MARIA_HA *info)
36823682
_ma_bitmap_unlock(share);
36833683
if (share->now_transactional)
36843684
{
3685+
/*
3686+
Write clr to mark end of aborted row insert.
3687+
The above delete_head_or_tail() calls will only log redo, not undo.
3688+
The undo just before the row insert is stored in row->orig_undo_lsn.
3689+
3690+
When applying undo's, we can skip all undo records between current
3691+
lsn and row->orig_undo_lsn as logically things are as before the
3692+
attempted insert.
3693+
*/
36853694
if (_ma_write_clr(info, info->cur_row.orig_undo_lsn,
36863695
LOGREC_UNDO_ROW_INSERT,
36873696
share->calc_checksum != 0,

storage/maria/ma_check.c

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,8 @@ int maria_chk_key(HA_CHECK *param, register MARIA_HA *info)
590590
{
591591
_ma_check_print_error(param,"Found %s keys of %s",llstr(keys,buff),
592592
llstr(share->state.state.records,buff2));
593-
if (!(param->testflag & T_INFO))
594-
DBUG_RETURN(-1);
593+
if (!(param->testflag & (T_INFO | T_EXTEND)))
594+
DBUG_RETURN(-1);
595595
result= -1;
596596
continue;
597597
}
@@ -1119,8 +1119,8 @@ static uint isam_key_length(MARIA_HA *info, register MARIA_KEYDEF *keyinfo)
11191119

11201120

11211121

1122-
static void record_pos_to_txt(MARIA_HA *info, my_off_t recpos,
1123-
char *buff)
1122+
static char * record_pos_to_txt(MARIA_HA *info, my_off_t recpos,
1123+
char *buff)
11241124
{
11251125
if (info->s->data_file_type != BLOCK_RECORD)
11261126
llstr(recpos, buff);
@@ -1132,6 +1132,7 @@ static void record_pos_to_txt(MARIA_HA *info, my_off_t recpos,
11321132
*(end++)= ':';
11331133
longlong10_to_str(row, end, 10);
11341134
}
1135+
return buff;
11351136
}
11361137

11371138

@@ -1195,11 +1196,14 @@ static int check_keys_in_record(HA_CHECK *param, MARIA_HA *info, int extend,
11951196
_ma_search(info, &key, SEARCH_SAME, share->state.key_root[keynr]);
11961197
if (search_result)
11971198
{
1198-
record_pos_to_txt(info, start_recpos, llbuff);
11991199
_ma_check_print_error(param,
12001200
"Record at: %14s "
12011201
"Can't find key for index: %2d",
1202-
llbuff, keynr+1);
1202+
record_pos_to_txt(info, start_recpos,
1203+
llbuff),
1204+
keynr+1);
1205+
if (param->testflag & T_VERBOSE)
1206+
_ma_print_key(stdout, &key);
12031207
if (param->err_count++ > MAXERR || !(param->testflag & T_VERBOSE))
12041208
return -1;
12051209
}
@@ -2731,8 +2735,11 @@ int maria_repair(HA_CHECK *param, register MARIA_HA *info,
27312735
"Duplicate key %2d for record at %10s against "
27322736
"new record at %10s",
27332737
info->errkey+1,
2734-
llstr(sort_param.current_filepos, llbuff),
2735-
llstr(info->dup_key_pos,llbuff2));
2738+
record_pos_to_txt(info,
2739+
sort_param.current_filepos,
2740+
llbuff),
2741+
record_pos_to_txt(info,
2742+
info->dup_key_pos, llbuff2));
27362743
if (param->testflag & T_VERBOSE)
27372744
{
27382745
MARIA_KEY tmp_key;
@@ -4895,10 +4902,12 @@ static int sort_get_next_record(MARIA_SORT_PARAM *sort_param)
48954902
{
48964903
if (param->testflag & T_VERBOSE)
48974904
{
4898-
record_pos_to_txt(info, info->cur_row.lastpos, llbuff);
48994905
_ma_check_print_info(param,
49004906
"Found record with wrong checksum at %s",
4901-
llbuff);
4907+
record_pos_to_txt(info,
4908+
info->cur_row.lastpos,
4909+
llbuff));
4910+
49024911
}
49034912
continue;
49044913
}
@@ -5517,6 +5526,7 @@ static int sort_key_write(MARIA_SORT_PARAM *sort_param, const uchar *a)
55175526
char llbuff[22],llbuff2[22];
55185527
MARIA_SORT_INFO *sort_info=sort_param->sort_info;
55195528
HA_CHECK *param= sort_info->param;
5529+
MARIA_HA *info= sort_info->info;
55205530
int cmp;
55215531

55225532
if (sort_info->key_block->inited)
@@ -5559,11 +5569,14 @@ static int sort_key_write(MARIA_SORT_PARAM *sort_param, const uchar *a)
55595569
"Duplicate key %2u for record at %10s against "
55605570
"record at %10s",
55615571
sort_param->key + 1,
5562-
llstr(sort_info->info->cur_row.lastpos, llbuff),
5563-
llstr(get_record_for_key(sort_param->keyinfo,
5564-
sort_info->key_block->
5565-
lastkey),
5566-
llbuff2));
5572+
record_pos_to_txt(info,
5573+
sort_info->info->cur_row.lastpos,
5574+
llbuff),
5575+
record_pos_to_txt(info,
5576+
get_record_for_key(sort_param->
5577+
keyinfo,
5578+
sort_info->key_block->lastkey),
5579+
llbuff2));
55675580
param->testflag|=T_RETRY_WITHOUT_QUICK;
55685581
if (sort_info->param->testflag & T_VERBOSE)
55695582
_ma_print_keydata(stdout,sort_param->seg, a, USE_WHOLE_KEY);

0 commit comments

Comments
 (0)