mariadb/storage/maria
unknown 2291f932b2 - WL#3072 Maria Recovery:
Recovery of state.records (the count of records which is stored into
the header of the index file). For that, state.is_of_lsn is introduced;
logic is explained in ma_recovery.c (look for "Recovery of the state").
The net gain is that in case of crash, we now recover state.records,
and it is idempotent (ma_test_recovery tests it).
state.checksum is not recovered yet, mail sent for discussion.
- WL#3071 Maria Checkpoint: preparation for it, by protecting
all modifications of the state in memory or on disk with intern_lock
(with the exception of the really-often-modified state.records,
which is now protected with the log's lock, see ma_recovery.c
(look for "Recovery of the state"). Also, if maria_close() sees that
Checkpoint is looking at this table it will not my_free() the share.
- don't compute row's checksum twice in case of UPDATE (correction
to a bugfix I made yesterday).


storage/maria/ha_maria.cc:
  protect state write with intern_lock (against Checkpoint)
storage/maria/ma_blockrec.c:
  * don't reset trn->rec_lsn in _ma_unpin_all_pages(), because it
  should wait until we have corrected the allocation in the bitmap
  (as the REDO can serve to correct the allocation during Recovery);
  introducing _ma_finalize_row() for that.
  * In a changeset yesterday I moved computation of the checksum
  into write_block_record(), to fix a bug in UPDATE. Now I notice
  that maria_update() already computes the checksum, it's just that
  it puts it into info->cur_row while _ma_update_block_record()
  uses info->new_row; so, removing the checksum computation from
  write_block_record(), putting it back into allocate_and_write_block_record()
  (which is called only by INSERT and UNDO_DELETE), and copying
  cur_row->checksum into new_row->checksum in _ma_update_block_record().
storage/maria/ma_check.c:
  new prototypes, they will take intern_lock when writing the state;
  also take intern_lock when changing share->kfile. In both cases
  this is to protect against Checkpoint reading/writing the state or reading
  kfile at the same time.
  Not updating create_rename_lsn directly at end of write_log_record_for_repair()
  as it wouldn't have intern_lock.
storage/maria/ma_close.c:
  Checkpoint builds a list of shares (under THR_LOCK_maria), then it
  handles each such share (under intern_lock) (doing flushing etc);
  if maria_close() freed this share between the two, Checkpoint
  would see a bad pointer. To avoid this, when building the list Checkpoint
  marks each share, so that maria_close() knows it should not free it
  and Checkpoint will free it itself.
  Extending the zone covered by intern_lock to protect against
  Checkpoint reading kfile, writing state.
storage/maria/ma_create.c:
  When we update create_rename_lsn, we also update is_of_lsn to
  the same value: it is logical, and allows us to test in maria_open()
  that the former is not bigger than the latter (the contrary is a sign
  of index header corruption, or severe logging bug which hinders
  Recovery, table needs a repair).
  _ma_update_create_rename_lsn_on_disk() also writes is_of_lsn;
  it now operates under intern_lock (protect against Checkpoint),
  a shortcut function is available for cases where acquiring
  intern_lock is not needed (table's creation or first open).
storage/maria/ma_delete.c:
  if table is transactional, "records" is already decremented
  when logging UNDO_ROW_DELETE.
storage/maria/ma_delete_all.c:
  comments
storage/maria/ma_extra.c:
  Protect modifications of the state, in memory and/or on disk,
  with intern_lock, against a concurrent Checkpoint.
  When state goes to disk, update it's is_of_lsn (by calling
  the new _ma_state_info_write()).
  In HA_EXTRA_FORCE_REOPEN, don't set share->changed to 0 (undoing
  a change I made a few days ago) and ASK_MONTY
storage/maria/ma_locking.c:
  no real code change here.
storage/maria/ma_loghandler.c:
  Log-write-hooks for updating "state.records" under log's mutex
  when writing/updating/deleting a row or deleting all rows.
storage/maria/ma_loghandler_lsn.h:
  merge (make LSN_ERROR and LSN_REPAIRED_BY_MARIA_CHK different)
