Commit graph

264 commits

Author SHA1 Message Date
marko
29a777d62d branches/innodb+: Remove redundant buf_pool_watch_notify() calls
after buf_page_init().
2008-12-03 13:34:51 +00:00
marko
87c9f0fcb5 branches/innodb+: Merge revisions 3177:3180 from branches/zip:
------------------------------------------------------------------------
  r3180 | marko | 2008-11-21 16:36:18 +0200 (Fri, 21 Nov 2008) | 3 lines

  branches/zip: buf_LRU_free_block(): Do not assert on ibuf_count until after
  it has been determined that the block is not being I/O-fixed.
  This corrects the mistake that was made in r3177.
  ------------------------------------------------------------------------
2008-11-21 14:37:52 +00:00
marko
7172c215ac branches/innodb+: Merge revisions 3152:3177 from branches/zip:
------------------------------------------------------------------------
  r3170 | marko | 2008-11-21 10:11:18 +0200 (Fri, 21 Nov 2008) | 4 lines

  branches/zip: dtuple_print(): Dump each field in a separate line,
  so that the dumps can be read and compared more easily.
  This is related to the change to rec_print_old() and rec_print_comp()
  in r3148.
  ------------------------------------------------------------------------
  r3177 | marko | 2008-11-21 16:24:31 +0200 (Fri, 21 Nov 2008) | 3 lines

  branches/zip: buf_LRU_free_block(), buf_page_try_get_func(): Assert that
  there is nothing in the insert buffer for the page.  This is for
  tracking down Issue #128.
  ------------------------------------------------------------------------
2008-11-21 14:28:42 +00:00
marko
ace10f32a0 branches/innodb+: Merge revisions 2986:3152 from branches/zip:
------------------------------------------------------------------------
  r3036 | marko | 2008-11-12 12:34:30 +0200 (Wed, 12 Nov 2008) | 4 lines

  branches/zip: dtuple_validate(): When UNIV_DEBUG_VALGRIND is defined,
  rely solely on the UNIV_MEM_ASSERT_RW() check and disable the for loop
  that would only cause additional noise.
  ------------------------------------------------------------------------
  r3037 | marko | 2008-11-12 13:52:57 +0200 (Wed, 12 Nov 2008) | 6 lines

  branches/zip: row_vers_impl_x_locked_off_kernel(): Remove compilation
  warnings about prev_trx_id and vers_del being possibly uninitialized,
  by handling the case prev_version == NULL in a single if block.

  rb://45 approved by Inaam Rana.
  ------------------------------------------------------------------------
  r3131 | michael | 2008-11-17 14:56:56 +0200 (Mon, 17 Nov 2008) | 9 lines

  branches/zip:

  rb://53

  Improve innodb_supports_xa system variable handling and
  reduces the number of retrievals of the value from MySQL.

  Approved by: Marko, over IM
  ------------------------------------------------------------------------
  r3132 | michael | 2008-11-17 16:02:01 +0200 (Mon, 17 Nov 2008) | 5 lines

  branches/zip: rb://53

  Final version of rb://53, fixes the styling of a comment, makes
  the definition and the declaration of thd_supports_xa() identical commentwise.
  ------------------------------------------------------------------------
  r3141 | marko | 2008-11-19 16:39:55 +0200 (Wed, 19 Nov 2008) | 1 line

  branches/zip: buf_LRU_free_block(): Clarify the function comment.
  ------------------------------------------------------------------------
  r3144 | marko | 2008-11-20 11:39:49 +0200 (Thu, 20 Nov 2008) | 2 lines

  branches/zip: rec_get_nth_field_offs_old(): Add UNIV_UNLIKELY hints
  to assertion-like tests.
  ------------------------------------------------------------------------
  r3145 | marko | 2008-11-20 12:22:40 +0200 (Thu, 20 Nov 2008) | 20 lines

  branches/zip: Always check for "row too large" when executing SQL to create
  an index or table.  We have to skip this check when loading table definitions
  from the data dictionary, because we could otherwise refuse to load old
  tables (even uncompressed ones).  This addresses Issue #119.

  The first "row too large" check was implemented in MySQL 5.0.3
  to address MySQL Bug #5682.  In the InnoDB Plugin 1.0.2, a more
  accurate check was implemented in innodb_strict_mode.  We now
  make the check unconditional.

  dict_create_index_step(): Pass strict=TRUE to dict_index_add_to_cache().

  trx_is_strict(), thd_is_strict(): Remove.

  innodb-zip.test: Test in innodb_strict_mode=OFF.

  innodb_bug36169.test: Ensure that none of the tables can be created.

  rb://56 approved by Sunny Bains.
  ------------------------------------------------------------------------
  r3148 | marko | 2008-11-20 13:27:27 +0200 (Thu, 20 Nov 2008) | 3 lines

  branches/zip: rec_print_old(), rec_print_comp(): Dump each field in a
  separate line, so that the dumps can be read and compared more easily.
  ------------------------------------------------------------------------
