Commit graph

88 commits

Author SHA1 Message Date
Jimmy Yang
d754b57199 Fix bug #52546, crash on shutdown of plugin with innodb_use_sys_malloc=0.
rb://339, approved by Sunny Bains.
2010-05-17 01:57:42 -07:00
Vasil Dimov
0ad0827fde Merge mysql-trunk-innodb from bk-internal locally 2010-05-13 10:53:09 +03:00
Vasil Dimov
2d299d84f9 Followup to Bug#51920, fix binlog.binlog_killed
This is a followup to the fix of

Bug#51920 Innodb connections in row lock wait ignore KILL until lock wait
timeout

in that fix (rb://279) the behavior was changed to honor when a trx is
interrupted during lock wait, but the returned error code was still
"lock wait timeout" when it should be "interrupted".

This change fixes the non-deterministically failing test binlog.binlog_killed,
that failed like this:

binlog.binlog_killed 'stmt'              [ fail ]
        Test ended at 2010-05-12 11:39:08

CURRENT_TEST: binlog.binlog_killed
mysqltest: At line 208: query 'reap' failed with wrong errno 1205: 'Lock wait timeout exceeded; try restarting transaction', instead of 0...

Approved by:	Sunny Bains (rb://344)
2010-05-13 10:46:52 +03:00
Sunny Bains
49f5ce6ddd Cover the srv_suspend_thread() call by the kernel mutex. This change was
forgotten when I reverted the kernel mutex split patch.
2010-05-13 06:58:43 +10:00
Sunny Bains
e9a072f48e Remove references to srv0que.h. 2010-05-12 12:20:26 +10:00
Sunny Bains
02fc9f0223 Revert the kernel mutex split phase I patch. Some artefacts have been left
in the code but they have nothing to do with the kernel mutex split code.
Some subsequent commits use the new functions. This patch has been tested
with: ./mtr --suite=innodb with UNIV_DEBUG and UNIV_SYNC_DEBUG enabled.
All tests were successful.
2010-05-12 11:18:10 +10:00
Sunny Bains
658ce61215 Add missing ';'. 2010-05-11 13:55:47 +10:00
Sunny Bains
f77390bd1a Fix for bug#53541. We need to check whether the slot has been freed or not
before trying to access the transaction instance.

rb://336
2010-05-11 13:03:24 +10:00
Sunny Bains
e50bf39eba Second part of the fix for bug#53499. We decrement the active thread count
when the purge thread completes by calling srv_suspend_thread().
2010-05-11 12:57:11 +10:00
Sunny Bains
34860f74e4 Fix bug#53499 - purge thread is active during shutdown, assert buf/buf0buf.c line 4115.
Check that all background threads are suspended or shutdown instead of just
checking for the master thread.
rb://333
2010-05-10 13:17:17 +10:00
Calvin Sun
5995b23864 Fix compile errors on x64 Windows.
Change types of srv_purge_batch_size and srv_n_purge_threads
from ulint to ulong.
2010-05-07 16:40:30 -05:00
Sunny Bains
63d9bde50f Add missing semi-colon. 2010-04-30 21:38:12 +10:00
Sunny Bains
8d4c0dbc94 Fix Bug#52983. 2010-04-30 21:00:21 +10:00
Sunny Bains
e579d2ece2 Fix Bug#52983. 2010-04-30 20:54:56 +10:00
Sunny Bains
248dd65fe7 Fix bug introduced by r3038. When a transaction is rolled back by the
lock monitor thread, it may have locks that are granted to waited to
waiting transactions. These waiting transactions will need to be woken
up but their trx->lock_wait_timeout flag will be FALSE causing the old
code to break. What we need is a flag that covers the entire lock
release process not individual transactions. The fix is to move the
flag out of trx_t and into srv_sys_t.
2010-04-28 06:47:47 +10:00
Sunny Bains
de31f61f2f Add a debug assertion for the case where the waiting thread is being woken
up because of a lock wait timeout.
2010-04-23 17:52:09 +10:00
Sunny Bains
7b26e1871a Fix a race condition introduced by r7004. We need to acquire the srv_sys->mutex
for all other cases where we release a suspended thread waiting on a lock other
than those released by the lock wait timer thread.
2010-04-23 15:19:17 +10:00
jyang
83f422fe0c Merge from mysql-trunk-innodb to local repository 2010-04-22 15:15:56 -07:00
jyang
477b7115d4 Register newly added purge thread to performance schema tracking.
rb://289, approved by Marko
2010-04-22 14:51:43 -07:00
Vasil Dimov
f875041fad Merge from innodb-branches-innodb+ 2010-04-22 12:00:59 +03:00
Vasil Dimov
c7525a0130 Merge from innodb-branches-innodb+ (2) 2010-04-19 20:53:16 +03:00
Vasil Dimov
c877ff39bc Import branches/innodb+ from SVN on top of storage/innobase. 2010-04-12 18:20:41 +03:00
Alexander Nozdrin
aceea2342f Manual merge from mysql-trunk-merge.
Conflicts:
  - extra/comp_err.c
  - mysql-test/collections/default.experimental
  - mysql-test/r/archive.result
  - mysql-test/r/select.result
  - mysql-test/suite/binlog/r/binlog_unsafe.result
  - mysql-test/suite/binlog/t/binlog_unsafe.test
  - mysql-test/suite/rpl/t/disabled.def
  - mysql-test/t/archive.test
  - mysql-test/t/select.test
  - sql/item.cc
  - sql/item.h
  - sql/item_timefunc.cc
  - sql/sql_base.cc
  - sql/sql_delete.cc
  - sql/sql_load.cc
  - sql/sql_partition.cc
  - sql/sql_table.cc
  - storage/innobase/handler/ha_innodb.cc
  - vio/vio.c
2009-12-12 23:38:59 +03:00
Satya B
c6c12db965 Merge Innodb Plugin 1.0.6 from mysql-5.1-bugteam storage/innodb_plugin to mysql-trunk-merge.
Merging revisions 3221 to 3230 from mysql-5.1-bugteam
2009-12-02 19:30:50 +05:30
Konstantin Osipov
bae0e81310 Backport of:
-------------------------------------------------------------
revno: 2877
committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
branch nick: 35164-6.0
timestamp: Wed 2008-10-15 19:53:18 -0300
message:
Bug#35164: Large number of invalid pthread_attr_setschedparam calls
Bug#37536: Thread scheduling causes performance degradation at low thread count
Bug#12702: Long queries take 100% of CPU and freeze other applications under Windows

The problem is that although having threads with different priorities
yields marginal improvements [1] in some platforms [2], relying on some
statically defined priorities (QUERY_PRIOR and WAIT_PRIOR) to play well
(or to work at all) with different scheduling practices and disciplines
is, at best, a shot in the dark as the meaning of priority values may
change depending on the scheduling policy set for the process.

Another problem is that increasing priorities can hurt other concurrent
(running on the same hardware) applications (such as AMP) by causing
starvation problems as MySQL threads will successively preempt lower
priority processes. This can be evidenced by Bug#12702.

The solution is to not change the threads priorities and rely on the
system scheduler to perform its job. This also enables a system admin
to increase or decrease the scheduling priority of the MySQL process,
if intended.

Furthermore, the internal wrappers and code for changing the priority
of threads is being removed as they are now unused and ancient.

1. Due to unintentional side effects. On Solaris this could artificially
help benchmarks as calling the priority changing syscall millions of
times is more beneficial than the actual setting of the priority.

2. Where it actually works. It has never worked on Linux as the default
scheduling policy SCHED_OTHER only accepts the static priority 0.


configure.in:
  Remove checks for functions that are not used anymore.
include/config-netware.h:
  Remove unused define.
include/my_pthread.h:
  Remove thread priority changing wrappers.
mysys/my_pthread.c:
  Remove thread priority changing wrappers. They do not work properly
  and their implementations were incorrectly protected by a check for
  HAVE_PTHREAD_SETSCHEDPARAM.
mysys/thr_alarm.c:
  Remove meaningless (100) increase of a thread priority.
sql/mysql_priv.h:
  Remove meaningless thread priority values.
sql/mysqld.cc:
  Don't change thread priorities.
sql/slave.cc:
  Don't change thread priorities.
sql/slave.h:
  Update function prototype.
sql/sql_parse.cc:
  Don't change thread priorities.
sql/sql_prepare.cc:
  Don't change thread priorities.
sql/unireg.h:
  Mark flag as obsolete.
storage/innobase/handler/ha_innodb.cc:
  Remove use of obsolete flag and associated behavior.
storage/innobase/include/srv0srv.h:
  Remove use of obsolete flag and associated variables.
storage/innobase/os/os0thread.c:
  Remove use of obsolete flag and associated behavior.
storage/innobase/srv/srv0srv.c:
  Remove use of obsolete flag and associated variables.
2009-11-23 19:57:31 +03:00
Sergey Vojtovich
ced8719400 Merge of innodb-zip-ss6129 from 5.1 to mysql-trunk. 2009-11-05 16:29:58 +04:00
Satya B
d63eb541f5 Merging Innodb plugin 1.0.5 revisions from 5.1-main from revisions 3149 to 3163
also merged missing Innodb plugin revisions r5636,r5635 manually
2009-10-16 17:28:02 +05:30
Guilhem Bichot
7ceb29ff17 Renamed storage/innodb_plugin to storage/innobase, so that 1) it's the same
layout as we always had in trees containing only the builtin
2) win\configure.js WITH_INNOBASE_STORAGE_ENGINE still works.

