into gbichot4.local:/home/mysql_src/mysql-maria-for-undo-phase
storage/maria/ma_loghandler.c:
Auto merged
storage/maria/ma_recovery.c:
Auto merged
mysql-test/r/maria-recovery.result:
merge
mysql-test/t/maria-recovery.test:
merge
This is used to bzero all not used parts of the index pages and compact and bzero the not used parts of the data pages of block-record type
Added --zerofill (-z) option to maria_chk (Mostly code from Jani)
Added now table states ZEROFILLED and MOVEABLE
Set state.changed with new states when things changes
include/maria.h:
Added maria_zerofill
include/myisamchk.h:
Added option for zerofill
Extend testflag to be 64 to allow for more flags
mysql-test/r/create.result:
Updated results after merge
mysql-test/r/maria.result:
Updated results after merge
mysys/my_getopt.c:
Removed not used variable
sql/sql_show.cc:
Fixed wrong page type
storage/maria/ma_blockrec.c:
Renamed compact_page() to ma_compact_block_page() and made it global
Always zerofill half filled blob pages
Set share.state.changed on REDO
storage/maria/ma_blockrec.h:
Added _ma_compact_block_page()
storage/maria/ma_check.c:
Added maria_zerofill()
This is used to bzero all not used parts of the index pages and compact and bzero the not used parts of the data pages of block-record type
This gives the following benefits:
- Table is smaller if compressed
- All LSN are removed for transactinal tables and this makes them movable between systems
Dont set table states of we are using --quick
Changed log entry for repair to use 8 bytes for flag
storage/maria/ma_delete.c:
Simplify code
Update state.changed
storage/maria/ma_key_recover.c:
Update state.changed
storage/maria/ma_locking.c:
Set uuid for file on first change if it's not set (table was cleared with zerofill)
storage/maria/ma_loghandler.c:
Updated log entry for REDO_REPAIR_TABLE
storage/maria/ma_recovery.c:
Updated log entry for REDO_REPAIR_TABLE (flag is now 8 bytes)
Set new bits in state.changed
storage/maria/ma_test_all.sh:
Nicer output
storage/maria/ma_test_recovery.expected:
Updated results (now states flags are visible)
storage/maria/ma_update.c:
Update state.changed
storage/maria/ma_write.c:
Simplify code
Set state.changed
storage/maria/maria_chk.c:
Added option --zerofill
Added printing of states for MOVABLE and ZEROFILLED
MYD -> MAD
MYI -> MAI
storage/maria/maria_def.h:
Added states STATE_NOT_MOVABLE and STATE_NOT_ZEROFILLED
Added prototype for new functions
storage/maria/unittest/ma_test_all-t:
More tests, including tests for zerofill
Removed some not needed 'print' statements
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Smaller buffer to not trash devlopment machines totally
mysql-test/include/maria_empty_logs.inc:
can now ask that control file be preserved
mysql-test/lib/mtr_report.pl:
expected warning (produced by translog_init() when log is missing)
mysql-test/r/maria-recovery.result:
result update
mysql-test/t/maria-recovery.test:
test of removing logs manually; recovery used to fail
storage/maria/ma_loghandler.c:
The addition to maria-recovery.test uncovered a bug: log 1 was
manually deleted, Maria restarted, created log 2, then crash
before a checkpoint: logs_found is TRUE, last_checkpoint_lsn
is LSN_IMPOSSIBLE, so sure_page assumes that log 1 exists;
using last_logno instead (only the last log needs to be checked,
as the 'else' branch checks only after last_checkpoint_lsn:
creation of a log is as good a starting point as a checkpoint,
for scanning the log).
must be updated correctly. And Recovery should not assume that
log 1 is available but just use first available log.
mysql-test/r/maria-purge.result:
result update
mysql-test/t/maria-purge.test:
like in other Maria tests (4294967296 is too big, causes warning)
storage/maria/ma_loghandler.c:
When log handler starts and discovers that logs are missing though
control file says they should be there (they have been manually
deleted), it decides to create a log
with number last_logno+1. It needs to update control file with
this new number, and also reset last_checkpoint_lsn to LSN_IMPOSSIBLE
(last checkpoint went away when log was deleted).
Fix for when translog_init() fails before allocating id_to_share
(translog_destroy() tried to free NULL).
storage/maria/ma_recovery.c:
When logs have been manually deleted, translog_first_theoretical_lsn()
always fails (it looks for log number 1). Recovery now uses
translog_first_lsn_in_log() which just picks the first available log.
into mysql.com:/home/my/mysql-maria
dbug/dbug.c:
Auto merged
include/my_dbug.h:
Auto merged
include/my_global.h:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/maria-recovery.result:
Auto merged
mysql-test/t/maria-recovery.test:
Auto merged
mysql-test/t/maria.test:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_show.cc:
Auto merged
storage/maria/Makefile.am:
Auto merged
storage/maria/ha_maria.cc:
Auto merged
storage/maria/ma_bitmap.c:
Auto merged
storage/maria/ma_check.c:
Auto merged
storage/maria/ma_key_recover.c:
Auto merged
storage/maria/ma_loghandler.c:
Auto merged
storage/maria/ma_open.c:
Auto merged
storage/maria/ma_recovery.c:
Auto merged
storage/maria/maria_chk.c:
Auto merged
storage/maria/maria_def.h:
Auto merged
storage/maria/ma_test_all.sh:
Use remote version
mysql-test/r/maria.result:
Trivial merge
storage/maria/ma_pagecache.c:
Trivial merge
Added variable _dbug_on_ to speed up execution when DBUG is not going to be used
Added --debug-on option to mysqld (to be able to turn of DBUG with --debug-on=0)
Fixed some bugs with 'non_flushable' marking of bitmap pages
Don't use 'non_flushable' marking of bitmap pages for not transactional tables
SHOW CREATE TABLE now shows if table was created with page checksums
Fixed a lot of bugs with BLOB handling in case of update/REDO and UNDO
More tests (especially for blobs) and DBUG_ASSERTS()
More readable output from maria_read_log and maria_chk
Fixed wrong shift that caused Maria to crash on files > 4G
Mark tables as crashed of REDO fails
dbug/dbug.c:
Changed to use my_bool (allowed me to remove some windows specific code)
Added variable _dbug_on_ to speed up execution when DBUG is not going to be used
Removed initialization of variables if not needed
include/my_dbug.h:
Use my_bool for some functions that was defined as BOOLEAN in dbug.c code
Added DBUGGER_ON/DEBUGGER_OFF to speed up execution when DBUG is not used
include/my_global.h:
Define my_bool early
Increase MY_HOW_OFTEN_TO_WRITE as computers are now faster than 10 years ago
mysql-test/mysql-test-run.pl:
Added debug-on=0 to speed up tests
mysql-test/r/maria-recovery.result:
Added new test by Guilhem to test if UNDO_ROW_DELETE preserves rowid
mysql-test/r/maria.result:
Added testing of page checksums
mysql-test/t/crash_commit_before-master.opt:
Added --debug-on as test require DBUG to work
mysql-test/t/maria-recovery-bitmap-master.opt:
Added --debug-on as test require DBUG to work
mysql-test/t/maria-recovery-master.opt:
Added --debug-on as test require DBUG to work
mysql-test/t/maria-recovery.test:
Added new test by Guilhem to test if UNDO_ROW_DELETE preserves rowid
mysql-test/t/maria.test:
Added testing of page checksums
sql/mysqld.cc:
Added --debug-on option (to be able to turn of DBUG with --debug-on=0)
Indentation fixes
Removed end spaces
sql/sql_show.cc:
Allow update_create_info() to inform MySQL if PACK_KEYS, NO_PACK_KEYS, CHECKSUM, PAGE_CHECKSUM or DELAY_KEY_WRITE is used
storage/maria/Makefile.am:
Added ma_test_big.sh
storage/maria/ha_maria.cc:
Store in create_info if page checksums are used (For SHOW CREATE TABLE)
storage/maria/ma_bitmap.c:
Added _ma_bitmap_wait_or_flush() to cause reader of bitmap pages to wait with reading until bitmap is flushed.
Use TAIL_PAGE_COUNT_MARKER for tail pages
Set 'sub_blocks' for and only for the head page or for the first extent of a blob. This is needed for store_extent_info() to be able to set START_EXTENT_BIT's
Don't allocate more than 0x3ffff pages in one extent (We need bit 0x4000 as a START_EXTENT_BIT)
Increase the calculated 'head_length' with the number of bytes used for extents.
Update row->space_on_head_page also in _ma_bitmap_find_new_place()
Make _ma_bitmap_get_page_bits() global. (Needed for UNDO handling)
Changed _ma_bitmap_flushable() to take MARIA_HA instead of MARIA_SHARE.
This was needed to be able to mark the handler if we had a 'non_flushable' call pending or not.
Don't use 'non_flushable' marking of bitmap pages for not transactional tables.
Added BLOCKUSED_USE_ORG_BITMAP handling also for tail pages.
Added more DBUG_ASSERT() to find possible errors in other code
Some code simplications by adding new local variables
storage/maria/ma_blockrec.c:
UNDO of rows now puts back all part of the row on their original pages and positions.
Changed UNDO of DELETE and UNDO of UPDATE to contain information about the original length of data on head block and also extent information
This changes a lot of logic as now an insert of a row on a page may happen to any position (and not just to the first or next free)
Use PAGE_COUNT to mark if an extent is the start of of a blob. (Needed for extent_to_bitmap_blocks())
Added check_directory() for checking that directroy entries are correct.
Added checking of row checksums when reading rows (with EXTRA_DEBUG)
Added make_space_for_directory() and extend_directory() for doing expansion of directory
Added get_rowpos_in_head_or_tail_page() to be able to store head/tail on original position in UNDO
Added extent_to_bitmap_blocks() to be able to generate original bitmap blocks from UNDO entry
Added _ma_update_at_original_place() for UNDO of DELETES
Added row->min_length to hold minmum required space needed on head page
Changed find_free_position() to use make_space_for_directory()
Changed make_empty_page() to allow optional creation of directory entry
Changed delete_head_or_tail() and _ma_apply_undo_row_isnert() to not copy pagecache block (speed optimization)
Changed _ma_apply_redo_insert_row_head_or_tail() to be able to insert new row at any position on 'new' page
Changed _ma_apply_undo_row_delete() and _ma_apply_undo_row_update() to put row in it's original position
Ensure allocation of tail blocks are of at least MIN_TAIL_SIZE.
Ensure we store pages in pinned pages even if read failed. (If not we will have pages pinned forever in page cache)
Write original extent information in UNDO entry, not compacted ones (we need position to tails!)
When setting BLOCKUSED_USED, don't clear other bits (we have to preserve BLOCKUSED_USE_ORG_BITMAP)
Fixed som bugs in directory handling
Fixed bug where we wrote wrong lsn to blob pages
Added separate blob_buffer for fixing bug when updating row that had char/varchar that spanned several pages and also had blobs
Ensure we call _ma_bitmap_flushable() also in case of errors
When doing an update, first delete old entries, then search in bitmap for where to put new information
Info->s -> share
Rowid -> rowid
More DBUG_ASSERT()
storage/maria/ma_blockrec.h:
Added START_EXTENT_BIT and TAIL_PAGE_COUNT_MARKER
Added _ma_bitmap_wait_or_flush() and _ma_bitmap_get_page_bits()
storage/maria/ma_check.c:
Don't write extra empty line if there is no deleted blocks
Ignore START_EXTENT_BIT's in page count
Call _ma_fast_unlock_key_del() to free key_del link
storage/maria/ma_close.c:
Ensure that used_key_del is 0. (If not, someone forgot to call _ma_unlock_key_del())
storage/maria/ma_create.c:
Changed constant to macro
storage/maria/ma_delete.c:
For deleted keys, log also position to row
storage/maria/ma_extra.c:
Release blob buffer at maria_reset() if bigger than MARIA_SMALL_BLOB_BUFFER
storage/maria/ma_key_recover.c:
Added bzero() of LSN that confused paged cache in case of uninitialized block
Mark file crashed if applying of index changes fails
Added calls to _ma_fast_unlock_key_del() for protection of shared key_del link.
storage/maria/ma_locking.c:
Added usage of MARIA_FILE_OPEN_COUNT_OFFSET
Added _ma_mark_file_crashed()
storage/maria/ma_loghandler.c:
Fixed bug where we logged uninitialized memory
storage/maria/ma_open.c:
Moved state->changed to be at start of state info on disk to allow one to easly mark files as crashed
storage/maria/ma_page.c:
Disable 'dummy' checksumming of pages as this gave false warnings.
(Need to investigate if this is ever needed)
storage/maria/ma_pagecache.c:
Fixed wrong shift that caused Maria to crash on files > 4G
storage/maria/ma_recovery.c:
In case of errors, start writing on new line if we where in %## %## printing mode (Made errors more readable)
Changed global variable name from warnings -> recovery_warnings
Use MARIA_FILE_CREATE_RENAME_LSN_OFFSET instead of constant
Removed special handling of row position for deleted keys. Keys now always includes row positions
_ma_apply_undo_row_delete() now gets page and row position
Added check that we don't loop forever when handling undo's (in case of bug in undo chain)
Print name of failed REDO/UNDO
storage/maria/ma_recovery.h:
Removed old comment
storage/maria/ma_static.c:
Chaned version number of Maria files to not accidently use old ones (becasue of change of ordering of status variables)
storage/maria/ma_test2.c:
Added option -u to specify number of rows to update
Changed old option -u to be -A, as for ma_test1
Fixed bug in update of rows with blobs (before blobs was always reset to empty on update)
First created blob is now of max blob length to ensure we have at least one big blob in the table
storage/maria/ma_test_all.sh:
More tests
storage/maria/ma_test_recovery.expected:
Updated results
storage/maria/ma_test_recovery:
Changed tests to use bigger blobs (not just 1K)
Added new tests that tests recovery of update with blobs
Removed comparision of .MAD file as it's not guranteed that recovery from scratch gives identical data file as original update
(compact_page() may be called at different times during normal execution and during REDO)
storage/maria/ma_update.c:
Simplify code (changed * to if)
storage/maria/maria_chk.c:
Make output more readable
storage/maria/maria_def.h:
Changed 'changed' to int to prepare for more bits
Added 2 more bytes to status information
Added 'st_mara_row->min_length' for storing min length needed on head page
Added 'st_mara_handler->blob_buff & blob_buff_size' for storing blobs
Moved all tunning parameters into one block
Added MARIA_SMALL_BLOB_BUFFER
Added _ma_mark_file_crashed()
storage/myisam/mi_test2.c:
Fixed bug in update of rows with blobs (before blobs was always reset to empty on update)
storage/maria/ma_test_big.sh:
Testing of insert, update, delete, recovery and undo of rows with blobs
Thanks to the random-ness of ma_test2 this is likely to find most bugs in the row handling
* to honour WAL we now force the whole log when flushing a bitmap page.
* ability to intentionally crash in various places for recovery testing
* bugfix (dirty pages list found in checkpoint record was ignored)
* smaller checkpoint record
* misc small cleanups and comments
mysql-test/include/maria_empty_logs.inc:
maria-purge.test creates ~11 logs, remove them all
mysql-test/r/maria-recovery-bitmap.result:
result is good; without the _ma_bitmap_get_log_address() call,
we got
check error Bitmap at 0 has pages reserved outside of data file length
mysql-test/r/maria-recovery.result:
result update
mysql-test/t/maria-recovery-bitmap.test:
enable test of "bitmap-flush should flush whole log otherwise
corrupted data file (bitmap ahead of data pages)".
mysql-test/t/maria-recovery.test:
test of checkpoint
sql/sql_table.cc:
comment
storage/maria/ha_maria.cc:
_ma_reenable_logging_for_table() now includes file->trn=0.
At the end of repair() we don't need to re-enable logging, it is
done already by caller (like copy_data_between_tables()); it sounds
strange that this function could decide to re-enable, it should be
up to caller who knows what other operations it plans. Removing this
line led to assertion failure in maria_lock_database(F_UNLCK), fixed
by removing the assertion: maria_lock_database()
is here called in a context where F_UNLCK does not make the
table visible to others so assertion is excessive, and external_lock()
is already designed to honour the asserted condition.
Ability to crash at the end of bulk insert when indices
have been enabled.
storage/maria/ma_bitmap.c:
Better use pagecache_file_init() than set pagecache callbacks directly;
and a new function to set those callbacks for bitmap so that we can
reuse it.
_ma_bitmap_get_log_address() is a pagecache get_log_address callback
which causes the whole log to be flushed when a bitmap page
is flushed by the page cache. This was required by WAL.
storage/maria/ma_blockrec.c:
get_log_address pagecache callback for data (non bitmap) pages:
just reads the LSN from the page's content, like was hard-coded
before in ma_pagecache.c.
storage/maria/ma_blockrec.h:
functions which need to be exported
storage/maria/ma_check.c:
create_new_data_handle() can be static.
Ability to crash after rebuilding the index in OPTIMIZE,
in REPAIR. my_lock() implemented already.
storage/maria/ma_checkpoint.c:
As MARIA_SHARE* is now accessible to pagecache_collect_changed_blocks_LSN(),
we don't need to store kfile/dfile descriptors in checkpoint record,
2-byte-id of the table plus one byte to say if this is data or index
file is enough. So we go from 4+4 bytes per table down to 2+1.
storage/maria/ma_commit.c:
removing duplicate functions (see _ma_tmp_disable_logging_for_table())
storage/maria/ma_extra.c:
Monty fixed
storage/maria/ma_key_recover.c:
comment
storage/maria/ma_locking.c:
Sometimes other code does funny things with maria_lock_database(),
like ha_maria::repair() calling it at start and end without going
through ha_maria::external_lock(). So it happens that maria_lock_database()
is called with now_transactional!=born_transactional.
storage/maria/ma_loghandler.c:
update to new prototype
storage/maria/ma_open.c:
set_data|index_pagecache_callbacks() need to be exported as
they are now called when disabling/enabling transactionality.
storage/maria/ma_pagecache.c:
Removing PAGE_LSN_OFFSET, as much of the code relies on it being
0 anyway (let's not give impression we can just change this constant).
When flushing a page to disk, call the get_log_address callback to
know up to which LSN the log should be flushed.
As we now can access MARIA_SHARE* we can know share->id and store
it into the checkpoint record; we thus go from 4 bytes per dirty page
to 2+1.
storage/maria/ma_pagecache.h:
get_log_address callback
storage/maria/ma_panic.c:
No reason to reset pagecache callbacks in HA_PANIC_READ:
all we do is reopen files if they were closed; callbacks should
be in place already as 'info' exists; we just want to modify
the file descriptors, not the full PAGECACHE_FILE structure.
If we open data file and it was closed, share->bitmap.file needs
to be set.
Note that the modified code is disabled anyway.
storage/maria/ma_recovery.c:
Checkpoint record does not contain kfile/dfile descriptors anymore
so code can be simplified. Hash key in all_dirty_pages is
not made from file_descriptor & pageno anymore, but
index_or_data & table-short-id & pageno.
If a table's create_rename_lsn is higher than record's LSN,
we skip the table and don't fail if it's corrupted (because the LSNs
say that we don't have to look at this table).
If a table is skipped (for example due to create_rename_lsn),
its UNDOs still cause undo_lsn to advance; this is so that if later
we notice the transaction has to rollback we fail (as table should
not be skipped in this case).
Fixing a bug: the dirty_pages list was never used, because
the LSN below which it was used was the minimum rec_lsn of dirty pages!
It is now the min(checkpoint_start_log_horizon, min(trn's rec_lsn)).
When we disable/reenable transactionality, we modify pagecache
callbacks (needed for example for get_log_address: changing
share->page_type is not enough anymore).
storage/maria/ma_write.c:
'records' and 'checksum' are protected: they are updated under
log's mutex in write-hooks when UNDO is written.
storage/maria/maria_chk.c:
remove use of duplicate functions.
storage/maria/maria_def.h:
set_data|index_pagecache_callbacks() need to be exported;
_ma_reenable_logging_for_table() changes to a real function.
storage/maria/unittest/ma_pagecache_consist.c:
new prototype
storage/maria/unittest/ma_pagecache_single.c:
new prototype
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
new prototype
- Ignore CRC errors in REDO for potential new pages
- Ignore CRC errors when repairing tables
- Don't do readcheck callback on read error
- Set my_errno to HA_ERR_WRONG_CRC if we find page with wrong CRC
- Check index page for length before calculating CRC to catch bad pages
Fixed bugs where we used wrong file descriptor to read/write bitmaps
Fixed wrong hash key in 'files_in_flush'
Fixed wrong lock method when writing bitmap
Fixed some wrong printf statements in check/repair that caused core dumps
Fixed argument to translog_page_validator that cause reading of log files to fail
Store number of bytes used for delete-linked key pages to be able to use standard index CRC for deleted key pages.
Use fast 'dummy' pagecheck callbacks for temporary tables
Don't die silently if flush finds pinned pages
Give error (for now) if one tries to create a transactional table with fulltext or spatial keys
Removed some not needed calls to pagecache_file_init()
Added checking of pagecache checksums to ma_test1 and ma_test2
More DBUG
Fixed some DBUG_PRINT to be in line with rest of the code
include/my_base.h:
Added HA_ERR_INTERNAL_ERROR (used for flush with pinned pages) and HA_ERR_WRONG_CRC
mysql-test/r/binlog_unsafe.result:
Added missing DROP VIEW statement
mysql-test/r/maria.result:
Added TRANSACTIONAL=0 when testing with fulltext keys
Added test that verifies we can't yet create transactional test with fulltext or spatial keys
mysql-test/r/ps_maria.result:
Added TRANSACTIONAL=0 when testing with fulltext keys
mysql-test/t/binlog_unsafe.test:
Added missing DROP VIEW statement
mysql-test/t/maria.test:
Added TRANSACTIONAL=0 when testing with fulltext keys
Added test that verifies we can't yet create transactional test with fulltext or spatial keys
mysql-test/t/ps_maria.test:
Added TRANSACTIONAL=0 when testing with fulltext keys
mysys/my_fopen.c:
Fd: -> fd:
mysys/my_handler.c:
Added new error messages
mysys/my_lock.c:
Fd: -> fd:
mysys/my_pread.c:
Fd: -> fd:
mysys/my_read.c:
Fd: -> fd:
mysys/my_seek.c:
Fd: -> fd:
mysys/my_sync.c:
Fd: -> fd:
mysys/my_write.c:
Fd: -> fd:
sql/mysqld.cc:
Fixed wrong argument to my_uuid_init()
sql/sql_plugin.cc:
Unified DBUG_PRINT (for convert-dbug-for-diff)
storage/maria/ma_bitmap.c:
Fixed wrong lock method when writing bitmap
Fixed valgrind error
Use fast 'dummy' pagecheck callbacks for temporary tables
Faster bitmap handling for non transational tables
storage/maria/ma_blockrec.c:
Fixed that bitmap reading is done with the correct filehandle
Handle reading of pages with wrong CRC when page contect doesn't matter
Use the page buffer also when we get WRONG CRC or FILE_TOO_SHORT. (Faster and fixed a couple of bugs)
storage/maria/ma_check.c:
Split long strings for readablity
Fixed some wrong printf statements that caused core dumps
Use bitmap.file for bitmaps
Ignore pages with wrong CRC
storage/maria/ma_close.c:
More DBUG_PRINT
storage/maria/ma_create.c:
Give error (for now) if one tries to create a crash safe table with fulltext or spatial keys
storage/maria/ma_key_recover.c:
Ignore HA_ERR_WRONG_CRC for new pages
info->s -> share
Store number of bytes used for delete-linked key pages to be able to use standard index CRC for deleted key pages.
storage/maria/ma_loghandler.c:
Fixed argument to translog_page_validator()
storage/maria/ma_open.c:
Removed old VMS specific code
Added function to setup pagecache callbacks
Moved code around to set 'share->temporary' early
Removed some not needed calls to pagecache_file_init()
storage/maria/ma_page.c:
Store number of bytes used for delete-linked key pages to be able to use standard index CRC for deleted key pages.
storage/maria/ma_pagecache.c:
Don't do readcheck callback on read error
Reset PCBLOCK_ERROR in pagecache_unlock_by_link() if we write page
Set my_errno to HA_ER_INTERNAL_ERROR if flush() finds pinned pages
Don't die silently if flush finds pinned pages.
Use correct file descriptor when flushing pages
Fixed wrong hash key in 'files_in_flush'; This must be the file descriptor, not the PAGECACHE_FILE as there may be several PAGECACHE_FILE for same file descriptor
More DBUG_PRINT
storage/maria/ma_pagecrc.c:
Removed inline from not tiny static function
Set my_errno to HA_ERR_WRONG_CRC if we find page with wrong CRC
(Otherwise my_errno may be 0, and a lot of other code will be confused)
CRCerror -> error (to keep code uniform)
Print crc with %lu, as in my_checksum()
uchar* -> uchar *
Check index page for length before calculating CRC to catch bad pages
Added 'dummy' crc_check and filler functions that are used for temporary tables
storage/maria/ma_recovery.c:
More DBUG
More message to users to give information what phase failed
Better error message if recovery failed
storage/maria/ma_test1.c:
Added checking of page checksums (combined with 'c' to not have to add more test runs)
storage/maria/ma_test2.c:
Added checking of page checksums (combined with 'c' to not have to add more test runs)
storage/maria/maria_chk.c:
Fixed wrong argument to _ma_check_print_error()
storage/maria/maria_def.h:
Added format information to _ma_check_print_xxxx functions
uchar* -> uchar *
into desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-callback
storage/maria/Makefile.am:
Auto merged
storage/maria/ma_blockrec.c:
Auto merged
storage/maria/ma_check.c:
Auto merged
storage/maria/ma_create.c:
Auto merged
storage/maria/ma_loghandler.h:
Auto merged
storage/maria/ma_open.c:
Auto merged
storage/maria/ma_page.c:
Auto merged
storage/maria/ma_pagecache.c:
Auto merged
storage/maria/maria_chk.c:
Auto merged
storage/maria/maria_def.h:
Auto merged
storage/maria/unittest/ma_test_loghandler-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_purge-t.c:
Auto merged
storage/maria/ma_bitmap.c:
Merge.
storage/maria/ma_loghandler.c:
Merge.
storage/maria/unittest/Makefile.am:
Merge.
storage/maria/ma_loghandler.c:
Postmerge fix.
New state of the log added to proicess correctly shutdown.
storage/maria/ma_loghandler.h:
New state of the log added to proicess correctly shutdown.
into desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-readonly
storage/maria/ha_maria.cc:
Auto merged
storage/maria/ma_create.c:
Auto merged
storage/maria/ma_open.c:
Auto merged
storage/maria/ma_test1.c:
Auto merged
storage/maria/ma_test2.c:
Auto merged
storage/maria/unittest/ma_test_loghandler-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_purge-t.c:
Auto merged
storage/maria/ma_check.c:
Merge.
storage/maria/ma_loghandler.c:
Merge.
storage/maria/ma_loghandler.h:
Merge.
storage/maria/maria_read_log.c:
Merge.
storage/maria/unittest/Makefile.am:
Merge.
error fixed (switching to the read only mode).
Added read only mode of transactions log handler.
storage/maria/ha_maria.cc:
Transaction log initialization parameters change.
storage/maria/ma_check.c:
New status variable of transactional log.
storage/maria/ma_create.c:
New status variable of transactional log.
storage/maria/ma_loghandler.c:
- New status variable added.
- Checking the status variable in the loghandler
interface functions added
- All fails of loghandler functions revised.
- UNRECOVERABLE_ERROR() removed.
- Switching to read only mode added where it nead.
- Checking of log state added before writes log content
and changing status variables like sent_to_file, n_buffers_only, flushed.
- Readonly loghandler initialization added.
- Fixed problem with example table transactional log initialization.
storage/maria/ma_loghandler.h:
Readonly loghandler initialization added.
Fixed problem with example table transactional log initialization.
New status variable added.
storage/maria/ma_open.c:
New status variable of transactional log.
storage/maria/ma_test1.c:
Transaction log initialization parameters change.
storage/maria/ma_test2.c:
Transaction log initialization parameters change.
storage/maria/maria_read_log.c:
Transaction loghandler initialization in read only mode in
case of only dysplay parameter.
storage/maria/unittest/Makefile.am:
Test of readonly mode added.
storage/maria/unittest/ma_test_loghandler-t.c:
Transaction log initialization parameters change.
Fixed problem with example table transactional log initialization.
Fixed incorrect fprintf call parameters.
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
Transaction log initialization parameters change.
Fixed problem with example table transactional log initialization.
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
Transaction log initialization parameters change.
Fixed problem with example table transactional log initialization.
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Useing this test also as read only loghandler test.
Transaction log initialization parameters change.
Fixed problem with example table transactional log initialization.
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Transaction log initialization parameters change.
Fixed problem with example table transactional log initialization.
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
Transaction log initialization parameters change.
Fixed problem with example table transactional log initialization.
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Transaction log initialization parameters change.
Fixed problem with example table transactional log initialization.
storage/maria/unittest/ma_test_loghandler_purge-t.c:
Transaction log initialization parameters change.
Fixed problem with example table transactional log initialization.
include/my_atomic.h:
transparent_union doesn't work in g++, doesn't work on darwin/ppc64
storage/maria/ma_blockrec.c:
compiler warning
storage/maria/ma_loghandler.c:
compiler warning
storage/maria/ma_page.c:
compiler warning
* fix for bitmap vs checkpoint bug which could lead to corrupted
tables in case of crashes at certain moments: a bitmap could be flushed
to disk even though it was inconsistent with the log (it could be
flushed before REDO-UNDO are written to the log). One bug remains, need
code from others. Tests added. Fix is to pin unflushable bitmap pages,
and let checkpoint wait for them to be flushable.
* fix for long_trid!=0 assertion failure at Recovery.
* less useless wakeups in the background flush|checkpoint thread.
* store global_trid_generator in checkpoint record.
mysql-test/r/maria-recovery.result:
result update
mysql-test/t/maria-recovery.test:
make it easier to locate subtests
storage/maria/ma_bitmap.c:
When we send a bitmap to the pagecache, if this bitmap is not in a
flushable state we keep it pinned and add it to a list, it will be
unpinned when the bitmap is flushable again.
A new function _ma_bitmap_flush_all() used by checkpoint.
A new function _ma_bitmap_flushable() used by block format to signal
when it starts modifying a bitmap and when it is done with it.
storage/maria/ma_blockrec.c:
When starting a row operation (insert/update/delete), mark that
the bitmap is not flushable (because for example INSERT is going
to over-allocate in the bitmap to prevent other threads from using
our data pages). If a checkpoint comes at this moment it will wait
for the bitmap to be flushable before flushing it.
When the operation ends, bitmap becomes flushable again; that
transition is done under the bitmap's mutex (needed for correct
synchro with a concurrent checkpoint); but for INSERT/UPDATE this
happens inside _ma_bitmap_release_unused() at a place where it already
has the mutex, so the only penalty (mutex adding) is in DELETE and UNDO
of INSERT. In case of errors after setting the bitmap unflushable,
we must always set it back to flushable or checkpoint would block.
Debug possibilities to force a sleep while the bitmap is over-allocated.
In case of error in get_head_or_tail() in allocate_and_write_block_record(),
we still need to unpin all pages.
Bugfix: _ma_apply_redo_insert_row_blobs() produced wrong
data_file_length.
storage/maria/ma_blockrec.h:
new bitmap calls.
storage/maria/ma_checkpoint.c:
filter_flush_indirect not needed anymore (flushing bitmap
pages happens in _ma_bitmap_flush_all() now). So
st_filter_param::is_data_file|pages_covered_by_bitmap not needed.
Other filter_flush* don't need to flush bitmap anymore.
Add debug possibility to flush all bitmap pages outside of a checkpoint,
to simulate pagecache LRU eviction.
When the background flush/checkpoint thread notices it has nothing
to flush, it now sleeps directly until the next potential checkpoint
moment instead of waking up every second.
When in checkpoint we decide to not store a table in the checkpoint record
(because it has logged no writes for example), we can also skip flushing
this table.
storage/maria/ma_commit.c:
comment is out-of-date
storage/maria/ma_key_recover.c:
comment fix
storage/maria/ma_loghandler.c:
comment is out-of-date
storage/maria/ma_open.c:
comment is out-of-date
storage/maria/ma_pagecache.c:
comment for bug to fix. And we don't take checkpoints at end of REDO
phase yet so can trust block->type.
storage/maria/ma_recovery.c:
Comments. Now-unneeded code for incomplete REDO-UNDO groups removed.
When we forget about an old transaction we must really forget
about it with bzero() (fixes the "long_trid!=0 assertion" recovery
bug). When we delete a row with maria_delete() we turn on
STATE_NOT_OPTIMIZED_ROWS so we do the same when we see a CLR_END
for an UNDO_ROW_INSERT or when we execute an UNDO_ROW_INSERT (in both
cases a row was deleted). Pick up max_long_trid from the checkpoint record.
storage/maria/maria_chk.c:
comment
storage/maria/maria_def.h:
MARIA_FILE_BITMAP gets new members: 'flushable', 'bitmap_cond' and
'pinned_pages'.
storage/maria/trnman.c:
I used to think that recovery only needs to know the maximum TrID
of the lists of active and committed transactions. But no, sometimes
both lists can even be empty and their TrID should not be reused.
So Checkpoint now saves global_trid_generator in the checkpoint record.
storage/maria/trnman_public.h:
macros to read/store a TrID
mysql-test/r/maria-recovery-bitmap.result:
result is ok. Without the code fix, we would get a corruption message
about the bitmap page in CHECK TABLE EXTENDED.
mysql-test/t/maria-recovery-bitmap-master.opt:
usual when we crash mysqld in tests
mysql-test/t/maria-recovery-bitmap.test:
test of recovery problems specific of the bitmap pages.
into desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-testfail
mysql-test/t/maria-recovery.test:
Auto merged
storage/maria/ma_loghandler.c:
Auto merged
switching to new one which prevent deadlock.
mysql-test/r/maria-purge.result:
Fixed test which use setting maria_checkpoint_interval to force
checkpoint now.
mysql-test/t/maria-purge.test:
Fixed test which use setting maria_checkpoint_interval to force
checkpoint now.
mysql-test/r/maria-big.result:
Change to make maria-purge more stable: increasing file size
to let all records fit in one log.
mysql-test/r/maria-connect.result:
Change to make maria-purge more stable: increasing file size
to let all records fit in one log.
mysql-test/r/maria-purge.result:
Change to make maria-purge more stable.
mysql-test/r/maria.result:
Change to make maria-purge more stable: increasing file size
to let all records fit in one log.
mysql-test/r/ps_maria.result:
Change to make maria-purge more stable: increasing file size
to let all records fit in one log.
mysql-test/t/maria-big.test:
Change to make maria-purge more stable: increasing file size
to let all records fit in one log.
mysql-test/t/maria-connect.test:
Change to make maria-purge more stable: increasing file size
to let all records fit in one log.
mysql-test/t/maria-purge.test:
Change to make maria-purge more stable.
mysql-test/t/maria-recovery.test:
Change to make maria-purge more stable: increasing file size
to let all records fit in one log.
mysql-test/t/maria.test:
Change to make maria-purge more stable: increasing file size
to let all records fit in one log.
mysql-test/t/ps_maria.test:
Change to make maria-purge more stable: increasing file size
to let all records fit in one log.
into mysql.com:/home/my/mysql-maria
storage/maria/ma_blockrec.c:
Auto merged
storage/maria/ma_check.c:
Auto merged
storage/maria/ma_loghandler.c:
Auto merged
storage/maria/maria_def.h:
Auto merged
Cleanup of recent code changes in dbug and my_thr_init
Added name for each safe_mutex (for better DBUG and error reporting)
Fixed that sort_info.max_records is calculated correctly. This fixed a bug in maria_chk
Removed duplicate printing of mutex address in dbug log
dbug/dbug.c:
Cleanup of recent code changes
include/my_pthread.h:
Added name for each safe_mutex (for better DBUG and error reporting)
mysys/my_thr_init.c:
Cleanup of recent code changes
mysys/thr_mutex.c:
Added name for each safe_mutex (for better DBUG and error reporting)
mysys/wqueue.c:
Removed some mutex printing (as it's done now when we take mutex)
storage/maria/Makefile.am:
Fixed that 'make tags' works with xemacs
storage/maria/ma_blockrec.c:
base.min_row_length -> base.min_block_length
(As they where basicly the same variable)
storage/maria/ma_check.c:
Moved more common stuff to initialize_variables_for_repair
Fixed that sort_info.max_records is calculated correctly. This fixed a bug in maria_chk
storage/maria/ma_create.c:
More comments
Fixed that min_pack_length is calculated more correctly
Removed duplicate variable base.min_row_length
storage/maria/ma_loghandler.c:
Removed duplicate printing of mutex address
storage/maria/ma_open.c:
Removed base.min_row_length
storage/maria/ma_packrec.c:
Removed not anymore needed code
(One should not change any .base variables as this will affect repair with unpack)
storage/maria/maria_def.h:
Removed base.min_row_length
When we log UNDO_KEY_INSERT for an auto_inc key, we update
state.auto_increment (not anymore at the end of maria_write() except
if this is a non-transactional table). When Recovery sees UNDO_KEY_INSERT
in the REDO phase, it reads the auto_inc value from it and updates
state.auto_increment.
mysql-test/r/maria-recovery.result:
Without the code fix, there would be in CHECK TABLE:
"Auto-increment value: 0 is smaller than max used value: 3"
and no AUTO_INCREMENT= clause in SHOW CREATE TABLE.
mysql-test/t/maria-recovery.test:
Test of recovery of state.auto_increment: from an old table,
does the replaying of the log set state.auto_increment to
what it should be.
storage/maria/ma_check.c:
new way of calling ma_retrieve_auto_increment(): pass key
storage/maria/ma_key.c:
ma_retrieve_auto_increment() now operates directly with a pointer
to the key and not on the record.
storage/maria/ma_key_recover.c:
dedicated write_hook_for_undo_key_insert(): sets state.auto_increment
under log's mutex.
storage/maria/ma_key_recover.h:
Dedicated hook for UNDO_KEY_INSERT, to set state.auto_increment.
Such hook needs a new member st_msg_write_hook_for_undo_key::auto_increment,
which contains the auto_increment value inserted.
storage/maria/ma_loghandler.c:
UNDO_KEY_INSERT gets a dedicated write_hook, to set auto_increment.
storage/maria/ma_recovery.c:
When in the REDO phase we see UNDO_KEY_INSERT: if the state is older
than this record, and the key is the auto_increment one, read
the key's value from the log record and update state.auto_increment.
storage/maria/ma_test_all.sh:
use $maria_path to be able to run from /dev/shm (faster)
storage/maria/ma_update.c:
bool is more of C++, using my_bool.
If table is transactional, state.auto_increment is already updated
in write_hook_for_undo_key_insert().
storage/maria/ma_write.c:
If table is transactional, state.auto_increment is not updated at
the end of maria_write() but rather in write_hook_for_undo_key_insert()
(under log's mutex, so that a concurrent checkpoint does not read
state.auto_increment while it is changing - corrupted).
_ma_ck_write_btree_with_log() extracts the auto_increment value
from the key, puts it into msg.auto_increment, and this is passed
to write_hook_for_undo_key_insert().
storage/maria/maria_def.h:
change of prototype of ma_retrieve_auto_increment()
storage/maria/maria_read_log.c:
use default log file size. Use separate page caches for table
and logs (needed if maria_block_size!=TRANSLOG_PAGE_SIZE).
into desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-logpurge
storage/maria/ma_checkpoint.c:
Auto merged
storage/maria/ma_loghandler.c:
Auto merged
storage/maria/ma_loghandler.h:
Auto merged
storage/maria/ma_recovery.c:
Auto merged
Added more checks.
storage/maria/ha_maria.cc:
Let control size to my_get_opts().
storage/maria/ma_loghandler.c:
Let control size to my_get_opts().
Removed unused function.
Assert to check log file size.
Additional compilation warnings.
storage/maria/ma_loghandler.h:
New log size bounds.
Removed unused function.
storage/maria/unittest/ma_test_loghandler-t.c:
Fixed test to confirm new log size bounds.
fix for bug: if a crash happened right after writing a REDO like this:
REDO - UNDO - REDO*, then recovery would ignore the last REDO* (ok),
rollback: REDO - UNDO - REDO* - REDO - CLR, and a next recovery would
thus execute REDO* instead of skipping it again. Recovery now logs
LOGREC_INCOMPLETE_GROUP when it meets REDO* for the first time,
to draw a boundary and ensure it is always skipped. Tested by hand.
Note: ma_test_all fails "maria_chk: error: Key 1 - Found too many records"
not due to this patch (failed before).
BitKeeper/triggers/post-commit:
no truncation of the commit mail, or how to review patches?
mysql-test/include/maria_verify_recovery.inc:
let caller choose the statement used to crash (sometimes we
want the crash to happen at special places)
mysql-test/t/maria-recovery.test:
user of maria_verify_recovery.inc now specifies statement which the
script should use for crashing.
storage/maria/ma_bitmap.c:
it's easier to search for all places using functions from the bitmap
module (like in ma_blockrec.c) if those exported functions all start
with "_ma_bitmap": renaming some of them.
Assertion that when we read a bitmap page, overwriting bitmap->map,
we are not losing information (i.e. bitmap->changed is false).
storage/maria/ma_blockrec.c:
update to new names. Adding code (disabled, protected by a #ifdef)
that I use to test certain crash scenarios (more to come).
storage/maria/ma_blockrec.h:
update to new names
storage/maria/ma_checkpoint.c:
update to new names
storage/maria/ma_extra.c:
update to new names
storage/maria/ma_loghandler.c:
new LOGREC_INCOMPLETE_GROUP
storage/maria/ma_loghandler.h:
new LOGREC_INCOMPLETE_GROUP
storage/maria/ma_recovery.c:
When at the end of the REDO phase we have identified some transactions
with incomplete REDO groups (REDOs without an UNDO or CLR_END),
for each of them we log LOGREC_INCOMPLETE_GROUP. This way, the
upcoming UNDO phase can write more records for such transaction,
a future recovery won't pair the incomplete group with the
CLR_END (as there is LOGREC_INCOMPLETE_GROUP to draw a boundary).
into mysql.com:/home/my/mysql-maria
storage/maria/ma_blockrec.c:
Auto merged
storage/maria/ma_loghandler.c:
Auto merged
storage/maria/ma_loghandler.h:
Auto merged
Changed info->s -> share to get more efficent code
Updated arguments to page accessor functions to use MARIA_SHARE * instead of MARIA_HA *.
Tested running tests in quick mode (no balance page on insert and only when critical on delete)
Fixed bug in underflow handling in quick mode
Fixed bug in log handler where it accessed not initialized variable
Fixed bug in log handler where it didn't free mutex in unlikely error condition
Removed double write of page in case of of some underflow conditions
Added DBUG_PRINT in safemutex lock/unlock
dbug/dbug.c:
Compile without SAFE_MUTEX (to be able to use DBUG_PRINT in safe_mutex code)
Use calls to get/set my_thread_var->dbug. (Make dbug independent of compile time options for mysys)
include/my_pthread.h:
Added prototypes for my_thread_var_get_dbug() & my_thread_var_set_dbug()
mysql-test/lib/mtr_report.pl:
Don't check warnings in log files if we are using --extern
mysys/my_thr_init.c:
Added my_thread_var_get_dbug() & my_thread_var_set_dbug()
mysys/thr_mutex.c:
Added DBUG printing of addresses to mutex for lock/unlock
storage/maria/ma_blockrec.c:
Fixed comment
storage/maria/ma_check.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_close.c:
Indentation fixes
storage/maria/ma_create.c:
Calculate min_key_length correctly
storage/maria/ma_dbug.c:
Indentation fixes
storage/maria/ma_delete.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
Removed some writing of key pages that underflow (will be written by caller)
Fixed crashing bug in underflow handling when using quick mode
storage/maria/ma_delete_all.c:
Indentation fixes
storage/maria/ma_dynrec.c:
Indentation fixes
storage/maria/ma_extra.c:
Fixed indentation
Removed old useless code
Reset share->changed if we have written state
storage/maria/ma_ft_update.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_info.c:
Indentation fixes
storage/maria/ma_key_recover.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_locking.c:
Indentation fixes
storage/maria/ma_loghandler.c:
Removed wrapper functions translog_mutex_lock and translog_mutex_unlock (safemutex now does same kind of printing)
Renamed LOGREC_REDO_INSERT_ROW_BLOB to LOGREC_REDO_INSERT_NOT_USED to mark it free
Fixed some DBUG_PRINT to ensure that convert-dbug-for-diff works
Fixed bug in translog_flush() that caused log to stop syncing to disk
Added missing mutex_unlock in case of error
storage/maria/ma_loghandler.h:
Renamed LOGREC_REDO_INSERT_ROW_BLOB to LOGREC_REDO_INSERT_NOT_USED to mark it free
storage/maria/ma_open.c:
Indentation fixes
storage/maria/ma_packrec.c:
Indentation fixes
storage/maria/ma_page.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
Added check that we never write a key page without content (except in recovery where a key page may temporary be without content)
storage/maria/ma_preload.c:
Updated arguments to page accessor functions
storage/maria/ma_range.c:
Updated arguments to page accessor functions
storage/maria/ma_rkey.c:
Indentation fixes
storage/maria/ma_rprev.c:
Indentation fixes
storage/maria/ma_rt_index.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_rt_index.h:
Updated arguments to page accessor functions
storage/maria/ma_rt_key.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_rt_mbr.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_rt_split.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_search.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/ma_sort.c:
Indentation fixes
storage/maria/ma_statrec.c:
Indentation fixes
storage/maria/ma_test1.c:
Added extra undo test
Flush also keys in -u1, to ensure that the full log is flushed
storage/maria/ma_test2.c:
Added extra undo test
Flush also keys in -u1, to ensure that the full log is flushed
storage/maria/ma_test_recovery.expected:
Updated results
storage/maria/ma_test_recovery:
Added extra undo test
storage/maria/ma_update.c:
Indentation fixes
storage/maria/ma_write.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
Prepare for quick mode for insert (don't balance page)
storage/maria/maria_chk.c:
Added MARIA_SHARE *share to a lot of places to make code simpler
info->s -> share
Updated arguments to page accessor functions
storage/maria/maria_def.h:
Updated arguments to page accessor functions
into desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-logpurge
mysql-test/r/maria.result:
Auto merged
storage/maria/ma_checkpoint.c:
Auto merged
storage/maria/ma_recovery.c:
Auto merged
storage/maria/ha_maria.cc:
Merge
storage/maria/ma_loghandler.c:
Merge
storage/maria/ma_loghandler.h:
Merge
support added to maria.
mysql-test/r/maria.result:
New variables added.
storage/maria/ha_maria.cc:
Variable for transactional log purge method added.
Variable for transactional log size added.
SHOW for engine logs added.
Log flush purge logs in case of "ondemand" type of
log processing.
storage/maria/ma_checkpoint.c:
log purge call enabled.
storage/maria/ma_loghandler.c:
Support for different methods of log purge added.
Functions for getting information about logs state added.
Functions for getting/setting log size.
storage/maria/ma_loghandler.h:
Fixed defines.
Functions for for transactional log mannegment added.
storage/maria/ma_recovery.c:
Dependence on TRANSLOG_FILE_SIZE removed.
mysql-test/r/maria-purge.result:
New BitKeeper file ``mysql-test/r/maria-purge.result''
mysql-test/t/maria-purge.test:
New BitKeeper file ``mysql-test/t/maria-purge.test''
storage/maria/ma_loghandler.c:
translog_lock() made safe (non-mutex-protected operation is atomic now).
Fixed translog_destroy() because it will not work to be
called several times.
storage/maria/ma_blockrec.c:
Layout fix.
storage/maria/ma_loghandler.c:
Renamed struct variable 'class' to avoid problems with c++ compiler.
Renamed translog_init_scanner to fit othere init functions naming pattern.
translog_relative_LSN_encode can't return error for now.
Other trivial postreview changes.
storage/maria/ma_loghandler_lsn.h:
trivial postreview changes.
storage/maria/ma_recovery.c:
Renamed translog_init_scanner to fit othere init functions naming pattern.
storage/maria/unittest/ma_loghandler_examples.c:
Renamed struct variable 'class' to avoid problems with c++ compiler.
storage/maria/unittest/ma_test_loghandler-t.c:
Renamed translog_init_scanner to fit othere init functions naming pattern.
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Renamed translog_init_scanner to fit othere init functions naming pattern.
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Renamed translog_init_scanner to fit othere init functions naming pattern.
Fixed overlaying block waiting during flushing block.
Sync directory only is file size really changed.
Fixed bug in the flush function when we access data
in file cache and horizon value without mutex protection.
into mysql.com:/home/my/mysql-maria
storage/maria/ha_maria.cc:
Auto merged
storage/maria/ma_loghandler.c:
Auto merged
storage/maria/ma_loghandler.h:
Auto merged
storage/maria/unittest/ma_test_loghandler-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Auto merged
storage/maria/unittest/ma_test_loghandler_purge-t.c:
Auto merged
storage/maria/unittest/test_file.c:
Auto merged
storage/maria/unittest/ma_pagecache_single.c:
SCCS merged
Added debugger hook _my_dbug_put_break_here() that is called if we get a CRC that matches --debug-crc-break (my_crc_dbug_break)
Fixed REDO_REPAIR to use all repair modes (repair, repair_by_sort, repair_paralell
REDO_REPAIR now also logs used key map
Fixed some bugs in REDO logging of key pages
Better error messages from maria_read_log
Added my_readwrite_flags to init_pagecache() to be able to get better error messages and simplify code.
Don't allow pagecaches with less than 8 blocks (Causes strange crashes)
Added EXTRA_DEBUG_KEY_CHANGES. When this is defined some REDO_INDEX entries contains page checksums (these are calculated and checked in DBUG mode, ignored otherwise)
Fixed bug in ma_pagecache unit tests that caused program to sometimes fail
Added some missing calls to MY_INIT() that caused some unit tests to fail
Fixed that TRUNCATE works properly on temporary MyISAM files
Updates some result files to new table checksums results (checksum when NULL fields are ignored)
perl test-insert can be replayed with maria_read_log!
sql/share/Makefile.am:
Change mode to -rw-rw-r--
BitKeeper/etc/ignore:
added storage/maria/unittest/page_cache_test_file_1 storage/maria/unittest/pagecache_debug.log
include/maria.h:
Added maria_tmpdir
include/my_base.h:
Added error HA_ERR_FILE_TOO_SHORT
include/my_sys.h:
Added variable my_crc_dbug_check
Added function my_dbug_put_break_here()
include/myisamchk.h:
Added org_key_map (Needed for writing REDO record for REPAIR)
mysql-test/r/innodb.result:
Updated to new checksum algorithm (NULL ignored)
mysql-test/r/mix2_myisam.result:
Updated to new checksum algorithm (NULL ignored)
mysql-test/r/myisam.result:
Updated to new checksum algorithm (NULL ignored)
mysql-test/t/myisam.test:
Added used table
mysys/checksum.c:
Added DBUG for checksum results
Added debugger hook so that _my_dbug_put_break_here() is called if we get matching CRC
mysys/lf_alloc-pin.c:
Fixed compiler warning
mysys/my_handler.c:
Added new error message
mysys/my_init.c:
If my_progname is not given, use 'unknown' form my_progname_short
Added debugger function my_debug_put_break_here()
mysys/my_pread.c:
In case of too short file when MY_NABP or MY_FNABP is specified, give error HA_ERR_FILE_TO_SHORT
mysys/my_read.c:
In case of too short file when MY_NABP or MY_FNABP is specified, give error HA_ERR_FILE_TO_SHORT
sql/mysqld.cc:
Added debug option --debug-crc-break
sql/sql_parse.cc:
Trivial optimization
storage/maria/ha_maria.cc:
Renamed variable to be more logical
Ensure that param.testflag is correct when calling repair
Added extra argument to init_pagecache
Set default value for maria_tempdir
storage/maria/ma_blockrec.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
storage/maria/ma_cache.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
storage/maria/ma_check.c:
Set param->testflag to match how repair is run (needed for REDO logging)
Simple optimization
Moved flag if page is node from pagelength to keypage-flag byte
Log used key map in REDO log.
storage/maria/ma_delete.c:
Remember previous UNDO entry when writing undo (for future CLR records)
Moved flag if page is node from pagelength to keypage-flag byte
Fixed some bugs in redo logging
Added CRC for some translog REDO_INDEX entries
storage/maria/ma_dynrec.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
storage/maria/ma_ft_update.c:
Fixed call to _ma_store_page_used()
storage/maria/ma_key_recover.c:
Added CRC for some translog REDO_INDEX entries
Removed not needed pagecache_write() in _ma_apply_redo_index()
storage/maria/ma_locking.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
storage/maria/ma_loghandler.c:
Added used key map to REDO_REPAIR_TABLE
storage/maria/ma_loghandler.h:
Added operation for checksum of key pages
storage/maria/ma_open.c:
Allocate storage for undo lsn pointers
storage/maria/ma_pagecache.c:
Remove not needed include file
Change logging to use fd: for file descritors as other code
Added my_readwrite_flags to init_pagecache() to be able to get better error messages for maria_chk/maria_read_log
Don't allow pagecaches with less than 8 blocks
Remove wrong DBUG_ASSERT()
storage/maria/ma_pagecache.h:
Added readwrite_flags
storage/maria/ma_recovery.c:
Better error messages for maria_read_log:
- Added eprint() for printing error messages
- Print extra \n before error message if we are printing %0 %10 ...
Added used key_map to REDO_REPAIR log entry
More DBUG
Call same repair method that was used by mysqld
storage/maria/ma_rt_index.c:
Moved flag if page is node from pagelength to keypage-flag byte
storage/maria/ma_rt_key.c:
Fixed call to _ma_store_page_used()
storage/maria/ma_rt_split.c:
Moved flag if page is node from pagelength to keypage-flag byte
storage/maria/ma_static.c:
Added maria_tmpdir
storage/maria/ma_test1.c:
Updated call to init_pagecache()
storage/maria/ma_test2.c:
Updated call to init_pagecache()
storage/maria/ma_test3.c:
Updated call to init_pagecache()
storage/maria/ma_write.c:
Removed #ifdef NOT_YET
Moved flag if page is node from pagelength to keypage-flag byte
Fixed bug in _ma_log_del_prefix()
storage/maria/maria_chk.c:
Fixed wrong min limit for page_buffer_size
Updated call to init_pagecache()
storage/maria/maria_def.h:
Added EXTRA_DEBUG_KEY_CHANGES. When this is defined some REDO_INDEX entries contains page checksums
Moved flag if page is node from pagelength to keypage-flag byte
storage/maria/maria_ftdump.c:
Updated call to init_pagecache()
storage/maria/maria_pack.c:
Updated call to init_pagecache()
Reset share->state.create_rename_lsn & share->state.is_of_horizon
storage/maria/maria_read_log.c:
Better error messages
Added --tmpdir option (needed to set temporary directory for REDO_REPAIR)
Added --start-from-lsn
Changed option for --display-only to 'd' (wanted to use -o for 'offset')
storage/maria/unittest/lockman2-t.c:
Added missing call to MY_INIT()
storage/maria/unittest/ma_pagecache_consist.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_pagecache_single.c:
Fixed bug that caused program to sometimes fail
Added some DBUG_ASSERTS()
Changed some calls to malloc()/free() to my_malloc()/my_free()
Create extra file to expose original hard-to-find bug
storage/maria/unittest/ma_test_loghandler-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_purge-t.c:
Updated call to init_pagecache()
storage/maria/unittest/test_file.c:
Changed malloc()/free() to my_malloc()/my_free()
Fixed memory leak
Changd logic a bit while trying to find bug in reset_file()
storage/maria/unittest/trnman-t.c:
Added missing call to MY_INIT()
storage/myisam/mi_cache.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
storage/myisam/mi_create.c:
Removed O_EXCL to get TRUNCATE to work for temporary files
storage/myisam/mi_dynrec.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
storage/myisam/mi_locking.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
mysql-test/r/old-mode.result:
New BitKeeper file ``mysql-test/r/old-mode.result''
mysql-test/t/old-mode-master.opt:
New BitKeeper file ``mysql-test/t/old-mode-master.opt''
mysql-test/t/old-mode.test:
New BitKeeper file ``mysql-test/t/old-mode.test''
Part of postreview fixes added.
mysql-test/r/maria.result:
Added variable to control log directory syncs.
storage/maria/ha_maria.cc:
Added variable to control log directory syncs.
storage/maria/ma_loghandler.h:
Added variable to control log directory syncs.
storage/maria/ma_loghandler_lsn.h:
postreview fix
storage/maria/unittest/Makefile.am:
New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler-t.c:
New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_purge-t.c:
New file with logrecord descriptors for tests.
storage/maria/unittest/ma_loghandler_examples.c:
New BitKeeper file ``storage/maria/unittest/ma_loghandler_examples.c''
Fix of unit tests.
2 new tests for new features.
storage/maria/ma_control_file.c:
Getting the definition from the file for unit-test.
storage/maria/ma_loghandler.c:
Fix bug with skipped syncing.
storage/maria/unittest/ma_control_file-t.c:
Fix of unit test of control file.
2 new tests for new features of control file.
Fixed bugs in undo logging
Fixed bug where head block was split before min_row_length (caused Maria to believe row was crashed on read)
Reserved place for reference-transid on key pages (for packing of transids)
ALTER TABLE and INSERT ... SELECT now uses fast creation of index
Known bugs:
ma_test_recovery fails because of a bug in redo handling when log is cut directly after a redo (Guilhem knows how to fix)
ma_test_recovery.excepted is not totally correct, because of the above bug
mysqld sometimes fails to restart; Fails with error "end_of_redo_phase: Assertion `long_trid != 0' failed"; Guilhem to investigate
include/maria.h:
Prototype changes
Added current_filepos to st_maria_sort_info
mysql-test/r/maria.result:
Updated results that changes as alter table and insert ... select now uses fast creation of index
mysys/mf_iocache.c:
Reset variable to gurard against double invocation
storage/maria/ma_bitmap.c:
Added _ma_bitmap_reset_cache() (needed for repair)
storage/maria/ma_blockrec.c:
Simplify code
More initial allocations
Fixed bug where head block was split before min_row_length (caused Maria to believe row was crashed on read)
storage/maria/ma_blockrec.h:
Moved TRANSID_SIZE to maria_def.h
Added prototype for new functions
storage/maria/ma_check.c:
Simplicy code
Fixed repair_by_sort to work with BLOCK_RECORD
- When using BLOCK_RECORD or UNPACK create new Maria handle
- Use common initializer function
- Align code with maria_repair()
Made some changes to maria_repair_parallel() to use common initializer function
Removed ASK_MONTY section by fixing noted problem
storage/maria/ma_close.c:
Moved check for readonly to _ma_state_info_write()
storage/maria/ma_key_recover.c:
Use different log entries if key root changes or not.
This fixed some bugs when tree grows
storage/maria/ma_key_recover.h:
Added keynr to st_msg_to_write_hook_for_undo_key
storage/maria/ma_loghandler.c:
Added INIT_LOGREC_UNDO_KEY_INSERT_WITH_ROOT
storage/maria/ma_loghandler.h:
Added INIT_LOGREC_UNDO_KEY_INSERT_WITH_ROOT
storage/maria/ma_open.c:
Added TRANSID to all key pages (for future compressing of trans id's)
For compressed records, alloc a bit bigger buffer to avoid valgrind warnings
If table is opened readonly, don't update state
storage/maria/ma_packrec.c:
Allocate bigger array for bit unpacking to avoid valgrind errors
storage/maria/ma_recovery.c:
Added UNDO_KEY_INSERT_WITH_ROOT & UNDO_KEY_DELETE_WITH_ROOT
storage/maria/ma_sort.c:
More logging
storage/maria/ma_test_all.sh:
More tests
storage/maria/ma_test_recovery.expected:
Update results
Note that this is not complete becasue of a bug in recovery
storage/maria/ma_test_recovery:
Removed recreation of index (not needed when we have redo for index pages)
storage/maria/maria_chk.c:
When using flag --read-only, don't update status for files
When using --unpack, don't use REPAIR_BY_SORT if other repair option is given
Enable repair_by_sort for BLOCK records
Removed not needed newline at start of --describe
storage/maria/maria_def.h:
Support for TRANSID_SIZE to key pages
storage/maria/maria_read_log.c:
renamed --only-display to --display-only
Changed bitmaps to be written before unpinning of pages in write_block_record()
Log handler now assumes we never call it for not transactional tables
Fixed bug in ma_test_all that caused it to fail
sql/unireg.cc:
Removed 'at', as this makes it hard to find valgrind errors from the debug log
storage/maria/ma_blockrec.c:
Changed bzero() of blocks to get rid of a (non critical) valgrind error
Changed bitmaps to be written before unpinning of pages in write_block_record()
fixed that we don't log tails if table isn't transactional
storage/maria/ma_key_recover.c:
Fixed wrong log_data[] that caused us to log uninitialized data
storage/maria/ma_loghandler.c:
Replaced not needed test with DBUG_ASSERT()
storage/maria/ma_test_all.sh:
Remove control file if block size changes
New extendable format for maria_log_control file
Fixed some compiler warnings
include/maria.h:
Added maria_disable_logging() and maria_enable_logging()
mysql-test/include/maria_verify_recovery.inc:
Updated tests now when key redo/undo works
mysql-test/r/maria-recovery.result:
Updated tests now when key redo/undo works
storage/maria/ma_blockrec.c:
Use unified CLR code
Added rec_lsn for full pages
Moved clr write hook to ma_key_recover.c
Changed REDO code to keep pages pinned until undo
Mark page_link's as changed
storage/maria/ma_blockrec.h:
Moved write_hook_for_clr_end() to ma_key_recover.c
storage/maria/ma_check.c:
Changed key check code to use PAGECACHE_READ_UNKNOWN_PAGE
Fixed wrong warning when checking files after maria_pack
When unpacking files, we have to use new keypos_to_recpos method
When doing repair, we can disregard index key file pages in page cache
storage/maria/ma_commit.c:
Added simple enable/disable logging functions
(Needed for recovery)
storage/maria/ma_control_file.c:
Make maria control file extendable without having to make it incompatible for older versions
storage/maria/ma_control_file.h:
New error messages
Added CONTROL_FILE_VERSION
storage/maria/ma_delete.c:
Added redo/undo for key pages
change_length -> changed_length to make things similar
More comments & more DBUG
storage/maria/ma_key_recover.c:
Unified CLR method
Moved here write_hook_for_clr_end() and common keypage log functions
Changed REDO to keep pages pinned until undo
Changed UNDO code to change key_root under log mutex
storage/maria/ma_key_recover.h:
New structures and functions
storage/maria/ma_loghandler.c:
Include needed files
storage/maria/ma_open.c:
Change maria_open() to use pread() instead of read()
storage/maria/ma_page.c:
Fixed bug in key_del handling
Clear pages if IDENTICAL_PAGES_AFTER_RECOVERY is defined
storage/maria/ma_pagecache.c:
Indentation and spelling fixes
More DBUG
Added helper function: pagecache_block_link_to_buffer()
storage/maria/ma_pagecache.h:
Added pagecache_block_link_to_buffer()
storage/maria/ma_recovery.c:
Fixed state.changed
Fixed that REDO keeps pages pinned until UNDO
Some bug fixes from previous commit
Fixes for UNDO/REDO of key pages
storage/maria/ma_search.c:
Fixed packing and storing of keys to provide more information to caller so
that we can do efficent REDO logging of the changes.
storage/maria/ma_test1.c:
Fixed bug with not initialized variable
storage/maria/ma_test2.c:
Removed not used code
storage/maria/ma_test_all.res:
Updated results
storage/maria/ma_test_all.sh:
Changed one test to test more
Removed timing tests as not relevant here
storage/maria/ma_test_recovery.expected:
Updated test result after redo/undo if key pages works
storage/maria/ma_test_recovery:
Updated test after redo/undo if key pages works
storage/maria/ma_write.c:
Moved some general log functions to ma_key_recover.c
Fixed some bugs in undo
Moved ma_log_split() to _ma_split_page()
Small changes in some function arguments to be able to do redo logging
storage/maria/maria_chk.c:
disable logging while doing repair table
storage/maria/maria_def.h:
New function prototypes
Move some structs and functions to ma_key_recover.c
storage/maria/unittest/ma_control_file-t.c:
Updated with patch from Sanja
NOTE: This is not complete and need to be updated to new control file format
storage/maria/unittest/ma_test_loghandler-t.c:
Fixed compiler warning
into mysql.com:/home/my/mysql-maria
storage/maria/ha_maria.cc:
Auto merged
storage/maria/ma_bitmap.c:
Auto merged
storage/maria/ma_checkpoint.c:
Auto merged
storage/maria/ma_close.c:
Auto merged
storage/maria/ma_loghandler.c:
Auto merged
storage/maria/ma_loghandler.h:
Auto merged
storage/maria/ma_open.c:
Auto merged
storage/maria/ma_pagecache.h:
Auto merged
storage/maria/ma_write.c:
Auto merged
storage/maria/maria_def.h:
Auto merged
storage/maria/unittest/ma_pagecache_single.c:
Auto merged
storage/maria/ma_blockrec.c:
Manual merge
storage/maria/ma_page.c:
Manual merge
storage/maria/ma_pagecache.c:
Manual merge
storage/maria/ma_preload.c:
Manual merge
storage/maria/ma_recovery.c:
Manual merge
Add _ma_unpin_all_pages() to all new UNDO redo_exec_hook's