2008-11-20 11:53:53 +00:00
inaam
914923fe70 branches/innodb+ rb://48
This patch is to improve recovery performance in InnoDB+.
It includes introduction of red-black tree for sorted insertion into
the flush_list and couple of other quirks. More can be found
at: https://svn.innodb.com/innobase/Recovery_Performance_Improvements

Reviewed by: Marko
2008-11-11 10:31:51 +00:00
marko
58d342c90a branches/innodb+: Revert some debugging-related changes
that were accidentally committed in r2971:

univ.i, ha_innobase::create(): Reduce the uncompressed page size from
16 to 4 kilobytes.

btr_cur_search_to_nth_level(): Print a diagnostic message when the
leaf page of a secondary index is being requested from the disk.

buf_read_ahead_random(), buf_read_ahead_linear(): Disable.
2008-11-07 12:16:36 +00:00
marko
7c37bc941f branches/innodb+: ibuf_get_volume_buffered():
Invoke ibuf_get_volume_buffered_count() as many times as
ibuf_rec_get_volume(rec), so that *n_recs will be updated as appropriate.
This fixes Issue #82: some deletes will be buffered in purge.
2008-11-06 12:41:18 +00:00
marko
f7e76f23c1 branches/innodb+: Merge revisions 2678:2774 from branches/zip. 2008-10-11 19:37:21 +00:00
marko
a957854246 branches/innodb+: Use buf_pool_mutex_own() instead of accessing
buf_pool_mutex directly.
2008-09-22 10:19:47 +00:00
marko
1838b00352 branches/innodb+: Non-functional change: Rename all functions related to the
buf_pool->watch_ fields to start with the common prefix buf_pool_watch,
so that they can be searched easily:

buf_pool_watch_set(): Renamed from buf_pool_add_watch().  The "add" was
misleading, because only one watch can be active at a time.

buf_pool_watch_clear(): Renamed from buf_pool_remove_watch().

buf_pool_watch_occurred(): Renamed from buf_pool_watch_happened().
2008-09-22 09:18:14 +00:00
marko
56d28f1c57 branches/innodb+: Merge 2637:2660 from branches/zip. 2008-09-22 07:57:34 +00:00
marko
583a4fb426 branches/innodb+: buf0buf.c: Fix some assertions.
buf_page_get_gen(): Once again, zip_size must always match the
compressed page size of the tablespace where the page is requested from.
This seems to hold also for all calls from the insert buffer.

buf_page_optimistic_get_func(): Do not pass mtr to ibuf_page(), because
there is no guarantee that mtr would contain an x-latch to the insert
buffer bitmap page that covers (block->page.space, block->page.offset).
2008-09-19 14:10:56 +00:00
marko
7aeb05d863 branches/innodb+: buf_page_get_gen(): Correct some ut_ad() assertions.
zip_size should always equal fil_space_get_zip_size(space), even when called
from ibuf.

ibuf_page() should be called with mtr=NULL to be equivalent to the original
implementation.  We cannot assume that mtr holds an x-latch on the insert
buffer bitmap page that covers the page that is being requested.
2008-09-19 14:00:02 +00:00
marko
da656b2207 branches/innodb+: buf_print_io(): Replace a TAB in the output with spaces,
so that this will be identical to branches/zip.
2008-09-18 09:30:22 +00:00
marko
0c4879da3d branches/innodb+: Revert some changes that make the code differ
from branches/zip.