storage/maria/ma_open.c:
  When opening a table verify that is_of_lsn >= create_rename_lsn; if
  false the header must be corrupted.
  _ma_state_info_write() is split in two: _ma_state_info_write_sub()
  which is the old _ma_state_info_write(), and _ma_state_info_write()
  which additionally takes intern_lock if requested (to protect
  against Checkpoint) and updates is_of_lsn.
  _ma_open_keyfile() should change kfile.file under intern_lock
  to protect Checkpoint from reading a wrong kfile.file.
storage/maria/ma_recovery.c:
  Recovery of state.records: when the REDO phase sees UNDO_ROW_INSERT
  which has a LSN > state.is_of_lsn it increments state.records.
  Same for UNDO_ROW_DELETE and UNDO_ROW_PURGE.
  When closing a table during Recovery, we know its state is at least
  as new as the current log record we are looking at, so increase
  is_of_lsn to the LSN of the current log record.
storage/maria/ma_rename.c:
  update for new behaviour of _ma_update_create_rename_lsn_on_disk().
storage/maria/ma_test1.c:
  update to new prototype
storage/maria/ma_test2.c:
  update to new prototype (actually prototype was changed days ago,
  but compiler does not complain about the extra argument??)
storage/maria/ma_test_recovery.expected:
  new result file of ma_test_recovery. Improvements: record
  count read from index's header is now always correct.
storage/maria/ma_test_recovery:
  "rm" fails if file does not exist. Redirect stderr of script.
storage/maria/ma_write.c:
  if table is transactional, "records" is already incremented when
  logging UNDO_ROW_INSERT. Comments.
storage/maria/maria_chk.c:
  update is_of_lsn too
storage/maria/maria_def.h:
  - MARIA_STATE_INFO::is_of_lsn which is used by Recovery. It is stored
  into the index file's header.
  - Checkpoint can now mark a table as "don't free this", and maria_close()
  can reply "ok then you will free it".
  - new functions
storage/maria/maria_pack.c:
  update for new name