storage/innobase/CMakeLists.txt:
  fix to new directory name (and like 5.1)
storage/innobase/Makefile.am:
  fix to new directory name (and like 5.1)
storage/innobase/handler/ha_innodb.cc:
  fix to new directory name (and like 5.1)
storage/innobase/plug.in:
  fix to new directory name (and like 5.1)
2009-08-07 12:16:00 +02:00
Guilhem Bichot
b57e4dbd88 Creation of mysql-trunk = {summit + "Innodb plugin replacing the builtin"}:
bzr branch mysql-5.1-performance-version mysql-trunk # Summit
cd mysql-trunk
bzr merge mysql-5.1-innodb_plugin # which is 5.1 + Innodb plugin 
bzr rm innobase # remove the builtin
Next step: build, test fixes.
2009-08-04 13:25:19 +02:00
Kelly Long
1a0c2153a0 Fix Bug#44671
Part of the 'show status' code was erronously removed when the google
	patch was applied.  This patch puts it back.
2009-07-21 14:10:09 -06:00
Mikael Ronstrom
c75a265381 Merged in 5.1.35 2009-07-01 14:36:40 +02:00
Mikael Ronstrom
a22c8c5be5 Merge MySQL 5.1.35 into MySQL 5.4 2009-06-11 12:07:59 +02:00
MySQL Build Team
782b8f0550 Some portability fixes.
include/Makefile.am: use @PERL@ to call scripts/dheadgen.pl - don't rely on #! /usr/bin/perl
scripts/dheadgen.pl: use 2-arg open() for compatibility with older Perl versions
storage/innobase/srv/srv0srv.c: Don't use C++-style comments in C code
2009-06-04 18:47:38 +02:00
Satya B
07b9358860 Applying InnoDB snashot 5.1-ss5024,part 3. Fixes BUG#42101
BUG#42101 - Race condition in innodb_commit_concurrency