btr_cur_optimistic_delete(): Split a too long line in the way it is
split in branches/zip.

buf_page_get_gen(): Add missing space in the function comment.

buf_print_io(): Restoer a removed space to the printout.

univ.i: Remove C++-style (or C99-style) comments.

buf0buf.h: Undo the white-space changes to the wrapper macros of
buf_page_get_gen().

ibuf_update_free_bits_low(): Revert the changes.  Restore the assertion
that this function must not be invoked on compressed pages.  The function
ibuf_update_free_bits_zip() is for compressed pages.

ibuf_insert_to_index_page(): Undo a white-space change.
2008-09-18 07:01:13 +00:00
marko
8638150c6c branches/innodb+: Merge 2579:2637 from branches/zip. 2008-09-17 19:52:30 +00:00
marko
f208759f13 branches/innodb+: buf0buddy.c: Undo changes to white space that make
the file differ from branches/zip.
2008-09-17 19:38:41 +00:00
sunny
d0e8003b2f branches/innodb+: Merge revisions 2460:2579 from branches/zip
The followin mysql-tests failed (and they are known to fail):
main.information_schema        	[ fail ]
main.innodb_file_per_table_basic[ fail ]
main.type_bit_innodb           	[ fail ]

Tested against : MYSQL_SERVER_VERSION  "5.1.28"
2008-08-09 00:15:46 +00:00
sunny
4abda95a36 branches/innodb+: Fix a debug assertion. 2008-06-16 03:12:16 +00:00
sunny
0f4e11587a branches/innodb+: zip_size can be 0 when called from ibuf. 2008-06-10 09:45:36 +00:00
inaam
c5dacc2914 branches/innodb+: Merge revisions 2344:2454 from branches/zip 2008-05-14 15:43:19 +00:00
marko
0c5b8df908 branches/innodb+: Merge revisions 2340:2343 from branches/zip 2008-03-03 12:57:07 +00:00
marko
5cf58ce919 branches/innodb+: Merge revisions 2322:2340 from branches/zip 2008-03-03 10:25:27 +00:00
sunny
fceb78e698 branches/innodb+: Delete buffer port from branches/fts:r2283 2008-02-27 07:03:34 +00:00
marko
da54bec75b branches/zip: Minor fixes.
buf_LRU_old_adjust_len(): Replace a constant ut_ad() with a preprocessor check.

buf_LRU_free_block(): Remove the check for the unlikely case
buf_pool->LRU_old == prev_b in order to simplify the function.
The check was implemented as part of r2306.
2008-02-18 15:43:16 +00:00
marko
060a95bea6 branches/zip: buf_LRU_free_block(): When freeing the uncompressed page
corresponding to a compressed page, do not flag the block as recently
used, but maintain the position of the control block on the LRU list.
2008-02-16 10:33:15 +00:00
marko
17127565dd branches/zip: buf0lru.c: Minor cleanup.
Use ut_d() in assignments to bpage->in_LRU_list instead of #ifdef UNIV_DEBUG.

buf_LRU_remove_block(): Move an assertion to a more appropriate place.
2008-02-15 11:45:37 +00:00
marko
7b538bb8ea branches/zip: buf_buddy_alloc_from(): Relax a debug assertion that fails
on i==j==BUF_BUDDY_SIZES.
2008-02-15 10:07:42 +00:00
marko
1d1dc31a06 branches/zip: Introduce UNIV_INTERN, a linkage specifier for InnoDB-global
symbols.  Use it for all definitions of non-static variables and functions.

lexyy.c, make_flex.sh: Declare yylex as UNIV_INTERN, not static.  It is
referenced from pars0grm.c.

Actually, according to
	nm .libs/ha_innodb.so|grep -w '[ABCE-TVXYZ]'
the following symbols are still global:

