Commit graph

155 commits

Author SHA1 Message Date
marko
daca48870f branches/zip: Allow CREATE INDEX to be interrupted. (Issue #354)
rb://183 approved by Heikki Tuuri
2009-11-12 13:49:08 +00:00
vasil
0d64136a0c branches/zip:
Add ChangeLog for r6157.
2009-11-11 14:00:12 +00:00
vasil
6efbbc7dbd branches/zip:
Add changelog entry for r6160.
2009-11-11 13:36:16 +00:00
marko
def1082121 branches/zip: innobase_convert_identifier(): Convert table names with
explain_filename() to address Bug #32430: 'show innodb status'
causes errors Invalid (old?) table or database name in logs.

rb://134 approved by Sunny Bains
2009-11-04 07:57:29 +00:00
marko
dda7217e08 branches/zip: Free all resources at shutdown. Set pointers to NULL, so
that Valgrind will not complain about freed data structures that are
reachable via pointers.  This addresses Bug #45992 and Bug #46656.

This patch is mostly based on changes copied from branches/embedded-1.0,
mainly c5432, c3439, c3134, c2994, c2978, but also some other code was
copied.  Some added cleanup code is specific to MySQL/InnoDB.

rb://199 approved by Sunny Bains
2009-11-02 09:42:56 +00:00
jyang
db0d81d0d7 branches/zip: Correct the bug number for -r6109 change
from # 48273 to #48237
2009-10-30 08:02:31 +00:00
vasil
f054d409f5 branches/zip:
* Add ChangeLog entries for latest changes
* Obey alphabetical order in the list of the files
* White-space fixup
2009-10-29 16:43:51 +00:00
marko
7d0ad4af4f branches/zip: Fix corruption of buf_pool->LRU_old and improve debug assertions.
This was reported as Issue #381.

buf_page_set_old(): Assert that blocks may only be set old if
buf_pool->LRU_old is initialized and buf_pool->LRU_old_len is nonzero.
Assert that buf_pool->LRU_old points to the block at the old/new boundary.

buf_LRU_old_adjust_len(): Invoke buf_page_set_old() after adjusting
buf_pool->LRU_old and buf_pool->LRU_old_len, in order not to violate
the added assertions.

buf_LRU_old_init(): Replace buf_page_set_old() with a direct
assignment to bpage->old, because these loops that initialize all the
blocks would temporarily violate the assertions about
buf_pool->LRU_old.

buf_LRU_remove_block(): When setting buf_pool->LRU_old = NULL, also
clear all bpage->old flags and set buf_pool->LRU_old_len = 0.

buf_LRU_add_block_to_end_low(), buf_LRU_add_block_low(): Move the
buf_page_set_old() call later in order not to violate the debug
assertions.  If buf_pool->LRU_old is NULL, set old=FALSE.

buf_LRU_free_block(): Replace the UNIV_LRU_DEBUG assertion with a
dummy buf_page_set_old() call that performs more thorough checks.

buf_LRU_validate(): Do not tolerate garbage in buf_pool->LRU_old_len
even if buf_pool->LRU_old is NULL.  Check that bpage->old is monotonic.

buf_relocate(): Make the UNIV_LRU_DEBUG checks stricter.

buf0buf.h: Revise the documentation of buf_page_t::old and
buf_pool_t::LRU_old_len.
2009-10-29 11:04:11 +00:00
marko
bdc7678f45 branches/zip: row_ins_alloc_sys_fields(): Zero out the system columns
DB_TRX_ID, DB_ROLL_PTR and DB_ROW_ID, in order to avoid harmless
Valgrind warnings about uninitialized data.  (The warnings were
harmless, because the fields would be initialized at a later stage.)
2009-10-26 13:46:18 +00:00
vasil
7e6a345f3e branches/zip:
Add ChangeLog entry for r6095.
2009-10-19 12:06:09 +00:00
vasil
68b1cc9e37 branches/zip:
Add ChangeLog entry for r6080.
2009-10-15 04:21:17 +00:00
marko
64096ab555 branches/zip: Clean up after a crash during DROP INDEX.
When InnoDB crashes while dropping an index, ensure that
the index will be completely dropped during crash recovery.

row_merge_drop_index(): Before dropping an index, rename the index to
start with TEMP_INDEX_PREFIX_STR and commit the change, so that
row_merge_drop_temp_indexes() will drop the index after crash
recovery if the server crashes while dropping the index.

fseg_inode_try_get(): New function, forked from fseg_inode_get().
Return NULL if the file segment index node is free.

fseg_inode_get(): Assert that the file segment index node is not free.

fseg_free_step(): If the file segment index node is already free,
print a diagnostic message and return TRUE.

fsp_free_seg_inode(): Write a nonzero number to FSEG_MAGIC_N, so that
allocated-and-freed file segment index nodes can be better
distinguished from uninitialized ones.

This is rb://174, addressing Issue #348.

Tested by restarting mysqld upon the completion of the added
log_write_up_to() invocation below, during DROP INDEX.  The index was
dropped after crash recovery, and re-issuing the DROP INDEX did not
crash the server.

  Index: btr/btr0btr.c
  ===================================================================
  --- btr/btr0btr.c	(revision 6026)
  +++ btr/btr0btr.c	(working copy)
  @@ -42,6 +42,7 @@ Created 6/2/1994 Heikki Tuuri
   #include "ibuf0ibuf.h"
   #include "trx0trx.h"
  +#include "log0log.h"
   
   /*
   Latching strategy of the InnoDB B-tree
   --------------------------------------
  @@ -873,6 +874,8 @@ leaf_loop:
   
   		goto leaf_loop;
   	}
  +
  +	log_write_up_to(mtr.end_lsn, LOG_WAIT_ALL_GROUPS, TRUE);
   top_loop:
   	mtr_start(&mtr);
2009-10-01 10:24:33 +00:00
vasil
2fe21c275f branches/zip:
Fix the year, should be 2009.

Pointed by:	Calvin
2009-09-29 12:19:59 +00:00
vasil
732fd6c3f7 branches/zip:
Add ChangeLog entry for the release of 1.0.4.
2009-09-29 09:15:25 +00:00
vasil
2fccb1bd92 branches/zip:
ChangeLog: wrap around 78th column, not earlier.
2009-09-29 07:09:52 +00:00
marko
cf0210a706 branches/zip: Remove an assertion failure when the InnoDB data dictionary
is inconsistent with the MySQL .frm file.

ha_innobase::index_read(): When the index cannot be found,
return an error.

ha_innobase::change_active_index(): When prebuilt->index == NULL,
set also prebuilt->index_usable = FALSE.  This is not needed for
correctness, because prebuilt->index_usable is only checked by
row_search_for_mysql(), which requires prebuilt->index != NULL.

This addresses Issue #349.  Approved by Heikki Tuuri over IM.
2009-09-28 12:03:58 +00:00
marko
3b38bf02cb branches/zip: Do not write to PAGE_INDEX_ID after page creation,
not even when restoring an uncompressed page after a compression failure.

btr_page_reorganize_low(): On compression failure, do not restore
those page header fields that should not be affected by the
reorganization.  Instead, compare the fields.

page_zip_decompress(): Add the parameter ibool all, for copying all
page header fields.  Pass the parameter all=TRUE on block read
completion, redo log application, and page_zip_validate(); pass
all=FALSE in all other cases.

page_zip_reorganize(): Do not restore the uncompressed page on
failure.  It will be restored (to pre-modification state) by the
caller anyway.

rb://167, Issue #346
2009-09-28 07:52:25 +00:00
marko
e5f474417c branches/zip: Try to prevent the reuse of tablespace identifiers after
InnoDB has crashed during table creation.  Also, refuse to start if
files with duplicate tablespace identifiers are encountered.

fil_node_create(): Update fil_system->max_assigned_id.  This should
prevent the reuse of a space->id when InnoDB does a full crash
recovery and invokes fil_load_single_table_tablespaces().  Normally,
fil_system->max_assigned_id is initialized from
SELECT MAX(ID) FROM SYS_TABLES.

fil_open_single_table_tablespace(): Return FALSE when
fil_space_create() fails.

fil_load_single_table_tablespace(): Exit if fil_space_create() fails
and innodb_force_recovery=0.

rb://173 approved by Heikki Tuuri.  This addresses Issue #335.
2009-09-28 07:33:59 +00:00
vasil
91cf5f39be branches/zip:
Add ChangeLog entry for c5988.
2009-09-28 06:10:29 +00:00
vasil
2f41cc6472 branches/zip:
Add ChangeLog entries for c5938.
2009-09-21 04:26:04 +00:00
vasil
520500534a branches/zip:
White space and formatting cleanup in the ChangeLog
2009-09-18 03:59:30 +00:00
marko
866adf529d branches/zip: innodb-zip.test: Make the test work with zlib 1.2.3.3.
Apparently, the definition of compressBound() has slightly changed.

This has been filed as Mantis Issue #345.
2009-09-17 05:32:08 +00:00
vasil
eebb00baf2 branches/zip:
Add ChangeLog entries for r5916.
2009-09-16 17:47:22 +00:00
vasil
354e4c9a64 branches/zip:
Whitespace cleanup in the ChangeLog.
2009-09-16 17:37:13 +00:00
sunny
17f5d18b5e branches/zip: Update ChangeLog with r5733 changes. 2009-09-02 06:08:45 +00:00
marko
1a9bfd68d0 branches/zip: dict_index_find_cols(): On column name lookup failure,
return DB_CORRUPTION (HA_ERR_CRASHED) instead of abnormally
terminating the server.  Also, disable the previously added diagnostic
output to the error log, because mysql-test-run does not like extra
output in the error log.  (Bug #44571)

dict_index_add_to_cache(): Handle errors from dict_index_find_cols().

mysql-test/innodb_bug44571.test: A test case for triggering the bug.

rb://135 approved by Sunny Bains.
2009-08-27 10:56:24 +00:00
marko
4e0ad39974 branches/zip: Fix a critical bug in fast index creation that could
corrupt the created indexes.

row_merge(): Make "half" an in/out parameter. Determine the offset of
half the output file. Copy the last blocks record-by-record instead of
block-by-block, so that the records can be counted. Check that the
input and output have matching n_rec.

row_merge_sort(): Do not assume that two blocks of size N are merged
into a block of size 2*N. The output block can be shorter than the
input if the last page of each input block is almost empty. Use an
accurate termination condition, based on the "half" computed by
row_merge().

row_merge_read(), row_merge_write(), row_merge_blocks(): Add debug output.

merge_file_t, row_merge_file_create(): Add n_rec, the number of records
in the merge file.

row_merge_read_clustered_index(): Update n_rec.

row_merge_blocks(): Update and check n_rec.

row_merge_blocks_copy(): New function, for copying the last blocks in
row_merge().  Update and check n_rec.

This bug was discovered with a user-supplied test case that creates an
index where the initial temporary file is 249 one-megabyte blocks and
the merged files become smaller. In the test, possible merge record
sizes are 10, 18, and 26 bytes.

rb://150 approved by Sunny Bains.  This addresses Issue #320.
2009-08-27 07:31:17 +00:00
marko
0f7895d477 branches/zip: Replace the constant 3/8 ratio that controls the LRU_old
size with the settable global variable innodb_old_blocks_pct. The
minimum and maximum values are 5 and 95 per cent, respectively. The
default is 100*3/8, in line with the old behavior.

ut_time_ms(): New utility function, to return the current time in
milliseconds. TODO: Is there a more efficient timestamp function, such
as rdtsc divided by a power of two?

buf_LRU_old_threshold_ms: New variable, corresponding to
innodb_old_blocks_time. The value 0 is the default behaviour: no
timeout before making blocks 'new'.

bpage->accessed, bpage->LRU_position, buf_pool->ulint_clock: Remove.

bpage->access_time: New field, replacing bpage->accessed. Protected by
buf_pool_mutex instead of bpage->mutex. Updated when a page is created
or accessed the first time in the buffer pool.

buf_LRU_old_ratio, innobase_old_blocks_pct: New variables,
corresponding to innodb_old_blocks_pct

buf_LRU_old_ratio_update(), innobase_old_blocks_pct_update(): Update
functions for buf_LRU_old_ratio, innobase_old_blocks_pct.

buf_page_peek_if_too_old(): Compare ut_time_ms() to bpage->access_time
if buf_LRU_old_threshold_ms && bpage->old.  Else observe
buf_LRU_old_ratio and bpage->freed_page_clock.

buf_pool_t: Add n_pages_made_young, n_pages_not_made_young,
n_pages_made_young_old, n_pages_not_made_young, for statistics.

buf_print(): Display buf_pool->n_pages_made_young,
buf_pool->n_pages_not_made_young.  This function is only for crash
diagnostics.

buf_print_io(): Display buf_pool->LRU_old_len and quantities derived
from buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young.
This function is invoked by SHOW ENGINE INNODB STATUS.

rb://129 approved by Heikki Tuuri.  This addresses Bug #45015.
2009-08-27 06:25:00 +00:00
marko
12352f3631 branches/zip: Document also the files affected by r5698 in the ChangeLog. 2009-08-27 06:03:15 +00:00
marko
ae08a59446 branches/zip: Document r5698 in the ChangeLog. 2009-08-27 06:01:42 +00:00
vasil
5bd19605b2 branches/zip:
ChangeLog:
Follow the convention from the rest of the ChangeLog: for bugfixes from
bugs.mysql.com only the bug number and title goes in the ChangeLog. Detailed
explanation on what is the problem and how it was fixed is present in
the bugs database.
2009-08-20 08:20:22 +00:00
vasil
1e4618803e branches/zip:
White-space fixup.
2009-08-20 08:15:05 +00:00
sunny
cb7c80c8a9 branches/zip: Update the ChangeLog with r5684 change. 2009-08-20 07:18:29 +00:00
marko
9e7705dbb8 branches/zip: ha_innobase::add_index(): Fix Bug #46557:
after a successful operation, read innodb_table->flags from
the newly created table object, not from the old one that was just freed.

Approved by Sunny.
2009-08-13 07:46:33 +00:00
vasil
b33535ef62 branches/zip:
Fixups in ChangeLog: sort filenames alphabetically and wrap to 78 chars per
line.
2009-07-21 08:31:26 +00:00
calvin
e51056a82d branches/zip: add ChangeLog entry for r5524. 2009-07-20 16:14:30 +00:00
vasil
17c8f39295 branches/zip:
Add ChangeLog entries for r5498 and r5519.
2009-07-20 07:51:47 +00:00
calvin
d6c4fcc2fa branches/zip: add ChangeLog entry for r5508. 2009-07-16 12:45:28 +00:00
inaam
ec40f5cd73 branches/zip rb://138 (REVERT)
Revert the flush neighbors patch as it shows regression in
the benchmarks run by Michael.
2009-07-13 14:48:45 +00:00
calvin
d7f9b01105 branches/zip: add ChangeLog entries for r5484-r5486. 2009-07-10 20:47:34 +00:00
vasil
50c053adfc branches/zip:
Add ChangeLog entry for 5489.
2009-07-10 08:04:20 +00:00
vasil
900f489a19 branches/zip:
Use PAUSE instruction inside spinloop if it is available.

The patch was originally developed by Mikael Ronstrom <mikael@mysql.com>
and can be found here:
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2768
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2771
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2772
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2774
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2777
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2799
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2800

Approved by:	Heikki (rb://137)
2009-07-02 12:12:36 +00:00
marko
6bfbdb2d0d branches/zip: Do not crash on SET GLOBAL innodb_file_format=DEFAULT
or SET GLOBAL innodb_file_format_check=DEFAULT.

innodb_file_format.test: New test for innodb_file_format and
innodb_file_format_check.

innodb_file_format_name_validate(): Store the string in *save.
innodb_file_format_name_update(): Check the string again.

innodb_file_format_check_validate(): Store the string in *save.
innodb_file_format_check_update(): Check the string again.

Issue #282, rb://140 approved by Heikki Tuuri
2009-06-29 12:49:54 +00:00
marko
4a447cde2e branches/zip: lock_print_info_all_transactions(), buf_read_recv_pages():
Tolerate missing tablespaces (zip_size==ULINT_UNDEFINED).
buf_page_get_gen(): Add ut_ad(ut_is_2pow(zip_size)).

Issue #289, rb://136 approved by Sunny Bains
2009-06-29 08:54:53 +00:00
marko
17105a0ad9 branches/zip: buf_page_get_gen(): Fix a race condition when reading
buf_fix_count.  This could explain Issue #156.
Tested by Michael.
2009-06-29 08:24:27 +00:00
marko
3bc2b8f158 branches/zip: ha_innobase::add_index(), ha_innobase::final_drop_index():
Start prebuilt->trx before locking the table.  This should fix Issue #293
and could fix Issue #229.
Approved by Sunny (over IM).
2009-06-29 07:52:30 +00:00
calvin
95aaddbe70 branches/zip: Fix typos. 2009-06-26 19:52:52 +00:00
marko
bb0e1c34df branches/zip: Fix a race condition caused by
SET GLOBAL innodb_commit_concurrency=DEFAULT. (Bug #45749)
When innodb_commit_concurrency is initially set nonzero,
DEFAULT would change it back to 0, triggering Bug #42101.
rb://139 approved by Heikki Tuuri.
2009-06-25 11:55:52 +00:00
marko
dcd851bcbe branches/zip: dict_index_find_cols(): Print diagnostic on name mismatch.
This addresses Bug #44571 but does not fix it.
rb://135 approved by Sunny Bains.
2009-06-25 09:45:57 +00:00
marko
090cdcff6a branches/zip: row_merge_read_rec(): Fix a UNIV_DEBUG bug (Bug #45426) 2009-06-17 12:03:45 +00:00