Detailed revision comments:

r4994 | marko | 2009-05-14 15:04:55 +0300 (Thu, 14 May 2009) | 18 lines
branches/5.1: Prevent a race condition in innobase_commit() by ensuring
that innodb_commit_concurrency>0 remains constant at run time. (Bug #42101)

srv_commit_concurrency: Make this a static variable in ha_innodb.cc.

innobase_commit_concurrency_validate(): Check that innodb_commit_concurrency
is not changed from or to 0 at run time.  This is needed, because
innobase_commit() assumes that innodb_commit_concurrency>0 remains constant.
Without this limitation, the checks for innodb_commit_concurrency>0
in innobase_commit() should be removed and that function would have to
acquire and release commit_cond_m at least twice per invocation.
Normally, innodb_commit_concurrency=0, and introducing the mutex operations
would mean significant overhead.

innodb_bug42101.test, innodb_bug42101-nonzero.test: Test cases.

rb://123 approved by Heikki Tuuri
2009-05-19 13:50:28 +05:30
Satya B
c470d5e46e Applying InnoDB snashot 5.1-ss4699, part 3. Fixes BUG#43660
1) BUG#43660 - SHOW INDEXES/ANALYZE does NOT update cardinality 
               for indexes of InnoDB table

Detailed revision comments:

r4699 | vasil | 2009-04-09 14:01:52 +0300 (Thu, 09 Apr 2009) | 15 lines
branches/5.1:

Fix Bug#43660 SHOW INDEXES/ANALYZE does NOT update cardinality for indexes
of InnoDB table

by replacing the PRNG that is used to pick random pages with a better
one.

This is based on r4670 but also adds a new configuration option and
enables the fix only if this option is changed. Please skip the present
revision when merging.