* The vtable for class ha_innodb
* pars0grm.c: The function yyparse() and the variables yychar, yylval, yynerrs

The required changes to the Bison-generated file pars0grm.c will be addressed
in a separate commit, which will add a script similar to make_flex.sh.

The class ha_innodb is renamed from class ha_innobase by a #define.  Thus,
there will be no clash with the builtin InnoDB.  However, there will be some
overhead for invoking virtual methods of class ha_innodb.  Ideas for making
the vtable hidden are welcome.  -fvisibility=hidden is not available in GCC 3.
2008-02-06 14:17:36 +00:00
marko
8958f06278 branches/zip: Introduce the page type code FIL_PAGE_TYPE_ZBLOB2 for
continuation pages containing compressed BLOBs.  The first compressed
BLOB page will be of type FIL_PAGE_TYPE_ZBLOB.
2008-01-24 08:12:02 +00:00
marko
214ced4e36 branches/zip: Free the buffer pool at shutdown.
buf_pool_free(): New function: Free all chunks of the buffer pool.

innobase_shutdown_for_mysql(): Call buf_pool_free() right before
ut_free_all_mem().
2008-01-16 12:44:44 +00:00
marko
e693d5170d branches/zip: Add comments about the lock and latch protection of externally
stored columns (BLOBs).

btr_copy_blob_prefix(), btr_copy_zblob_prefix(),
btr_copy_externally_stored_field_prefix_low(),
btr_copy_externally_stored_field_prefix(),
btr_copy_externally_stored_field(),
btr_rec_copy_externally_stored_field():
Note that the page containing the clustered index record that points to
the BLOB must be latched.

btr_copy_zblob_prefix(): Note that there is no latch on the page, and thus
all accesses to a given page via this function must be covered by the same
set of locks or latches.

btr_copy_zblob_prefix(): Note that the block acquired by
buf_page_get_zip() is protected by an exclusive table lock or
or by a latch on the clustered index record.
2008-01-16 10:45:14 +00:00
marko
d4de2116e0 branches/zip: buf_pool_init(): Initialize buf_pool_zip_mutex before
acquiring buf_pool_mutex.  This avoids triggering the debug assertion
that was added in r2227.
2008-01-15 09:43:14 +00:00
marko
0d02593440 branches/zip: buf_LRU_search_and_free_block(): Do not forbid the release
of the buffer pool mutex.  Apparently, it is temporarily released also
in older versions of MySQL/InnoDB for the duration of the
btr_search_drop_page_hash_index() call [in buf_LRU_free_block()].
2008-01-10 12:34:25 +00:00
marko
7ac6a34347 branches/zip: Add instrumentation for prohibiting the release of
the buffer pool mutex.  The instrumentation can be activated by
defining UNIV_DEBUG or UNIV_BUF_DEBUG at compilation time.

buf_pool_mutex_exit_forbidden: New variable.  When this is nonzero,
an assertion will fail in buf_pool_mutex_exit().

buf_pool_mutex_exit_forbid(): Macro for declaring that the buffer pool
mutex must not be released.  Calls may be nested.

buf_pool_mutex_exit_allow(): Macro for declaring that the buffer pool
mutex may be released.  Calls may be nested.

buf_LRU_search_and_free_block(): Prohibit buf_pool_mutex_exit() in the
scope of the function.

buf_LRU_free_block(): Prohibit buf_pool_mutex_exit() in buf_buddy_alloc()
and buf_buddy_free().

buf_LRU_block_remove_hashed_page(): Prohibit buf_pool_mutex_exit()
in buf_buddy_free().
2008-01-10 09:51:57 +00:00
marko
cdb5b46445 branches/zip: Implement wrappers for all operations on the buffer pool mutex.
buf_pool->mutex: Rename to buf_pool_mutex, so that the wrappers will have
to be used when changes are merged from other source trees.

buf_pool->zip_mutex: Rename to buf_pool_zip_mutex.

