Commit graph

2775 commits

Author SHA1 Message Date
unknown
b47628f157 Compiler warnings removed.
Added ability top change empty space filler of the loghandler.
Fixed end of log reaction.
Fixed memory corruprion bug caused by reading non-filled hage header.
Added debug output.


storage/maria/ma_bitmap.c:
  Compiler warnings removed.
storage/maria/ma_blockrec.c:
  Compiler warnings removed.
storage/maria/ma_loghandler.c:
  Added ability top change empty space filler of the loghandler.
  Fixed end of log reaction.
  Fixed memory corruprion bug caused by reading non-filled hage header.
  Added debug output.
storage/maria/ma_loghandler_lsn.h:
  Compiler warnings removed.
2007-10-11 18:45:42 +03:00
unknown
791b0aa081 WL#3071 - Maria checkpoint
* Preparation for having a background checkpoint thread:
frequency of checkpoint taken by that thread is now configurable
by the user: global variable maria_checkpoint_frequency, in seconds,
default 30 (checkpoint every 30th second); 0 means no checkpoints
(and thus no background thread, thus no background flushing, that
will probably only be used for testing).
* Don't take checkpoints in Recovery if it didn't do anything
significant; thus no checkpoint after a clean shutdown/restart. The
only checkpoint which is never skipped is the one at shutdown.
* fix for a test failure (after-merge fix)


include/maria.h:
  new variable
mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
  result update
mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
  position update (=after merge fix, as this position was already changed
  into 5.1 and not merged here, causing test to fail)
storage/maria/ha_maria.cc:
  Checkpoint's frequency is now configurable by the user:
  global variable maria_checkpoint_frequency. Changing it on the fly
  requires us to shutdown/restart the background checkpoint thread,
  as the loop done in that thread assumes a constant checkpoint
  interval. Default value is 30: a checkpoint every 30 seconds (yes, I
  know, physicists will remind that it should be named "period" then).
  ha_maria now asks for a background checkpoint thread when it starts,
  but this is still overruled (disabled) in ma_checkpoint_init().
storage/maria/ma_checkpoint.c:
  Checkpoint's frequency is now configurable by the user: background thread
  takes a checkpoint every maria_checkpoint_interval-th second.
  If that variable is 0, no checkpoints are taken.
  Note, I will enable the background thread only in a later changeset.
storage/maria/ma_recovery.c:
  Don't take checkpoints at the end of the REDO phase and at the end of
  Recovery if Recovery didn't make anything significant (didn't open
  any tables, didn't rollback any transactions).
  With this, after a clean shutdown, Recovery shouldn't take any
  checkpoint, which makes starting faster (we save a few fsync()s of
  the log and control file).
2007-10-09 10:38:31 +02:00
unknown
568e32c80d Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-maria
into  gbichot4.local:/home/mysql_src/mysql-maria-tmp


storage/maria/ma_loghandler.c:
  Auto merged
2007-10-09 09:14:04 +02:00
unknown
494409bdc6 Merge desktop.sanja.is.com.ua:/home/bell/mysql/bk/mysql-maria
into  desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-bug
2007-10-08 23:53:41 +03:00
unknown
5cd55487d7 Merge bk-internal.mysql.com:/home/bk/mysql-maria
into  janus.mylan:/usr/home/serg/Abk/mysql-maria1
2007-10-08 22:45:55 +02:00
unknown
ceadd59644 Merge janus.mylan:/usr/home/serg/Abk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-maria1


Makefile.am:
  Auto merged
client/mysqldump.c:
  Auto merged
configure.in:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysys/mf_tempfile.c:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/ha_partition.h:
  Auto merged
sql/handler.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
BUILD/compile-dist:
  SCCS merged
2007-10-08 21:01:44 +02:00
unknown
5a0e10e2f3 Comments added.
moved debugging defines.
Fixed buffer flushing (we copied last page
content before it was actually written, now
we abvance pointer in new buffer and unlock
it while waiting for filling old buffer)
2007-10-08 21:10:18 +03:00
unknown
63ff9877a5 WL#3072 Maria recovery
Misc changes:
- fix for benign Valgrind error, compiler warnings
- fix for a segfault in execution of maria_delete_all_rows() and one
when taking multiple checkpoints
- fix for too paranoid assertion
- adding ability to take checkpoints at the end of the REDO phase
and at the end of recovery.
- other minor changes


storage/maria/ha_maria.cc:
  The checkpoint done after Recovery is finished, is moved to
  maria_recover().
storage/maria/ma_bitmap.c:
  fix for Valgrind error: the "shadow debug copy" of the bitmap page
  started unitialized and so ma_print_bitmap() would use it uninitialized
storage/maria/ma_checkpoint.c:
  * reset pointers to NULL after freeing them, or we segfault at
  next checkpoint in my_realloc().
  * fix for compiler warnings.
storage/maria/ma_delete_all.c:
  info->trn is NULL for non-transactional tables