Approved by:	Heikki (via email)
2009-04-15 18:11:54 +05:30
Mikael Ronstrom
c73f724e59 Yet another attempt to fix Windows 2009-02-26 07:44:36 +01:00
Mikael Ronstrom
60cc7909df Trying a workaround for the Windows crashes 2009-02-26 00:58:28 +01:00
Mikael Ronstrom
a097ea01e7 Fix for Windows 2009-02-24 16:43:05 +01:00
Mikael Ronstrom
6db314c628 Merged Performance Version 0.2.1 with latest 5.1 tree (last push 11 feb 14.01.13 2009) 2009-02-17 13:24:09 +01:00
Mikael Ronstrom
7c533921be Updated InnoDB defaults
1) Buffer Pool size now defaults to 1GB and a minimum of 64MB
2) Log files are 3 by default and each 128MB in size
3) Removed innodb-file-io-threads config variable since no longer used
4) Set read io and write io threads to 8 by default for better default performance
5) Set log buffer size to 16 MB by default and minimum to 2MB
6) Set additional memory buffer pool to 8 MB and minimum to 2MB
7) Set max dirty percent to 75% and decreased to 99% to never allow a completely dirty buffer pool
8) Increased io capacity to 200 for a good default
2009-02-06 15:59:28 +01:00
Timothy Smith
fc3b2bfc9e Applying InnoDB snapshot innodb-5.1-ss3603
Detailed description of changes:
r3257 | inaam | 2008-11-24 22:06:50 +0200 (Mon, 24 Nov 2008) | 13 lines
branches/5.1 bug#40760

The config param innodb_thread_concurrency is dynamically set and is
read when a thread enters/exits innodb. If the value is changed between
the enter and exit time the behaviour becomes erratic.
The fix is not to use srv_thread_concurrency when exiting, instead use
the flag trx->declared_to_be_inside_innodb.

rb://57

Approved by: Marko
2009-01-12 23:31:05 +01:00
Timothy Smith
293e9c49c4 Applying InnoDB snapshot innodb-5.1-ss3603
Detailed description of changes:
r2902 | vasil | 2008-10-28 12:10:25 +0200 (Tue, 28 Oct 2008) | 10 lines
branches/5.1:

Fix Bug#38189 innodb_stats_on_metadata missing

Make the variable innodb_stats_on_metadata visible to the users and
also settable at runtime. Previously it was only "visible" as a command
line startup option to mysqld.

Approved by:	Marko (https://svn.innodb.com/rb/r/36)
2009-01-12 23:08:22 +01:00
Mikael Ronstrom
8338bff34b Fixed compiler warnings on various platforms 2008-12-15 09:44:00 +01:00
Timothy Smith
1c0d9aa082 Complete application of InnoDB snapshot innodb-5.1-ss2485, part 2. Fixes
Bug #36149: Read buffer overflow in srv0start.c found during "make test"


Detailed revision comments:

r2485 | vasil | 2008-05-28 16:01:14 +0300 (Wed, 28 May 2008) | 9 lines
branches/5.1:

Fix Bug#36149 Read buffer overflow in srv0start.c found during "make test"

Use strncmp(3) instead of memcmp(3) to avoid reading past end of the string
if it is empty (*str == '\0'). This bug is _not_ a buffer overflow.

Discussed with:	Sunny (via IM)
2008-12-14 12:21:24 -07:00
Timothy Smith
efbac9aabc Complete application of InnoDB snapshot innodb-5.1-ss2485, part 1. Fixes
Bug #36819: ut_usectime does not handle errors from gettimeofday


Detailed revision comments:

r2480 | vasil | 2008-05-27 11:40:07 +0300 (Tue, 27 May 2008) | 11 lines
branches/5.1:

Fix Bug#36819 ut_usectime does not handle errors from gettimeofday

by retrying gettimeofday() several times if it fails in ut_usectime().
If it fails on all calls then return error to the caller to be handled
at higher level.

Update the variable innodb_row_lock_time_max in SHOW STATUS output only
if ut_usectime() was successful.
2008-12-14 12:18:59 -07:00
Mikael Ronstrom
5d615366ea Introduced a new timer based innodb thread concurrency. A new
parameter innodb_thread_concurrency_timer_based is used to
get this new feature (it is set by default). The new feature
is only available on platforms where atomic instructions are
available.
2008-12-12 21:17:15 +01:00
Mikael Ronstrom
aefc0acaf2 Minor modifications to spin values which showed to be slightly better. 2008-12-10 18:54:23 +01:00
Mikael Ronstrom
9d854d55a8 Ensure background wake-up thread doesn't cause deadlocks 2008-12-05 14:08:28 +01:00
Mikael Ronstrom
c8d1b89f03 Added counter of number of missed wakeups of InnoDB threads 2008-11-17 22:54:32 +01:00
Mikael Ronstrom
7e065ee9ae Merge port of Google SMP patch to Solaris 2008-10-30 10:23:36 +01:00