Hello Guilhem,
Ok to push by me.
Please see below for comments about a possible future improvement as
discussed on IRC.
Guilhem Bichot, 27.11.2007 15:04:
...
> ChangeSet@stripped, 2007-11-27 15:04:43+01:00, guilhem@stripped +66 -0
> WL#866 - Online backup driver for MyISAM.
...
> include/keycache.h@stripped, 2007-11-27 15:04:37+01:00, guilhem@stripped +11 -2
> A block now has an optional callback_argument. A key cache has a global
> post_write function which is called after any block goes to the file.
> The callback's argument are set through key_cache_write(). The
> callback is set when opening MyISAM tables.
> This is used by MyISAM's physical logging: when a key page
> is flushed to the file, the write is also recorded in the physical log,
> thanks to such callback.
This means that the callback function is called for every page flush,
regardless if backup is going on or not and regardless if the table is
in backup or not. The callback knows and returns if nothing is to do.
IMHO it would save some overhead if we could limit calling of the
callback to pages of tables that are in backup.
Since we have a global pointer for the function, we could use
callback_arg for the decision.
You said rightfully: if you don't set callback_arg when
key_cache_write() a block, later a backup may start and it needs the
cached block.
That's true as long as you want to avoid a cache flush per backup table
at backup start. However, with such a flush we could supply 'share' only
for tables in backup and NULL otherwise. This flush would also avoid
that we log pages with changes that were done prior to the backup.
...
Regards
Ingo
--
Ingo Strüwing, Senior Software Developer
MySQL GmbH, Dachauer Str. 37, D-80335 München
Geschäftsführer: Kaj Arnö - HRB München 162140