storage/maria/ma_locking.c:
  correct assertion (it fired wrongly in execution of REDO_DROP_TABLE
  due to the maria_extra(HA_PREPARE_FOR_DROP)->_ma_decrement_open_count()
  ->maria_lock_database(F_UNLCK); another solution would have been to
  not call _ma_decrement_open_count() (it's ok to have a wrong open
  count in a table which we are dropping), but the same problem
  would still exist for REDO_RENAME_TABLE.
storage/maria/ma_loghandler.c:
  fail early if UNRECOVERABLE_ERROR
storage/maria/ma_recovery.c:
  * new argument to maria_apply_log(): should it take checkpoints
  (at end of REDO phase and at the very end) or no.
  * moving the call to translog_next_LSN() into
  parse_checkpoint_record() ("hide the details").
  * Refining an error detection for something which could happen
  if there is a checkpoint record in the log.
  * Using close_one_table() instead of maria_extra(HA_EXTRA_PREPARE_FOR_DROP|RENAME),
  as it looks safer, and also changing how close_one_table() works:
  it now limits itself to scanning all_tables[], thus having one loopp
  instead of two, which should be faster (as a result, it does not
  close tables not registered in this array, which is ok as there
  should not be any).
storage/maria/ma_recovery.h:
  new parameter
storage/maria/maria_read_log.c:
  update to new prototype
2007-10-08 19:08:25 +02:00
unknown
dcd4b6f540 Comments fixed and added. 2007-10-08 01:07:50 +03:00
unknown
212313de55 Optimisation todo for loghandler added.
Debug output information fixed.
Fixed direct page referencing in write mode.


storage/maria/ma_loghandler.c:
  TODO added.
storage/maria/ma_pagecache.c:
  Debug output information fixed.
  Fixed direct page referencing in write mode.
2007-10-07 23:27:03 +03:00
unknown
6c7a278c83 remove maria_* variables from the server, declare them in ha_maria.cc
note: this does *not* move pagecache* variables.


sql/mysqld.cc:
  remove maria_* variables from the server, declare them in ha_maria.cc
sql/set_var.cc:
  remove maria_* variables from the server, declare them in ha_maria.cc
sql/sql_class.h:
  remove maria_* variables from the server, declare them in ha_maria.cc
sql/sql_plugin.cc:
  bugfix: support for ENUM/SET thd local plugin variables
storage/maria/ha_maria.cc:
  remove maria_* variables from the server, declare them in ha_maria.cc
2007-10-06 17:56:52 +02:00
unknown
a1bb4afa7e after-merge fixes for 64bit
storage/maria/ma_test1.c:
  typo (?) fixed
2007-10-06 11:39:26 +02:00
unknown
2011f79029 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-maria
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-maria.prod


BUILD/SETUP.sh:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
storage/maria/ha_maria.cc:
  Auto merged
storage/maria/ma_check.c:
  Auto merged
storage/maria/ma_create.c:
  Auto merged
storage/maria/ma_delete.c:
  Auto merged
storage/maria/ma_open.c:
  Auto merged
storage/maria/ma_update.c:
  Auto merged
storage/maria/ma_write.c:
  Auto merged
storage/maria/maria_chk.c:
  Auto merged
storage/maria/maria_def.h:
  Auto merged
storage/maria/ma_pagecache.c:
  Manual merge with maria tree.
storage/myisam/sort.c:
  Manual merge with maria tree.
2007-10-04 23:33:55 +03:00
unknown
4eb383e06c After merge fixes. Applied changes made in myisam manually to maria.
storage/maria/ma_test1.c:
  After merge fixes. Applied changes made in myisam manually to maria.
  
  Fixed memory leak.
storage/maria/ma_test2.c:
  After merge fixes. Applied changes made in myisam manually to maria.
  
  Fixed memory leak.
2007-10-04 20:33:42 +03:00
unknown
24db7ed7e1 WL#3072 Maria recovery.
* Thanks to Serg's tip, we fix here the compilation issue of
REDO_REPAIR_TABLE's execution, by defining versions of
_ma_killed_ptr() and _ma_check_print_info|warning|error()
in maria_read_log.c (we move those of maria_chk.c into an include
file and include it in maria_chk.c and maria_read_log.c).
Execution of such record looks like working from my tests (it only
happens in maria_read_log; recovery-from-mysqld skips DDLs and
REPAIR is considered DDL here as it bypasses logging): tested
ALTER TABLE ENABLE KEYS and then remove table, apply log: that
did a repair.
* Recent changes broke maria_read_log a bit: -a became default
and -o caused error; fixing this.


storage/maria/Makefile.am:
  addind new file
storage/maria/ma_recovery.c:
  enable execution of REDO_REPAIR_TABLE by maria_read_log now that
  it compiles. Now reason to keep only T_QUICK from testflag.
storage/maria/maria_chk.c:
  moving these functions to ma_check_standalone.h for reusability
storage/maria/maria_def.h:
  comment
storage/maria/maria_read_log.c:
  ma_check_standalone.h needs my_progname_short.
  Fixing bug where "maria_read_log" would default to -a and
  "maria_read_log -o" would throw an error. Implemented behaviour is:
  - no options: usage()
  - -a : applys, applys UNDOs by default unless --disable-undo
  - -o : only prints
storage/maria/ma_check_standalone.h:
  All standalone programs which need to use functions from ma_check.c
  (like maria_repair()) must define their version of _ma_killed_ptr()
  and _ma_check_print_info|warning|error(). Indeed, linking with ma_check.o
  brings in the dependencies of ma_check.o which are definitions of the above
  functions; if the program does not define them then the ones of
  ha_maria.o are used i.e. ha_maria.o is linked into the program, and this
  brings dependencies of ha_maria.o on mysqld.o into the program's linking
  which thus fails, as the program is not linked with mysqld.o.
  We put in this file the functions which maria_chk.c uses, so that
  they can be reused by maria_read_log (when it replays REDO_REPAIR_TABLE)
  as they are good enough (they just print to stdout/stderr like
  maria_read_log already does).
2007-10-03 18:10:32 +02:00
unknown
e814261700 Fix for pushbuild failure (noticable only on 64-bit)
storage/maria/ma_pagecache.c:
  pagecache->blocks is now long, takes 8 bytes on some platforms.
  The cast to ulonglong in int8store is for those platforms where
  ulong is 32-bit and int8store uses some << shifts, if there are
  (x<<40 is undefined if x is 32-bit).
storage/maria/ma_recovery.c:
  this change corresponds to the one done in ma_pagecache.c: number
  of dirty pages is stored in 8 bytes.
2007-10-02 19:16:20 +02:00
unknown
d0b9387b88 WL#3072 - Maria recovery.
* Recovery of the table's live checksum (CREATE TABLE ... CHECKSUM=1)
is achieved in this patch. The table's live checksum
(info->s->state.state.checksum) is updated in inwrite_rec_hook's
under the log mutex when writing UNDO_ROW_INSERT|UPDATE|DELETE
and REDO_DELETE_ALL. The checksum variation caused by the operation
is stored in these UNDOs, so that the REDO phase, when it sees such
UNDOs, can update the live checksum if it is older (state.is_of_lsn is
lower) than the record. It is also used, as a nice add-on with no
cost, to do less row checksum computation during the UNDO phase
(as we have it in the record already).
Doing this work, it became pressing to move in-write hooks
(write_hook_for_redo() et al) to ma_blockrec.c.
The 'parts' argument of inwrite_rec_hook is unpredictable (it comes
mangled at this stage, for example by LSN compression) so it is
replaced by a 'void* hook_arg', which is used to pass down information,
currently only to write_hook_for_clr_end() (previous undo_lsn and
type of undone record).
* If from ha_maria, we print to stderr how many seconds (with one
fractional digit) the REDO phase took, same for UNDO phase and for
final table close. Just to give an indication for debugging and maybe
also for Support.


storage/maria/ha_maria.cc:
  question for Monty
storage/maria/ma_blockrec.c:
  * log in-write hooks (write_hook_for_redo() etc) move from
  ma_loghandler.c to here; this is natural: the hooks are coupled
  to their callers (functions in ma_blockrec.c).
  * translog_write_record() now has a new argument "hook_arg";
  using it to pass down to write_hook_for_clr_end() the transaction's
  previous_undo_lsn and the type of the being undone record, and also
  to pass down to all UNDOs the live checksum variation caused by the
  operation.
  * If table has live checksum, store in UNDO_ROW_INSERT|UPDATE|DELETE
  and in CLR_END the checksum variation ("delta") caused by the
  operation. For example if a DELETE caused the table's live checksum
  to change from 123 to 456, we store in the UNDO_ROW_DELETE, in 4 bytes,
  the value 333 (456-123).
  * Instead of hard-coded "1" as length of the place where we store
  the undone record's type in CLR_END, use a symbol CLR_TYPE_STORE_SIZE;
  use macros clr_type_store and clr_type_korr.
  * write_block_record() has a new parameter 'old_record_checksum'
  which is the pre-computed checksum of old_record; that value is used
  to update the table's live checksum when writing UNDO_ROW_UPDATE|CLR_END.
  * In allocate_write_block_record(), if we are executing UNDO_ROW_DELETE
  the row's checksum is already computed.
  * _ma_update_block_record2() now expect the new row's checksum into
  cur_row.checksum (was already true) and the old row's checksum into
  new_row.checksum (that's new). Its two callers, maria_update() and
  _ma_apply_undo_row_update(), honour this.
  * When executing an UNDO_ROW_INSERT|UPDATE|DELETE in UNDO phase, pick
  up the checksum delta from the log record. It is then used to update
  the table's live checksum when writing CLR_END, and saves us a
  computation of record.
storage/maria/ma_blockrec.h:
  in-write hooks move from ma_loghandler.c
storage/maria/ma_check.c:
  more straightforward size of buffer
storage/maria/ma_checkpoint.c:
  <= is enough
storage/maria/ma_commit.c:
  new prototype of translog_write_record()
storage/maria/ma_create.c:
  new prototype of translog_write_record()
storage/maria/ma_delete.c:
  The row's checksum must be computed before calling(*delete_record)(),
  not after, because it must be known inside _ma_delete_block_record()
  (to update the table's live checksum when writing UNDO_ROW_DELETE).
  If deleting from a transactional table, live checksum was already updated
  when writing UNDO_ROW_DELETE.
storage/maria/ma_delete_all.c:
  @todo is now done (in ma_loghandler.c)
storage/maria/ma_delete_table.c:
  new prototype of translog_write_record()
storage/maria/ma_loghandler.c:
  * in-write hooks move to ma_blockrec.c.
  * translog_write_record() gets a new argument 'hook_arg' which is
  passed down to pre|inwrite_rec_hook. It is more useful that 'parts'
  for those hooks, because when those hooks are called, 'parts' has
  possibly been mangled (like with LSN compression) and is so
  unpredictable.
  * fix for compiler warning (unused buffer_start when compiling without
  debug support)
  * Because checksum delta is stored into UNDO_ROW_INSERT|UPDATE|DELETE
  and CLR_END, but only if the table has live checksum, these records
  are not PSEUDOFIXEDLENGTH anymore, they are now VARIABLE_LENGTH (their
  length is X if no live checksum and X+4 otherwise).
  * add an inwrite_rec_hook for UNDO_ROW_UPDATE, which updates the
  table's live checksum. Update it also in hooks of UNDO_ROW_INSERT|
  DELETE and REDO_DELETE_ALL and CLR_END.
  * Bugfix: when reading a record in translog_read_record(), it happened
  that "length" became negative, because the function assumed that
  the record extended beyond the page's end, whereas it may be shorter.
storage/maria/ma_loghandler.h:
  * Instead of hard-coded "1" and "4", use symbols and macros
  to store/retrieve the type of record which the CLR_END corresponds
  to, and the checksum variation caused by the operation which logs the
  record
  * translog_write_record() gets a new argument 'hook_arg' which is
  passed down to pre|inwrite_rec_hook. It is more useful that 'parts'
  for those hooks, because when those hooks are called, 'parts' has
  possibly been mangled (like with LSN compression) and is so
  unpredictable.
storage/maria/ma_open.c:
  fix for "empty body in if() statement" (when compiling without safemutex)
storage/maria/ma_pagecache.c:
  <= is enough
storage/maria/ma_recovery.c:
  * print the time that each recovery phase (REDO/UNDO/flush) took;
  this is enabled only when recovering from ha_maria. Is it printed
  n seconds with a fractional part of one digit (like 123.4 seconds).
  * In the REDO phase, update the table's live checksum by using
  the checksum delta stored in UNDO_ROW_INSERT|DELETE|UPDATE and CLR_END.
  Update it too when seeing REDO_DELETE_ALL.
  * In the UNDO phase, when executing UNDO_ROW_INSERT, if the table does
  not have live checksum then reading the record's header (as done by
  the master loop of run_undo_phase()) is enough; otherwise we
  do a translog_read_record() to have the checksum delta ready
  for _ma_apply_undo_row_insert().
  * When at the end of the REDO phase we notice that there is an unfinished
  group of REDOs, don't assert in debug binaries, as I verified that it
  can happen in real life (with kill -9)
  * removing ' in #error as it confuses gcc3
storage/maria/ma_rename.c:
  new prototype of translog_write_record()
storage/maria/ma_test_recovery.expected:
  Change in output of ma_test_recovery: now all live checksums of
  original tables equal those of tables recreated by the REDO phase
  and those of tables fixed by the UNDO phase. I.e. recovery of
  the live checksum looks like working (which was after all the only
  goal of this changeset).
  I checked by hand that it's not just all live checksums which are
  now 0 and that's why they match. They are the old values like
  3757530372. maria.test has hard-coded checksum values in its result
  file so checks this too.
storage/maria/ma_update.c:
  * It's useless to put up HA_STATE_CHANGED in 'key_changed',
  as we put up HA_STATE_CHANGED in info->update anyway.
  * We need to compute the old and new rows' checksum before calling
  (*update_record)(), as checksum delta must be known when logging
  UNDO_ROW_UPDATE which is done by _ma_update_block_record(). Note that
  some functions change the 'newrec' record (at least _ma_check_unique()
  does) so we cannot move the checksum computation too early in the
  function.
storage/maria/ma_write.c:
  If inserting into a transactional table, live's checksum was
  already updated when writing UNDO_ROW_INSERT. The multiplication
  is a trick to save an if().
storage/maria/unittest/ma_test_loghandler-t.c:
  new prototype of translog_write_record()
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
  new prototype of translog_write_record()
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
  new prototype of translog_write_record()
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  new prototype of translog_write_record()
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  new prototype of translog_write_record()
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
  new prototype of translog_write_record()
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
  new prototype of translog_write_record()
storage/maria/unittest/ma_test_loghandler_purge-t.c:
  new prototype of translog_write_record()
storage/myisam/sort.c:
  fix for compiler warnings in pushbuild (write_merge_key* functions
  didn't have their declaration match MARIA_HA::write_key).
2007-10-02 18:02:09 +02:00
unknown
8e10231bf0 Merge desktop.sanja.is.com.ua:/home/bell/mysql/bk/mysql-maria
into  desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-recovery
2007-10-02 00:03:15 +03:00
unknown
48ed54c140 Fixed problem with scanner destruction (unpinned page in the cache).
storage/maria/ma_loghandler.c:
  Debug output adder to control scanner freeing.
  Fixed problem with scanner destruction (unpinned page in the cache).
2007-10-01 23:51:57 +03:00
unknown
3c3e3648db fater way to detect last page address for the last log file.
gprof build for amd64.


storage/maria/ma_loghandler.c:
  fater way to detect last page address for the last log file.
BUILD/compile-amd64-gprof-no-ndb:
  New BitKeeper file ``BUILD/compile-amd64-gprof-no-ndb''
2007-10-01 18:48:20 +03:00
unknown
69c18ca576 ma_recovery.c:
SCCS merged


storage/maria/ma_recovery.c:
  SCCS merged
2007-10-01 17:31:46 +02:00
unknown
e71e5893ee Incorrect function call fixed. 2007-10-01 09:59:05 +03:00
unknown
eba50ef4c8 Merge dfischer@bk-internal.mysql.com:/home/bk/mysql-5.1-build
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build
2007-09-29 09:33:05 +02:00
unknown
d340f19706 Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build-work
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build
2007-09-29 09:28:05 +02:00
unknown
a069b89bf4 align types 2007-09-29 09:26:33 +02:00
unknown
d097806323 fix typo 2007-09-27 21:45:45 +03:00
unknown
6f296a01ac Fixed merge problems.
BitKeeper/etc/ignore:
  Added libmysql_r/client_settings.h libmysqld/scheduler.cc libmysqld/sql_connect.cc libmysqld/sql_tablespace.cc to the ignore list
2007-09-27 20:00:40 +03:00
unknown
396c543429 Merge pwbook.sanja.is.com.ua:/home/bell/mysql/bk/mysql-maria
into  pwbook.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-logref
2007-09-27 17:57:40 +03:00
unknown
5d6fac2784 Merge trift-lap.fambruehe:/MySQL/M51/push-5.1
into  trift-lap.fambruehe:/MySQL/M51/antony-5.1


Makefile.am:
  Auto merged
configure.in:
  Auto merged
storage/innobase/handler/ha_innodb.cc:
  Auto merged
mysql-test/suite/funcs_1/r/innodb__datadict.result:
  Use most current version of test results.
mysql-test/suite/funcs_1/r/memory__datadict.result:
  Use most current version of test results.
mysql-test/suite/funcs_1/r/myisam__datadict.result:
  Use most current version of test results.
mysql-test/suite/funcs_1/r/ndb__datadict.result:
  Use most current version of test results.
2007-09-27 16:51:40 +02:00
unknown
0de4c55623 Faster translog_filename_by_fileno
Fixed compiler warning
PAGECACHE_PAGE_LINK -> PAGECACHE_BLOCK_LINK*


storage/maria/ma_loghandler.h:
  PAGECACHE_PAGE_LINK -> PAGECACHE_BLOCK_LINK*
storage/maria/ma_pagecache.c:
  PAGECACHE_PAGE_LINK -> PAGECACHE_BLOCK_LINK*
storage/maria/ma_pagecache.h:
  PAGECACHE_PAGE_LINK -> PAGECACHE_BLOCK_LINK*
storage/maria/maria_def.h:
  PAGECACHE_PAGE_LINK -> PAGECACHE_BLOCK_LINK*
2007-09-27 17:41:21 +03:00
unknown
7492e2ca8e Use direct memory access for the log scan
BUILD/SETUP.sh:
  compile maria by default
2007-09-27 17:36:03 +03:00
unknown
f4afcec393 Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into  hynda.mysql.fi:/home/my/mysql-maria


BitKeeper/etc/ignore:
  auto-union
BUILD/SETUP.sh:
  Auto merged
BitKeeper/deleted/.del-CMakeLists.txt~99a50df6:
  Auto merged
Makefile.am:
  Auto merged
client/mysqldump.c:
  Auto merged
configure.in:
  Auto merged
include/Makefile.am:
  Auto merged
include/keycache.h:
  Auto merged
include/m_string.h:
  Auto merged
include/my_sys.h:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
  Auto merged
mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/lib/mtr_misc.pl:
  Auto merged
mysql-test/lib/mtr_process.pl:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/lib/mtr_timer.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/alter_table.result:
  Auto merged
mysql-test/r/merge.result:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/suite/ndb/r/ps_7ndb.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_events.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_insert.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_row_insert_delayed.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
  Auto merged
mysql-test/suite/rpl/t/rpl_insert.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
  Auto merged
mysql-test/t/alter_table.test:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
mysys/array.c:
  Auto merged
mysys/mf_keycache.c:
  Auto merged
mysys/my_init.c:
  Auto merged
mysys/my_symlink2.c:
  Auto merged
mysys/safemalloc.c:
  Auto merged
mysys/thr_lock.c:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/ha_partition.h:
  Auto merged
sql/handler.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_xmlfunc.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sql_test.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/udf_example.c:
  Auto merged
sql/uniques.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
storage/csv/ha_tina.h:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ft_nlq_search.c:
  Auto merged
storage/myisam/ft_parser.c:
  Auto merged
storage/myisam/ft_stopwords.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/ha_myisam.h:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_create.c:
  Auto merged
storage/myisam/mi_delete.c:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
storage/myisam/mi_extra.c:
  Auto merged
storage/myisam/mi_key.c:
  Auto merged
storage/myisam/mi_locking.c:
  Auto merged
storage/myisam/mi_log.c:
  Auto merged
storage/myisam/mi_packrec.c:
  Auto merged
storage/myisam/mi_rkey.c:
  Auto merged
storage/myisam/mi_search.c:
  Auto merged
storage/myisam/mi_test1.c:
  Auto merged
storage/myisam/mi_test2.c:
  Auto merged
storage/myisam/mi_update.c:
  Auto merged
storage/myisam/mi_write.c:
  Auto merged
storage/myisam/myisamchk.c:
  Auto merged
storage/myisam/myisamlog.c:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
storage/myisam/sort.c:
  Auto merged
storage/myisam/sp_test.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
storage/myisammrg/ha_myisammrg.h:
  Auto merged
storage/ndb/src/mgmapi/mgmapi.cpp:
  Auto merged
support-files/compiler_warnings.supp:
  Auto merged
client/mysqltest.c:
  Manual merge between mysql-5.1 and mysql-maria
include/my_base.h:
  Manual merge between mysql-5.1 and mysql-maria
include/my_global.h:
  Manual merge between mysql-5.1 and mysql-maria
include/myisam.h:
  Manual merge between mysql-5.1 and mysql-maria
libmysql/Makefile.shared:
  Manual merge between mysql-5.1 and mysql-maria
mysql-test/r/events_logs_tests.result:
  Manual merge between mysql-5.1 and mysql-maria
mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
  Manual merge between mysql-5.1 and mysql-maria
mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
  Manual merge between mysql-5.1 and mysql-maria
mysql-test/t/disabled.def:
  Manual merge between mysql-5.1 and mysql-maria
mysql-test/t/events_logs_tests.test:
  Manual merge between mysql-5.1 and mysql-maria
mysys/my_compress.c:
  Manual merge between mysql-5.1 and mysql-maria
mysys/my_getsystime.c:
  Manual merge between mysql-5.1 and mysql-maria
mysys/my_open.c:
  Manual merge between mysql-5.1 and mysql-maria
sql/handler.cc:
  Manual merge between mysql-5.1 and mysql-maria
sql/set_var.h:
  Manual merge between mysql-5.1 and mysql-maria
sql/sql_class.h:
  Manual merge between mysql-5.1 and mysql-maria
sql/sql_show.cc:
  Manual merge between mysql-5.1 and mysql-maria
sql/sql_sort.h:
  Manual merge between mysql-5.1 and mysql-maria
sql/sql_yacc.yy:
  Manual merge between mysql-5.1 and mysql-maria
sql/table.cc:
  Manual merge between mysql-5.1 and mysql-maria
storage/csv/ha_tina.cc:
  Manual merge between mysql-5.1 and mysql-maria
storage/myisam/mi_open.c:
  Manual merge between mysql-5.1 and mysql-maria
storage/myisam/myisamdef.h:
  Manual merge between mysql-5.1 and mysql-maria
unittest/mysys/my_atomic-t.c:
  Manual merge between mysql-5.1 and mysql-maria
2007-09-27 17:05:07 +03:00
unknown
c9c58163a9 Remove SAFE_MODE for opt_range as it disables UPDATE to use keys
REDO optimization (Bascily avoid moving blocks from/to pagecache)
More command line arguments to maria_read_log
Fixed recovery bug when recreating table


sql/opt_range.cc:
  Remove SAFE_MODE for opt_range as it disables UPDATE to use keys
storage/maria/ma_blockrec.c:
  REDO optimization
  Use new interface for pagecache_reads to avoid copying page buffers
storage/maria/ma_loghandler.c:
  Patch from Sanja:
  - Added new parameter to translog_get_page to use direct links to pagecache
  - Changed scanner to be able to use direct links
  
  This avoids a lot of calls to bmove512() in page cache.
storage/maria/ma_loghandler.h:
  Added direct link to pagecache objects
storage/maria/ma_open.c:
  Added const to parameter
  Added missing braces
storage/maria/ma_pagecache.c:
  From Sanja:
  - Added direct links to pagecache (from pagecache_read())
    Dirrect link means that on pagecache_read we get back a pointer to the pagecache buffer
  
  
  From Monty:
  - Fixed arguments to init_page_cache to handle big page caches
  - Fixed compiler warnings
  - Replaced PAGECACHE_PAGE_LINK with PAGECACHE_BLOCK_LINK * to catch errors
storage/maria/ma_pagecache.h:
  Changed block numbers from int to long to be able to handle big page caches
  Changed some PAGECACHE_PAGE_LINK to PAGECACHE_BLOCK_LINK
storage/maria/ma_recovery.c:
  Fixed recovery bug when recreating table (table was kept open)
  Moved some variables to function start (portability)
  Added space to some print messages
storage/maria/maria_chk.c:
  key_buffer_size -> page_buffer_size
storage/maria/maria_def.h:
  Changed default page_buffer_size to 10M
storage/maria/maria_read_log.c:
  Added more startup options:
  --version
  --undo (apply undo)
  --page_cache_size (to run with big cache sizes)
  --silent (to not get any output from --apply)
storage/maria/unittest/ma_control_file-t.c:
  Fixed compiler warning
storage/maria/unittest/ma_test_loghandler-t.c:
  Added new argument to translog_init_scanner()
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  Added new argument to translog_init_scanner()
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  Added new argument to translog_init_scanner()
2007-09-27 14:18:28 +03:00
unknown
301a31fddf WL#3072 Maria recovery
Minor change: decouple the writing of a recovery trace from
compilation with --with-debug; that writing happens if and only
if EXTRA_DEBUG. So one can enable (by defining EXTRA_DEBUG) a recovery trace
in a non-debug build.


storage/maria/ma_recovery.c:
  Small optimization. Decouple recovery trace from --with-debug.
2007-09-25 15:52:01 +02:00
unknown
8b5dddbc00 WL#3072 Maria recovery
Progress reports on stderr if doing recovery from ha_maria;
don't do checkpoints if activity since last checkpoint < 2MB
(no change in fact as background thread is disabled for now);
recovery trace is only if EXTRA_DEBUG now (better for benchmarks).


storage/maria/ma_checkpoint.c:
  don't do checkpoints if activity (log writes plus page flushes)
  since last checkpoint was < 2MB.
storage/maria/ma_recovery.c:
  progress reports in recovery (10%, transactions left to rollback etc);
  that is only if from ha_maria and is displayed on stderr.
  Recovery trace is now created only if EXTRA_DEBUG.
storage/maria/ma_test_recovery.expected:
  update (--debug gone)
storage/maria/ma_test_recovery:
  don't use --debug, as it can absent from binary
2007-09-25 11:54:35 +02:00
unknown
1f1975681b Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22
into  trift-lap.fambruehe:/MySQL/M51/antony-5.1


mysql-test/suite/funcs_1/include/ndb_tb2.inc:
  Auto merged
mysql-test/suite/funcs_1/r/innodb_views.result:
  Auto merged
mysql-test/suite/funcs_1/r/memory_views.result:
  Auto merged
mysql-test/suite/funcs_1/r/myisam_views.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_cursors.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_func_view.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_storedproc_07.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_storedproc_08.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_0102.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_03.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_03e.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_0407.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_08.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_09.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_views.result:
  Auto merged
mysql-test/suite/funcs_1/views/views_master.inc:
  Auto merged
sql/ha_partition.h:
  Auto merged
storage/innobase/handler/ha_innodb.cc:
  Auto merged
configure.in:
  Version is updated already.
sql/ha_partition.cc:
  Manual merge of 5.1.22 changes into main.
2007-09-24 15:33:46 +02:00
unknown
cfc49fdcb6 Merge abelkin@bk-internal.mysql.com:/home/bk/mysql-maria
into  pwbook.sanja.is.com.ua:/home/bell/mysql/bk/mysql-maria


storage/maria/ma_loghandler.c:
  Auto merged
2007-09-21 13:56:28 +03:00
unknown
e88aa0c84e Transaction log flush serialization. 2007-09-21 13:48:57 +03:00
unknown
92771001b3 fixed type conversion warnings revealed by bug 30639 2007-09-21 10:15:16 +02:00
unknown
59259dd1f2 In non-debug builds, the log handler failed to read any log
record (for example in ma_test_loghandler-t). Reason was
wrongly matched () in DBUG.


storage/maria/ma_loghandler.c:
  Wrongly matched parenthesis:
  DBUG_PRINT(keyword, argslist) expands to roughly
  _db_doprnt arglist;
  So DBUG_PRINT("enter",(a);
  b;
  c);
  expands to roughly
  _db_doprnt(a);b;c;
  which is valid code. Except that in non-debug builds, DBUG_PRINT(
  expands to nothing so the wrongly "included" code is thrown away,
  leading to some members of "scanner" to not be initialized.
2007-09-20 18:02:36 +02:00
unknown
95420b947e fix for non-debug compilation errors.
Note that non-debug build fails in log handler functions, mail sent.


storage/maria/ma_blockrec.c:
  fix for compiler warning
storage/maria/ma_checkpoint.c:
  Debug build does not catch this situation
  static int f();
  ...
  f(2);
  ...
  static int f(int a, int b);
  Maybe this is because it believes the declaration is K&R. Non-debug
  build catches it. Adding (void) as an habit to avoid such errors.
storage/maria/ma_checkpoint.h:
  adding (void)
storage/maria/ma_recovery.c:
  adding (void)
storage/maria/ma_recovery.h:
  adding (void)
2007-09-20 16:11:46 +02:00
unknown
be382b4220 Fix for segmentation fault when updating a record having a small
BLOB whose size didn't change. Fix for probably impossible problem
in Recovery.


mysql-test/r/maria.result:
  result for new test
mysql-test/t/maria.test:
  testcase for a bug (used to segfault)
storage/maria/ma_blockrec.c:
  When writing a record, we put BLOBs into the head part if there is
  room for them. "Is there room" was first decided by
  !(tmp_data + length > end_of_data) (line 1894)
  but then was tested again as
  *blob_lengths < (ulong)(end_of_data - data). We see that in case of
  equality, the first condition was true but the second was not,
  so it was inconsistent and crashed later.
storage/maria/ma_recovery.c:
  When wondering if recovery should update the state (like state.records):
  if table was closed, its is_of_horizon was set to X, then
  table was reopened and a REDO was written. If this REDO had LSN
  X (as horizon is just a lower bound of the LSN of the next record),
  we have to apply it. In practice this equality probably could not
  happen because of LOGREC_FILE_ID would be written before the REDO.
2007-09-20 10:31:25 +02:00
unknown
9c2ff270fa WL#3072 Maria Recovery
* recovery from ha_maria now skips replaying DDLs (too dangerous)
* maria_read_log still replays DDLs, print warning about issues
* fixes to replaying of REDO_RENAME
* don't replay DDLs on corrupted tables (safer)
* print a one-line message when really doing a recovery (applies to
ha_maria, not maria_read_log) i.e. some REDOs or UNDOs are read.


storage/maria/ma_checkpoint.c:
  fix for assertion failure
storage/maria/ma_recovery.c:
  * Recovery from ha_maria now skips replaying DDLs (as the initial
  plan said) as this is unsafe in case of crashes during the DDL;
  applying the records may do harm (destroy important files)
  so we prefer to leave the "mess" of files untouched. A proper
  recovery of DDLs requires very careful thinking, probably testing
  separately the existence of the data and index file instead of
  using maria_open() which tests the existence of both, and maybe
  storing create_rename_lsn in the data file too.
  * maria_read_log still replays DDLs, we print a warning about dangers
  (due to ALTER TABLE not logging insertions into the tmp table; we
  will maybe need an option to have logging of those insertions).
  * fixes to replaying of REDO_RENAME (test create_rename_lsn of 'new_name'
  table if it exists; if that table exists and is more recent than the
  record, remove the 'old_name' table).
  * don't replay DDLs on corrupted tables (play safe)
  * fail also in non-debug builds if table is open when it should not be
  (when creating it for example, it should not be already open).
  * when the trace file is not stdout (i.e. when this is ha_maria),
  if really doing a recovery (reading REDOs or UNDOs), print a one-line
  message to stderr to inform about start and end of recovery
  (useful to know what mysqld is doing, especially if it takes long
  or crashes).
storage/maria/ma_recovery.h:
  parameter to replay DDLs or not
storage/maria/maria_read_log.c:
  replay DDLs in maria_read_log, to be able to recreate tables from
  scratch.
2007-09-15 14:45:26 +02:00
unknown
19b75b6c73 Fixes problem with getting not LSN address gotten from
horizon addres.


storage/maria/ma_loghandler.c:
  New function to get correct LSN from chunk address.
storage/maria/ma_loghandler.h:
  New function to get correct LSN from chunk address.
2007-09-14 15:01:44 +03:00
unknown
f77e2969ef Check of log initialization added.
storage/maria/ma_loghandler.c:
  Check of log initialization added.
  Function descriptions fixed.
2007-09-14 09:17:36 +03:00
unknown
a303f5b2c8 Fixes of the empty log problem.
storage/maria/ma_checkpoint.c:
  The new macro for easier printing LSN added.
storage/maria/ma_loghandler.c:
  The assertion returned.
  The new macro for easier printing LSN added.
storage/maria/ma_loghandler_lsn.h:
  The new macro for easier printing LSN added.
storage/maria/ma_pagecache.c:
  The new macro for easier printing LSN added.
storage/maria/ma_recovery.c:
  Recovery checks empty log state.
  RECHEADER_READ_ERROR means some real error.
storage/maria/maria_read_log.c:
  Read log starts from real beggining of the log and precess
  error and empty log states.
  The new macro for easier printing LSN added.
storage/maria/unittest/ma_test_loghandler-t.c:
  The new macro for easier printing LSN added.
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
  The new macro for easier printing LSN added.
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
  The new macro for easier printing LSN added.
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  The new macro for easier printing LSN added.
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  The new macro for easier printing LSN added.
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
  The new macro for easier printing LSN added.
2007-09-13 10:37:51 +03:00
unknown
fa12674c09 Changes for pushbuild test runs and VSC compile warnings
mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
  Fix test results for pushbuild
mysql-test/suite/rpl/t/rpl_innodb_bug28430.test:
  Fix test results for pushbuild
mysql-test/suite/rpl/t/rpl_innodb_bug30888.test:
  Fix test results for pushbuild
storage/innobase/handler/ha_innodb.cc:
  resolve a VSC++ typecast compile warning.
2007-09-12 18:16:50 -07:00
unknown
23227604be undo unneccessary change to ha_innodb.cc
remove 'drop database' from new tests.


mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
  remove "DROP DATABASE test"
mysql-test/suite/rpl/r/rpl_innodb_bug30888.result:
  remove "DROP DATABASE test"
mysql-test/suite/rpl/r/rpl_innodb_bug30919.result:
  remove "DROP DATABASE test"
mysql-test/suite/rpl/t/rpl_innodb_bug28430.test:
  remove "DROP DATABASE test"
mysql-test/suite/rpl/t/rpl_innodb_bug30888.test:
  remove "DROP DATABASE test"
mysql-test/suite/rpl/t/rpl_innodb_bug30919.test:
  remove "DROP DATABASE test"
storage/innobase/handler/ha_innodb.cc:
  undo unneccessary edits.
2007-09-12 13:35:39 -07:00
unknown
9b2663926b MY_ALLOW_ZERO_PTR in my_realloc() to fix safemalloc errors in pushbuild
storage/maria/ma_recovery.c:
  MY_ALLOW_ZERO_PTR needed as log_record_buffer.str is initially NULL.
2007-09-12 19:18:52 +02:00
unknown
20d871e5de fix for pushbuild test failure (my_realloc() failed => checkpoint
failed => Maria didn't start => tables were created as MyISAM).


storage/maria/ma_checkpoint.c:
  safemalloc complains if my_realloc() is passed NULL and
  MY_ALLOW_ZERO_PTR is not used.
2007-09-12 14:46:05 +02:00