summaryrefslogtreecommitdiff
path: root/storage/innobase/ibuf
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/10.0' into 10.0Sergei Golubchik2015-02-221-1/+1
|\
| * innodb 5.6.23Sergei Golubchik2015-02-181-1/+1
| |
* | Merge branch '5.5' into 10.0Sergei Golubchik2015-02-181-0/+8
|\ \ | |/ |/|
| * MDEV-7139: Sporadic failure in innodb.innodb_corrupt_bit on P8Jan Lindström2015-02-091-0/+8
| | | | | | | | | | | | The testcase fails randomly due to ibuf merge happening in the background. Fix not to do any merges with ibuf_debug enabled.
| * Merge fix for BUG#17446090 from mysql-5.1 to mysql-5.5Satya Bodapati2013-09-271-5/+6
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The testcase for this bug fails randomly due to two reasons. 1. Due to ibuf merge happening background 2. Due to dict stats update which brings the evicted page back into buffer pool. Fix ibuf_contract_ext() to not do any merges with ibuf_debug enabled and also changed dict_stats_update() to return fake statistics without bringing the secondary index pages into buffer pool. Approved by Marko. rb#3419
| * \ Merge fix for BUG#16752251 from mysql-5.1 to mysql-5.5Satya Bodapati2013-09-111-0/+18
| |\ \ | | |/
| | * Bug#16752251 - INNODB DOESN'T REDO-LOG INSERT BUFFER MERGE OPERATION IFSatya Bodapati2013-09-111-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IT IS DONE IN-PLACE With change buffer enabled, InnoDB doesn't write a transaction log record when it merges a record from the insert buffer to an secondary index page if the insertion is performed as an update-in-place. Fixed by logging the 'update-in-place' operation on secondary index pages. Approved by Marko. rb#2429
| | * Bug #16806366 BOGUS CALL TO LOCK_REC_RESTORE_FROM_PAGE_INFIMUM IN Annamalai Gurusami2013-05-161-12/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INSERT BUFFER MERGE Problem: When the record is merged from the change buffer to the actual page, in a particular condition, it is assumed that the deleted rec will be re-used by the inserted rec. With this assumption the lock is restored on the pointer to the deleted rec itself, thinking that it is pointing to the newly inserted rec. Solution: Just before restoring the lock, update the rec pointer to point to the newly inserted record. An assert has been added to verify this. This assert will fail without the fix and will pass with the fix. rb#2449 in review by Marko and Jimmy
* | | InnoDB 5.6.22Sergei Golubchik2015-01-211-2/+2
| | |
* | | innodb 5.6.17Sergei Golubchik2014-05-071-2/+3
| | |
* | | InnoDB 5.6.15 merge.Sergei Golubchik2014-02-261-8/+20
| | | | | | | | | | | | update test results
* | | MDEV-5574 Set AUTO_INCREMENT below max value of column.Sergei Golubchik2014-02-011-50/+92
| | | | | | | | | | | | | | | | | | | | | Update InnoDB to 5.6.14 Apply MySQL-5.6 hack for MySQL Bug#16434374 Move Aria-only HA_RTREE_INDEX from my_base.h to maria_def.h (breaks an assert in InnoDB) Fix InnoDB memory leak
* | | 10.0-base mergeSergei Golubchik2013-12-161-3/+0
|\ \ \ | |/ /
| * | Bug#17228383: VALGRIND WARNING IN IBUF_DELETE_RECMattias Jonsson2013-08-121-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since the mtr_t struct is marked as invalid in DEBUG_VALGRIND build during mtr_commit, checking mtr->inside_ibuf will cause this warning. Also since mtr->inside_ibuf cannot be set in mtr_commit (assert check) and mtr->state is set to MTR_COMMITTED, the 'ut_ad(!ibuf_inside(&mtr))' check is not needed if 'ut_ad(mtr.state == MTR_COMMITTED)' is also checked.
| * | Fixing a compiler warning issue. At the end of the functionAnnamalai Gurusami2013-05-161-0/+1
| | | | | | | | | | | | | | | ibuf_insert_to_index_page_low() add a DBUG_RETURN(NULL).
| * | Merge from mysql-5.1 to mysql-5.5Annamalai Gurusami2013-05-161-12/+24
| |\ \
| | * | Bug #16806366 BOGUS CALL TO LOCK_REC_RESTORE_FROM_PAGE_INFIMUM IN Annamalai Gurusami2013-05-161-12/+46
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INSERT BUFFER MERGE Problem: When the record is merged from the change buffer to the actual page, in a particular condition, it is assumed that the deleted rec will be re-used by the inserted rec. With this assumption the lock is restored on the pointer to the deleted rec itself, thinking that it is pointing to the newly inserted rec. Solution: Just before restoring the lock, update the rec pointer to point to the newly inserted record. An assert has been added to verify this. This assert will fail without the fix and will pass with the fix. rb#2449 in review by Marko and Jimmy
| * | Bug#16409715 ASSERT SYNC_THREAD_LEVELS_G(ARRAY, LEVEL - 1, TRUE),Marko Mäkelä2013-03-121-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IBUF, FREE SPACE MANAGEMENT ibuf_merge_or_delete_for_page(): Declare the user index page latched for UNIV_SYNC_DEBUG after opening the change buffer cursor. This should avoid the bogus latching order violation. ibuf_delete_rec(): Add assertions to the callers, checking that the mini-transaction was committed when the function returned TRUE. This is a non-functional change, just clarifying the code. rb#2136 approved by Kevin Lewis
| * | Bug#16183892 - INNODB PURGE BUFFERING IS NOT CRASH-SAFESatya Bodapati2013-01-281-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With innodb_change_buffering enabled, Innodb buffers all modifications to secondary index leaf pages when the leaf pages are not in buffer pool. Crash InnoDB while an IBUF_OP_DELETE is being applied. Restart and note that the same record can be applied again which may lead to crash. Mark the change buffer record processed, so that it will not be merged again in case the server crashes between the following mtr_commit() and the subsequent mtr_commit() of deleting the change buffer record. Testcase: No testcase because it is difficult to get the timing right with the two asyncronous task purge and change buffering Approved by Marko. rb#1893
* | | Temporary commit of 10.0-mergeMichael Widenius2013-03-261-65/+404
| | |
* | | 10.0-base mergeSergei Golubchik2013-01-311-7/+37
|\ \ \ | |/ /
| * | Merge mysql-5.1 to mysql-5.5.Marko Mäkelä2012-09-191-2/+32
| |\ \ | | |/
| | * Bug#14636528 INNODB CHANGE BUFFERING IS NOT ENTIRELY CRASH-SAFEMarko Mäkelä2012-09-191-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Delete-mark change buffer records when resorting to a pessimistic delete from the change buffer B-tree. Skip delete-marked records in the change buffer merge and when estimating whether an operation can be buffered. Without this fix, we could try to apply the same buffered changes multiple times if the server was killed at the right moment. In MySQL 5.5 and later: ibuf_get_volume_buffered_count_func(): Ignore delete-marked (already processed) records. ibuf_delete_rec(): Add a crash point before optimistic delete. If the optimistic delete fails, flag the record processed before mtr_commit(). ibuf_merge_or_delete_for_page(): Ignore delete-marked (already processed) records. Backport to 5.1: Rename btr_cur_del_unmark_for_ibuf() to btr_cur_set_deleted_flag_for_ibuf() and add a parameter. rb:1307 approved by Jimmy Yang
| * | Merge mysql-5.1 to mysql-5.5.Marko Mäkelä2012-09-171-2/+2
| |\ \ | | |/
* | | merge with 5.5Sergei Golubchik2012-11-031-5/+12
|\ \ \ | |/ /
| * | Merge mysql-5.1 to mysql-5.5.Marko Mäkelä2012-08-211-5/+12
| |\ \ | | |/
* | | Temporary commit of merge of MariaDB 10.0-base and MySQL 5.6Michael Widenius2012-08-011-268/+136
|/ /
* | merge from 5.1Inaam Rana2012-03-151-3/+3
|\ \ | |/
* | Merge mysql-5.1 to mysql-5.5.Marko Mäkelä2012-02-171-26/+22
|\ \ | |/
* | Bug #13651627 Move ut_ad(0) from the beginning to the end of buf_page_print(),Marko Mäkelä2012-02-021-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | print page dump buf_page_print(): Remove the ut_ad(0) from the beginning. Add two flags (enum buf_page_print_flags) that can be bitwise-ORed together: BUF_PAGE_PRINT_NO_CRASH: Do not crash debug builds at the end of buf_page_print(). BUF_PAGE_PRINT_NO_FULL: Do not print the full page dump. This can be useful when adding diagnostic printout to flushing or to the doublewrite buffer. trx_sys_doublewrite_init_or_restore_page(): Replace exit(1) with ut_error, so that we can get a core dump if this extraordinary condition happens. rb:924 approved by Sunny Bains
* | BUG 13413535 followup: Fix gcc warningJorgen Loland2012-01-261-2/+2
| | | | | | | | | | storage/innobase/ibuf/ibuf0ibuf.c: Cast to avoid gcc warning
* | Bug #13413535 61104: INNODB: FAILING ASSERTION: PAGE_GET_N_RECS(PAGE) > 1Marko Mäkelä2012-01-261-10/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix does not remove the underlying cause of the assertion failure. It just works around the problem, allowing a corrupted secondary index to be fixed by DROP INDEX and CREATE INDEX (or in the worst case, by re-creating the table). ibuf_delete(): If the record to be purged is the last one in the page or it is not delete-marked, refuse to purge it. Instead, write an error message to the error log and let a debug assertion fail. ibuf_set_del_mark(): If the record to be delete-marked is not found, display some more information in the error log and let a debug assertion fail. row_undo_mod_del_unmark_sec_and_undo_update(), row_upd_sec_index_entry(): Let a debug assertion fail when the record to be delete-marked is not found. buf_page_print(): Add ut_ad(0) so that corruption will be more prominent in stress testing with debug binaries. Add ut_ad(0) here and there where corruption is noticed. btr_corruption_report(): Display some data on page_is_comp() mismatch. btr_assert_not_corrupted(): A wrapper around btr_corruption_report(). Assert that page_is_comp() agrees with the table flags. rb:911 approved by Inaam Rana
* | Merge mysql-5.1 to mysql-5.5.Marko Mäkelä2012-01-161-2/+10
|\ \ | |/
| * Bug#13496818 ASSERTION: REC_PAGE_NO > 4 IN IBUF CONTRACTIONMarko Mäkelä2012-01-161-1/+9
| | | | | | | | | | Relax a bogus debug assertion. Approved by Jimmy Yang on IM.
* | Replace void pointer arithmetics with byte pointer arithmetics.Marko Mäkelä2011-11-081-2/+2
| |
* | Bug#13340047 LATCHING ORDER VIOLATION IN IBUF_SET_ENTRY_COUNTER()Marko Mäkelä2011-11-071-188/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ibuf_insert_low(), the only caller of ibuf_set_entry_counter(), will have latched an insert buffer bitmap page in bitmap_mtr before invoking ibuf_set_entry_counter(). The latching order forbids any further pages to be latched. ibuf_set_entry_counter(): Renamed to ibuf_get_entry_counter(), simplified the code and added comments. Added the following symbols for predefined field numbers in change buffer records: #define IBUF_REC_FIELD_SPACE 0 /*!< in the pre-4.1 format, the page number. later, the space_id */ #define IBUF_REC_FIELD_MARKER 1 /*!< starting with 4.1, a marker consisting of 1 byte that is 0 */ #define IBUF_REC_FIELD_PAGE 2 /*!< starting with 4.1, the page number */ #define IBUF_REC_FIELD_METADATA 3 /* the metadata field */ #define IBUF_REC_FIELD_USER 4 /* first user field */ rb:802 approved by Sunny Bains
* | Merge mysql-5.1 to mysql-5.5.Marko Mäkelä2011-10-121-1/+1
|\ \ | |/
* | Merge mysql-5.1 to mysql-5.5.Marko Mäkelä2011-09-131-2/+2
|\ \ | |/
| * Hopefully final fix of Bug#11766591 59733: Possible deadlockMarko Mäkelä2011-09-131-2/+2
| | | | | | | | | | | | | | | | | | | | when buffered changes are to be discarded ibuf_add_free_page(): Lower the latching order of the newly allocated page to SYNC_IBUF_TREE_NODE_NEW after latching the insert buffer tree root. This bug always was bogus UNIV_SYNC_DEBUG alarm. The function buf_block_dbg_add_level() is a no-op unless UNIV_SYNC_DEBUG is defined.
* | Merge mysql-5.1 to mysql-5.5.Marko Mäkelä2011-09-081-4/+4
|\ \ | |/
| * Bug#11766591 59733: POSSIBLE DEADLOCK WHEN BUFFERED CHANGES ARE DISCARDEDMarko Mäkelä2011-09-081-4/+4
| | | | | | | | | | | | | | Tweak the faulty UNIV_SYNC_DEBUG diagnostics a little bit more. ibuf_add_free_page(): Lower the latching order of the newly allocated page only after acquiring the ibuf_mutex.
* | Merge mysql-5.1 to mysql-5.5. Add a test case.Marko Mäkelä2011-08-151-11/+23
|\ \ | |/
* | Remove a debug printout that is no longer needed.Marko Mäkelä2011-04-201-12/+1
| |
* | Bug#11766305 - 59392: Remove thr0loc.c and ibuf_inside() [part 4 of 4]Marko Mäkelä2011-03-241-270/+323
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ibuf_inside(), ibuf_enter(), ibuf_exit(): Add the parameter mtr. The flag is no longer kept in the thread-local storage but in the mini-transaction (mtr->inside_ibuf). mtr_start(): Clean up the comment and remove the unused return value. mtr_commit(): Assert !ibuf_inside(mtr) in debug builds. ibuf_mtr_start(): Like mtr_start(), but sets the flag. ibuf_mtr_commit(), ibuf_btr_pcur_commit_specify_mtr(): Wrappers that assert ibuf_inside(). buf_page_get_zip(), buf_page_init_for_read(), buf_read_ibuf_merge_pages(), fil_io(), ibuf_free_excess_pages(), ibuf_contract_ext(): Remove assertions on ibuf_inside(), because a mini-transaction is not available. buf_read_ahead_linear(): Add the parameter inside_ibuf. ibuf_restore_pos(): When this function returns FALSE, it commits mtr and must therefore do ibuf_exit(mtr). ibuf_delete_rec(): This function commits mtr and must therefore do ibuf_exit(mtr). ibuf_rec_get_page_no(), ibuf_rec_get_space(), ibuf_rec_get_info(), ibuf_rec_get_op_type(), ibuf_build_entry_from_ibuf_rec(), ibuf_rec_get_volume(), ibuf_get_merge_page_nos(), ibuf_get_volume_buffered_count(), ibuf_get_entry_counter_low(): Add the parameter mtr in debug builds, for asserting ibuf_inside(mtr). rb:585 approved by Sunny Bains
* | Merge mysql-5.1-innodb to mysql-5.5-innodb.Marko Mäkelä2011-02-021-4/+4
|\ \ | |/
* | ibuf_contract_ext(): Remove an #if 0 section of codeMarko Mäkelä2011-01-271-18/+1
| | | | | | | | | | that refers to trx_sys_set_ibuf_format(). Change buffer format tagging was never implemented.
* | Bug#58212 Possible deadlock in change buffer in debug buildsMarko Mäkelä2010-12-011-17/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ibuf_page(): Renamed to ibuf_page_low(). Add the parameters file, line so that the latch diagnostics will be more meaningful. In debug builds, add the parameter ibool x_latch. When x_latch=FALSE, do not x-latch the page, but only buffer-fix it for reading the bit. In UNIV_SYNC_DEBUG, display a message if an insert buffer bitmap page was already latched. (The message should be displayed in those cases where the code would have previously failed.) ibuf_page(): A wrapper macro for ibuf_page_low(). Pass x_latch=TRUE. ibuf_bitmap_page_get_bits(): Renamed to ibuf_bitmap_page_get_bits_low(). In UNIV_DEBUG, add the parameter latch_mode. Remove the parameter mtr unless UNIV_DEBUG is defined. ibuf_bitmap_page_get_bits(): A wrapper macro for ibuf_bitmap_page_get_bits_low(). Pass latch_type=MTR_MEMO_PAGE_X_FIX. buf_page_get_gen(): Use ibuf_page_low(x_latch=FALSE) in the debug assertion. This avoids the possible deadlock.
* | Fixed a C89 violation when atomic builtins are not defined, causingCalvin Sun2010-10-271-2/+2
| | | | | | | | | | | | a compile error with MSVC. The problem was introduced in Revision: 3150 revid:marko.makela@oracle.com-20100809085837-s1nfx6gjf7l6ttab
* | ibuf_set_del_mark(): Do not complain about already delete-marked records.Marko Mäkelä2010-10-191-9/+10
| | | | | | | | | | According to a comment in row_upd_sec_index_entry(), it is a legitimate situation that can be caused by a lock wait.
* | Merge Bug #56680 from mysql-5.1.Marko Mäkelä2010-10-191-61/+171
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Additional fixes in 5.5: ibuf_set_del_mark(): Add diagnostics when setting a buffered delete-mark fails. ibuf_delete(): Correct a misleading comment about non-found records. rec_print(): Add a const qualifier to the index parameter. Bug #56680 wrong InnoDB results from a case-insensitive covering index row_search_for_mysql(): When a secondary index record might not be visible in the current transaction's read view and we consult the clustered index and optionally some undo log records, return the relevant columns of the clustered index record to MySQL instead of the secondary index record. ibuf_insert_to_index_page_low(): New function, refactored from ibuf_insert_to_index_page(). ibuf_insert_to_index_page(): When we are inserting a record in place of a delete-marked record and some fields of the record differ, update that record just like row_ins_sec_index_entry_by_modify() would do. btr_cur_update_alloc_zip(): Make the function public. mysql_row_templ_t: Add clust_rec_field_no. row_sel_store_mysql_rec(), row_sel_push_cache_row_for_mysql(): Add the flag rec_clust, for returning data at clust_rec_field_no instead of rec_field_no. Resurrect the debug assertion that the record not be marked for deletion. (Bug #55626) [UNIV_DEBUG || UNIV_IBUF_DEBUG] ibuf_debug, buf_page_get_gen(), buf_flush_page_try(): Implement innodb_change_buffering_debug=1 for evicting pages from the buffer pool, so that change buffering will be attempted more frequently.