2007-09-07 15:02:30 +02:00
..
unittest Check of transaction log descriptor table consistance added. 2007-09-04 22:52:32 +03:00
CMakeLists.txt fixed typo 2006-11-15 12:58:37 +02:00
ft_maria.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ha_maria.cc - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ha_maria.h merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
lockman.c This patch is a collection of patches from from Sanja, Sergei and Monty. 2007-05-29 20:13:56 +03:00
lockman.h GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
ma_bitmap.c - speed optimization: 2007-09-06 16:53:26 +02:00
ma_blockrec.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_blockrec.h Added undo of deleted row 2007-09-05 02:57:53 +03:00
ma_cache.c merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
ma_changed.c GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
ma_check.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_checkpoint.c First LSN calls added for transaction log. 2007-08-13 22:54:29 +03:00
ma_checkpoint.h WL#3072 Maria Recovery 2007-06-26 16:49:23 +02:00
ma_checksum.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_close.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_commit.c cleanups 2007-08-29 17:28:44 +02:00
ma_commit.h - WL#3239 "log CREATE TABLE in Maria" 2007-06-22 14:49:37 +02:00
ma_control_file.c WL#3072 Maria recovery 2007-08-29 16:43:01 +02:00
ma_control_file.h WL#3072 Maria recovery 2007-08-29 16:43:01 +02:00
ma_create.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_dbug.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_delete.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_delete_all.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_delete_table.c WL#3072 - Maria recovery 2007-07-26 11:56:21 +02:00
ma_dynrec.c Fixed several bugs found by running *.test with maria engine 2007-09-03 12:05:17 +03:00
ma_extra.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_ft_boolean_search.c merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
ma_ft_eval.c Fixes after review of guilhem of block record patch 2007-04-19 13:18:56 +03:00
ma_ft_eval.h GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
ma_ft_nlq_search.c merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
ma_ft_parser.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_ft_stem.c GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
ma_ft_test1.c Fixes after review of guilhem of block record patch 2007-04-19 13:18:56 +03:00
ma_ft_test1.h GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
ma_ft_update.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_ftdefs.h Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_fulltext.h Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_info.c merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
ma_init.c Merge bk-internal.mysql.com:/home/bk/mysql-maria 2007-07-01 16:48:57 +03:00
ma_key.c merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
ma_keycache.c Merge desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria.bak 2007-04-16 13:19:43 +03:00
ma_least_recently_dirtied.c GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
ma_least_recently_dirtied.h GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
ma_locking.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_loghandler.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_loghandler.h Check of transaction log descriptor table consistance added. 2007-09-04 22:52:32 +03:00
ma_loghandler_lsn.h - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_open.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_packrec.c post-merge fixes, and fixes for some of the 16 compiler warnings 2007-07-26 17:51:49 +02:00
ma_page.c Ability to read unflushed data added (only problem with CRC left and have to be fixed). 2007-08-13 15:17:49 +03:00
ma_pagecache.c Added undo of deleted row 2007-09-05 02:57:53 +03:00
ma_pagecache.h Merge desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-noflush 2007-08-13 15:19:31 +03:00
ma_pagecaches.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_panic.c - WL#3239 "log CREATE TABLE in Maria" 2007-06-22 14:49:37 +02:00
ma_preload.c merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
ma_range.c fixes of bad merge (probably). Less duplication in ma_test_recovery. 2007-08-06 16:13:42 +02:00
ma_recovery.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_recovery.h WL#3072 Maria recovery 2007-08-29 16:43:01 +02:00
ma_rename.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_rfirst.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rkey.c merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
ma_rlast.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rnext.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rnext_same.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rprev.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rrnd.c Fixes for bugs found by maria.test and event*tests: 2007-08-21 20:54:11 +03:00
ma_rsame.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rsamepos.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rt_index.c merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
ma_rt_index.h Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rt_key.c merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
ma_rt_key.h Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rt_mbr.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rt_mbr.h Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rt_split.c merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
ma_rt_test.c GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
ma_scan.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_search.c merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
ma_sort.c merging MyISAM changes into Maria (not done in 5.1->maria merge of 2007-07-27 12:06:39 +02:00
ma_sp_defs.h Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_sp_key.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_sp_test.c Fixes after review of guilhem of block record patch 2007-04-19 13:18:56 +03:00
ma_static.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_statrec.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_test1.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_test2.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_test3.c porting Serg's fix for BUG#30094 to Maria. Now ma_test_all passes. 2007-07-27 16:11:40 +02:00
ma_test_all.res After merge fixes 2007-01-26 13:32:02 +02:00
ma_test_all.sh Generalized the way update and redo extends the size of a directory record. 2007-08-31 10:19:54 +03:00
ma_test_recovery - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_test_recovery.expected - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
ma_unique.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_update.c Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-maria 2007-07-04 12:20:53 +03:00
ma_write.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
Makefile.am WL#3072 - Maria recovery 2007-07-26 11:56:21 +02:00
maria_chk.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
maria_def.h - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
maria_ftdump.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
maria_pack.c - WL#3072 Maria Recovery: 2007-09-07 15:02:30 +02:00
maria_read_log.c WL#3072 Maria Recovery 2007-09-06 16:04:36 +02:00
maria_rename.sh Added storage/maria (based on MyISAM). WL#3245 2006-04-11 16:45:10 +03:00
plug.in Maria - merging recent changes done to MyISAM into Maria. 2006-12-19 19:15:53 +01:00
tablockman.c WL#3072 Maria recovery: 2007-08-01 15:52:57 +02:00
tablockman.h GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
test_pack Added storage/maria (based on MyISAM). WL#3245 2006-04-11 16:45:10 +03:00
trnman.c WL#3072 Maria recovery 2007-08-29 16:43:01 +02:00
trnman.h Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
trnman_public.h WL#3072 Maria recovery 2007-08-29 16:43:01 +02:00