Commit 91a48a75 authored by unknown's avatar unknown

Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-maria

into  gbichot4.local:/home/mysql_src/mysql-maria-tmp


storage/maria/ma_loghandler.c:
  Auto merged
parents a2b44f09 cd357588
...@@ -2401,9 +2401,7 @@ static int ha_maria_init(void *p) ...@@ -2401,9 +2401,7 @@ static int ha_maria_init(void *p)
MYSQL_VERSION_ID, server_id, maria_log_pagecache, MYSQL_VERSION_ID, server_id, maria_log_pagecache,
TRANSLOG_DEFAULT_FLAGS) || TRANSLOG_DEFAULT_FLAGS) ||
maria_recover() || maria_recover() ||
ma_checkpoint_init(FALSE) || ma_checkpoint_init(FALSE);
/* One checkpoint after Recovery */
ma_checkpoint_execute(CHECKPOINT_FULL, FALSE);
maria_multi_threaded= TRUE; maria_multi_threaded= TRUE;
return res; return res;
} }
......
...@@ -217,6 +217,9 @@ my_bool _ma_bitmap_init(MARIA_SHARE *share, File file) ...@@ -217,6 +217,9 @@ my_bool _ma_bitmap_init(MARIA_SHARE *share, File file)
bitmap->page= ~(ulonglong) 0; bitmap->page= ~(ulonglong) 0;
bitmap->used_size= bitmap->total_size; bitmap->used_size= bitmap->total_size;
bfill(bitmap->map, share->block_size, 255); bfill(bitmap->map, share->block_size, 255);
#ifndef DBUG_OFF
memcpy(bitmap->map + bitmap->block_size, bitmap->map, bitmap->block_size);
#endif
if (share->state.first_bitmap_with_space == ~(ulonglong) 0) if (share->state.first_bitmap_with_space == ~(ulonglong) 0)
{ {
/* Start scanning for free space from start of file */ /* Start scanning for free space from start of file */
......
...@@ -390,6 +390,7 @@ void ma_checkpoint_end(void) ...@@ -390,6 +390,7 @@ void ma_checkpoint_end(void)
pthread_mutex_unlock(&LOCK_checkpoint); pthread_mutex_unlock(&LOCK_checkpoint);
my_free((uchar *)dfiles, MYF(MY_ALLOW_ZERO_PTR)); my_free((uchar *)dfiles, MYF(MY_ALLOW_ZERO_PTR));
my_free((uchar *)kfiles, MYF(MY_ALLOW_ZERO_PTR)); my_free((uchar *)kfiles, MYF(MY_ALLOW_ZERO_PTR));
dfiles= kfiles= NULL;
pthread_mutex_destroy(&LOCK_checkpoint); pthread_mutex_destroy(&LOCK_checkpoint);
pthread_cond_destroy(&COND_checkpoint); pthread_cond_destroy(&COND_checkpoint);
checkpoint_inited= FALSE; checkpoint_inited= FALSE;
...@@ -563,6 +564,8 @@ pthread_handler_t ma_checkpoint_background(void *arg __attribute__((unused))) ...@@ -563,6 +564,8 @@ pthread_handler_t ma_checkpoint_background(void *arg __attribute__((unused)))
TRANSLOG_ADDRESS log_horizon_at_last_checkpoint= LSN_IMPOSSIBLE; TRANSLOG_ADDRESS log_horizon_at_last_checkpoint= LSN_IMPOSSIBLE;
ulonglong pagecache_flushes_at_last_checkpoint= 0; ulonglong pagecache_flushes_at_last_checkpoint= 0;
struct timespec abstime; struct timespec abstime;
LINT_INIT(kfile);
LINT_INIT(dfile);
switch((sleeps++) % time_between_checkpoints) switch((sleeps++) % time_between_checkpoints)
{ {
case 0: case 0:
...@@ -731,6 +734,7 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon) ...@@ -731,6 +734,7 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon)
*state_copies_end, /**< cache ends here */ *state_copies_end, /**< cache ends here */
*state_copy; /**< iterator in cache */ *state_copy; /**< iterator in cache */
TRANSLOG_ADDRESS state_copies_horizon; /**< horizon of states' _copies_ */ TRANSLOG_ADDRESS state_copies_horizon; /**< horizon of states' _copies_ */
LINT_INIT(state_copies_horizon);
DBUG_ENTER("collect_tables"); DBUG_ENTER("collect_tables");
/* let's make a list of distinct shares */ /* let's make a list of distinct shares */
......
...@@ -95,7 +95,8 @@ int maria_delete_all_rows(MARIA_HA *info) ...@@ -95,7 +95,8 @@ int maria_delete_all_rows(MARIA_HA *info)
The operations above on the index/data file will be forced to disk at The operations above on the index/data file will be forced to disk at
Checkpoint or maria_close() time. So we can reset: Checkpoint or maria_close() time. So we can reset:
*/ */
info->trn->rec_lsn= LSN_IMPOSSIBLE; if (log_record)
info->trn->rec_lsn= LSN_IMPOSSIBLE;
VOID(_ma_writeinfo(info,WRITEINFO_UPDATE_KEYFILE)); VOID(_ma_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
......
...@@ -140,8 +140,13 @@ int maria_lock_database(MARIA_HA *info, int lock_type) ...@@ -140,8 +140,13 @@ int maria_lock_database(MARIA_HA *info, int lock_type)
} }
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
info->lock_type= F_UNLCK; 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; break;
case F_RDLCK: case F_RDLCK:
if (info->lock_type == F_WRLCK) if (info->lock_type == F_WRLCK)
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
DBUG_PRINT("error", E); \ DBUG_PRINT("error", E); \
printf E; \ printf E; \
putchar('\n'); \ putchar('\n'); \
DBUG_ASSERT(0); \
} while(0); } while(0);
/* Maximum length of compressed LSNs (the worst case of whole LSN storing) */ /* Maximum length of compressed LSNs (the worst case of whole LSN storing) */
......
This diff is collapsed.
...@@ -26,5 +26,6 @@ ...@@ -26,5 +26,6 @@
C_MODE_START C_MODE_START
int maria_recover(void); int maria_recover(void);
int maria_apply_log(LSN lsn, my_bool apply, FILE *trace_file, int maria_apply_log(LSN lsn, my_bool apply, FILE *trace_file,
my_bool execute_undo_phase, my_bool skip_DDLs); my_bool execute_undo_phase, my_bool skip_DDLs,
my_bool take_checkpoints);
C_MODE_END C_MODE_END
...@@ -103,7 +103,7 @@ int main(int argc, char **argv) ...@@ -103,7 +103,7 @@ int main(int argc, char **argv)
fprintf(stdout, "TRACE of the last maria_read_log\n"); fprintf(stdout, "TRACE of the last maria_read_log\n");
if (maria_apply_log(lsn, opt_apply, opt_silent ? NULL : stdout, if (maria_apply_log(lsn, opt_apply, opt_silent ? NULL : stdout,
opt_apply_undo, FALSE)) opt_apply_undo, FALSE, FALSE))
goto err; goto err;
fprintf(stdout, "%s: SUCCESS\n", my_progname_short); fprintf(stdout, "%s: SUCCESS\n", my_progname_short);
......
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