buf_pool_mutex_own(), buf_pool_mutex_enter(), buf_pool_mutex_exit():
Wrappers for buf_pool_mutex.
2008-01-10 09:37:13 +00:00
marko
b056745617 branches/zip: Split the source-only configuration parameter
buf_buddy_min_n_frames into two, also buf_buddy_max_n_frames.
Set the default values in such a way that a strict LRU policy will apply
for replacing compressed or uncompressed page frames in the buffer pool.

These parameters have not yet been exposed to the MySQL layer.
2008-01-04 14:08:41 +00:00
vasil
6367b36c50 branches/zip:
Non-functional change: add "out:" comment for the return value.
2007-12-17 10:03:15 +00:00
marko
8b00501bea branches/zip: Clarify that buf_buddy_alloc() should only be used for
allocating compressed page frames or their control blocks.  Also note
that if buf_buddy_alloc() is used for allocating a control block,
it must be initialized before releasing buf_pool->mutex.

buf_page_init_for_read(): When the page hash check fails after
buf_buddy_alloc(), free the uninitialized control block before freeing
the compressed page frame.  This fixes a potential error in
buf_buddy_relocate_block().
2007-12-12 14:12:52 +00:00
marko
b7acbef614 branches/zip: Document how the data structures of the buddy allocator
are interfaced with the buffer pool.
2007-12-12 13:42:03 +00:00
marko
6d604a10a0 branches/zip: buf_page_get_gen(): Check the return status of
buf_zip_decompress() and return NULL on decompression failure.
2007-12-10 12:54:53 +00:00
marko
33e082be24 branches/zip: buf_buddy_alloc(): Assign *lru = TRUE whenever the buffer pool
mutex is temporarily released.

buf_LRU_free_block(), buf_buddy_alloc_clean(): Add an output parameter that
will be assigned TRUE when the buffer pool mutex is released.

This bug was spotted by and fix provided by Sunny.
2007-12-10 09:48:28 +00:00
marko
95d04ddb90 branches/zip: Fix a bug that was introduced in r2123.
buf_block_is_uncompressed(): Check that the pointer is aligned.  Use the
C modulus operator % instead of ut_align_offset(), because sizeof(buf_block_t)
is not guaranteed to be a power of 2.
2007-11-28 13:45:22 +00:00
marko
a3190b1f49 branches/zip: buf_page_get_gen(): Note that the guessed block may also
point to a buffer pool chunk that has been released when resizing the
buffer pool.

buf_block_is_uncompressed(): Check that the pointer is aligned.  Thanks
to this check, it is safe to pass an arbitrary pointer as a guess
to buf_page_get_gen().
2007-11-28 11:31:12 +00:00
marko
a8635f7e29 branches/zip: buf_page_get_gen(): Ignore "guess" if it does not point to
buf_pool->chunks[]->blocks[].

buf_block_is_uncompressed(): New function, to detect if a block points to
buf_pool->chunks[]->blocks[].
2007-11-05 10:31:41 +00:00
marko
66e193b4ba branches/zip: buf_page_init_low(): Initialize also flush_type. 2007-10-31 22:02:23 +00:00
marko
fe6e780d82 branches/zip: buf_LRU_block_remove_hashed_page(): Add some Valgrind
instrumentation.
2007-10-31 10:40:41 +00:00
marko
a815c47ccb branches/zip: buf_buddy_relocate(): The src block may be partially freed.
Remove the Valgrind check about it.
2007-10-31 10:40:09 +00:00
marko
92df6720be branches/zip: Improve Valgrind instrumentation.
buf_buddy_relocate(): Allow the source block to contain uninitialized data.

buf0buddy.c: Replace the remaining VALGRIND_CHECK_ macros with the wrappers
defined in univ.i.
2007-10-31 09:00:08 +00:00
marko
902893c719 branches/zip: Improve Valgrind instrumentation.
buf_LRU_free_block(): Check that the block descriptor contains valid data.

buf_buddy_relocate(): Check that the source block contains valid data.

buf_page_get_gen(): Do not dereference bpage after calling buf_relocate().
This avoids a bogus Valgrind warning; the memory itself was valid.

buf_page_hash_get(): Check that the returned block descriptor contains
valid data.
2007-10-30 09:27:09 +00:00