From 63ff9877a588477e646afda9a0b30befc5e02866 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 19:08:25 +0200 Subject: WL#3072 Maria recovery Misc changes: - fix for benign Valgrind error, compiler warnings - fix for a segfault in execution of maria_delete_all_rows() and one when taking multiple checkpoints - fix for too paranoid assertion - adding ability to take checkpoints at the end of the REDO phase and at the end of recovery. - other minor changes storage/maria/ha_maria.cc: The checkpoint done after Recovery is finished, is moved to maria_recover(). storage/maria/ma_bitmap.c: fix for Valgrind error: the "shadow debug copy" of the bitmap page started unitialized and so ma_print_bitmap() would use it uninitialized storage/maria/ma_checkpoint.c: * reset pointers to NULL after freeing them, or we segfault at next checkpoint in my_realloc(). * fix for compiler warnings. storage/maria/ma_delete_all.c: info->trn is NULL for non-transactional tables storage/maria/ma_locking.c: correct assertion (it fired wrongly in execution of REDO_DROP_TABLE due to the maria_extra(HA_PREPARE_FOR_DROP)->_ma_decrement_open_count() ->maria_lock_database(F_UNLCK); another solution would have been to not call _ma_decrement_open_count() (it's ok to have a wrong open count in a table which we are dropping), but the same problem would still exist for REDO_RENAME_TABLE. storage/maria/ma_loghandler.c: fail early if UNRECOVERABLE_ERROR storage/maria/ma_recovery.c: * new argument to maria_apply_log(): should it take checkpoints (at end of REDO phase and at the very end) or no. * moving the call to translog_next_LSN() into parse_checkpoint_record() ("hide the details"). * Refining an error detection for something which could happen if there is a checkpoint record in the log. * Using close_one_table() instead of maria_extra(HA_EXTRA_PREPARE_FOR_DROP|RENAME), as it looks safer, and also changing how close_one_table() works: it now limits itself to scanning all_tables[], thus having one loopp instead of two, which should be faster (as a result, it does not close tables not registered in this array, which is ok as there should not be any). storage/maria/ma_recovery.h: new parameter storage/maria/maria_read_log.c: update to new prototype --- storage/maria/ma_locking.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'storage/maria/ma_locking.c') diff --git a/storage/maria/ma_locking.c b/storage/maria/ma_locking.c index 178ced3906f..9fc364e2af8 100644 --- a/storage/maria/ma_locking.c +++ b/storage/maria/ma_locking.c @@ -140,8 +140,13 @@ int maria_lock_database(MARIA_HA *info, int lock_type) } info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); info->lock_type= F_UNLCK; - /* verify that user of the table cleaned up after itself */ - DBUG_ASSERT(share->now_transactional == share->base.born_transactional); + /* + Verify that user of the table cleaned up after itself. Not in + recovery, as for example maria_extra(HA_EXTRA_PREPARE_FOR_RENAME) may + call us here, with transactionality temporarily disabled. + */ + DBUG_ASSERT(maria_in_recovery || + share->now_transactional == share->base.born_transactional); break; case F_RDLCK: if (info->lock_type == F_WRLCK) -- cgit v1.2.1