@@ -153,8 +153,10 @@ int ma_checkpoint_execute(CHECKPOINT_LEVEL level, my_bool no_wait)
153
153
static int really_execute_checkpoint (void )
154
154
{
155
155
uint i , error = 0 ;
156
+ int error_errno = 0 ;
156
157
/** @brief checkpoint_start_log_horizon will be stored there */
157
158
char * ptr ;
159
+ const char * error_place = 0 ;
158
160
LEX_STRING record_pieces [4 ]; /**< only malloc-ed pieces */
159
161
LSN min_page_rec_lsn , min_trn_rec_lsn , min_first_undo_lsn ;
160
162
TRANSLOG_ADDRESS checkpoint_start_log_horizon ;
@@ -191,13 +193,19 @@ static int really_execute_checkpoint(void)
191
193
& record_pieces [1 ],
192
194
& min_trn_rec_lsn ,
193
195
& min_first_undo_lsn )))
196
+ {
197
+ error_place = "trnman_collect_transaction" ;
194
198
goto err ;
199
+ }
195
200
196
201
197
202
/* STEP 3: fetch information about table files */
198
203
if (unlikely (collect_tables (& record_pieces [2 ],
199
204
checkpoint_start_log_horizon )))
205
+ {
206
+ error_place = "collect_tables" ;
200
207
goto err ;
208
+ }
201
209
202
210
203
211
/* STEP 4: fetch information about dirty pages */
@@ -211,7 +219,10 @@ static int really_execute_checkpoint(void)
211
219
if (unlikely (pagecache_collect_changed_blocks_with_lsn (maria_pagecache ,
212
220
& record_pieces [3 ],
213
221
& min_page_rec_lsn )))
222
+ {
223
+ error_place = "collect_pages" ;
214
224
goto err ;
225
+ }
215
226
216
227
217
228
/* LAST STEP: now write the checkpoint log record */
@@ -240,7 +251,10 @@ static int really_execute_checkpoint(void)
240
251
sizeof (log_array )/sizeof (log_array [0 ]),
241
252
log_array , NULL , NULL ) ||
242
253
translog_flush (lsn )))
254
+ {
255
+ error_place = "translog_write_record" ;
243
256
goto err ;
257
+ }
244
258
translog_lock ();
245
259
/*
246
260
This cannot be done as a inwrite_rec_hook of LOGREC_CHECKPOINT, because
@@ -251,6 +265,8 @@ static int really_execute_checkpoint(void)
251
265
max_trid_in_control_file ,
252
266
recovery_failures )))
253
267
{
268
+ error_place = "ma_control_file_write" ;
269
+ error_errno = my_errno ;
254
270
translog_unlock ();
255
271
goto err ;
256
272
}
@@ -287,7 +303,9 @@ static int really_execute_checkpoint(void)
287
303
288
304
err :
289
305
error = 1 ;
290
- ma_message_no_user (0 , "checkpoint failed" );
306
+ my_printf_error (HA_ERR_GENERIC , "Aria engine: checkpoint failed at %s with "
307
+ "error %d" , MYF (ME_ERROR_LOG ),
308
+ error_place , (error_errno ? error_errno : my_errno ));
291
309
/* we were possibly not able to determine what pages to flush */
292
310
pages_to_flush_before_next_checkpoint = 0 ;
293
311
0 commit comments