• unknown's avatar
    WL#3071 - Maria checkpoint · e7085957
    unknown authored
    * Preparation for having a background checkpoint thread:
    frequency of checkpoint taken by that thread is now configurable
    by the user: global variable maria_checkpoint_frequency, in seconds,
    default 30 (checkpoint every 30th second); 0 means no checkpoints
    (and thus no background thread, thus no background flushing, that
    will probably only be used for testing).
    * Don't take checkpoints in Recovery if it didn't do anything
    significant; thus no checkpoint after a clean shutdown/restart. The
    only checkpoint which is never skipped is the one at shutdown.
    * fix for a test failure (after-merge fix)
    
    
    include/maria.h:
      new variable
    mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
      result update
    mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
      position update (=after merge fix, as this position was already changed
      into 5.1 and not merged here, causing test to fail)
    storage/maria/ha_maria.cc:
      Checkpoint's frequency is now configurable by the user:
      global variable maria_checkpoint_frequency. Changing it on the fly
      requires us to shutdown/restart the background checkpoint thread,
      as the loop done in that thread assumes a constant checkpoint
      interval. Default value is 30: a checkpoint every 30 seconds (yes, I
      know, physicists will remind that it should be named "period" then).
      ha_maria now asks for a background checkpoint thread when it starts,
      but this is still overruled (disabled) in ma_checkpoint_init().
    storage/maria/ma_checkpoint.c:
      Checkpoint's frequency is now configurable by the user: background thread
      takes a checkpoint every maria_checkpoint_interval-th second.
      If that variable is 0, no checkpoints are taken.
      Note, I will enable the background thread only in a later changeset.
    storage/maria/ma_recovery.c:
      Don't take checkpoints at the end of the REDO phase and at the end of
      Recovery if Recovery didn't make anything significant (didn't open
      any tables, didn't rollback any transactions).
      With this, after a clean shutdown, Recovery shouldn't take any
      checkpoint, which makes starting faster (we save a few fsync()s of
      the log and control file).
    e7085957
ha_maria.cc 78.9 KB