summaryrefslogtreecommitdiff
path: root/storage/maria/maria_pack.c
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2008-07-09 11:02:27 +0200
committerGuilhem Bichot <guilhem@mysql.com>2008-07-09 11:02:27 +0200
commit60b88ce475cbc4e4ce5b9a90e2f821df5e5a10a1 (patch)
tree03c662c86c5ce6974868da0eade6e2ef0931ae23 /storage/maria/maria_pack.c
parentf9ef13d562756c9c084ee8c5d0f741885a4bc9a1 (diff)
downloadmariadb-git-60b88ce475cbc4e4ce5b9a90e2f821df5e5a10a1.tar.gz
Fix for BUG#37876 "Importing Maria table from other server via binary copy does not work":
- after auto-zerofill (ha_maria::check_and_repair()) kepts its state's LSNs unchanged, which could be the same as the create_rename_lsn of another pre-existing table, which would break versioning as this LSN serves as unique identifier in the versioning code (in maria_open()). Even the state pieces which maria_zerofill() did change were lost (because they didn't go to disk). - after this fix, if two tables were auto-zerofilled at the same time (by _ma_mark_changed()) they could receive the same create_rename_lsn, which would break versioning again. Fix is to write a log record each time a table is imported. - Print state's LSNs (create_rename_lsn, is_of_horizon, skip_redo_lsn) and UUID in maria_chk -dvv. mysql-test/r/maria-autozerofill.result: result mysql-test/t/maria-autozerofill.test: Test for auto-zerofilling storage/maria/ha_maria.cc: The state changes done by auto-zerofilling never reached disk. storage/maria/ma_check.c: When zerofilling a table, including its pages' LSNs, new state LSNs are needed next time the table is imported into a Maria instance. storage/maria/ma_create.c: Write LOGREC_IMPORTED_TABLE when importing a table. This is informative and ensures that the table gets a unique create_rename_lsn even though multiple tables are imported by concurrent threads (it advances the log's end LSN). storage/maria/ma_key_recover.c: comment storage/maria/ma_locking.c: instead of using translog_get_horizon() for state's LSNs of imported table, use the LSN of to-be-written LOGREC_IMPORTED_TABLE. storage/maria/ma_loghandler.c: New type of log record storage/maria/ma_loghandler.h: New type of log record storage/maria/ma_loghandler_lsn.h: New name for constant as can be used not only by maria_chk but auto-zerofill now too. storage/maria/ma_open.c: instead of using translog_get_horizon() for state's LSNs of imported table, use the LSN of to-be-written LOGREC_IMPORTED_TABLE. storage/maria/ma_recovery.c: print content of LOGREC_IMPORTED_TABLE in maria_read_log. storage/maria/maria_chk.c: print info about LSNs of the table's state, and UUID, when maria_chk -dvv storage/maria/maria_pack.c: new name for constant storage/maria/unittest/ma_test_recovery.pl: Now that maria_chk -dvv shows state LSNs and UUID those need to be filtered out, as maria_read_log -a does not use the same as at original run.
Diffstat (limited to 'storage/maria/maria_pack.c')
-rw-r--r--storage/maria/maria_pack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c
index b363d34a692..858f054a9f5 100644
--- a/storage/maria/maria_pack.c
+++ b/storage/maria/maria_pack.c
@@ -2979,7 +2979,7 @@ static int save_state(MARIA_HA *isam_file,PACK_MRG_INFO *mrg,
share->state.version=(ulong) time((time_t*) 0);
if (share->base.born_transactional)
share->state.create_rename_lsn= share->state.is_of_horizon=
- share->state.skip_redo_lsn= LSN_REPAIRED_BY_MARIA_CHK;
+ share->state.skip_redo_lsn= LSN_NEEDS_NEW_STATE_LSNS;
if (! maria_is_all_keys_active(share->state.key_map, share->base.keys))
{
/*
@@ -3031,7 +3031,7 @@ static int save_state_mrg(File file,PACK_MRG_INFO *mrg,my_off_t new_length,
state.state.empty=0;
state.state.records=state.split=(ha_rows) mrg->records;
state.create_rename_lsn= state.is_of_horizon= state.skip_redo_lsn=
- LSN_REPAIRED_BY_MARIA_CHK;
+ LSN_NEEDS_NEW_STATE_LSNS;
/* See comment above in save_state about key_file_length handling. */
if (mrg->src_file_has_indexes_disabled)