Commit graph

1611 commits

Author SHA1 Message Date
Alexander Nozdrin
3c11750e36 Auto-merge from mysql-next-mr. 2009-11-25 16:46:45 +03:00
Marc Alff
e2a34cbf70 WL#2373 Use cycle counter for timing 2009-11-24 16:36:31 -07:00
Alexander Nozdrin
be0add42f5 Auto-merge from mysql-next-mr. 2009-11-24 22:39:05 +03:00
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
Marc Alff
244eced1a7 WL#3230 concurrent hash
Backport from 6.0.14 to 5.6.0

Original code from Sergei Golubchik
2009-11-17 19:31:40 -07:00
Marc Alff
382ae22290 WL#2595 kernel-independent atomic operations
Backport from 6.0.14 to 5.6.0

Original code from Sergei Golubchik
2009-11-17 17:11:32 -07:00
Alexander Nozdrin
780871d8b9 Update version tag (new: 5.6). 2009-11-12 06:11:55 +03:00
Alexander Nozdrin
d476bbb0be Auto-merge from mysql-next-mr. 2009-11-05 15:08:37 +03:00
Sergei Golubchik
3d23068f3a WL#4903 Plugin Service API part I
(mysql-next-mr backport)
2009-11-02 21:05:42 +01:00
Alexander Nozdrin
22fe8e10e2 Merge from mysql-next-mr. 2009-10-28 10:55:44 +03:00
Alexander Nozdrin
2dc132b209 Merge from mysql-next-mr. 2009-10-23 15:22:21 +04:00
Alexander Nozdrin
20eac04d7c Automerge from mysql-next-mr. 2009-10-23 00:20:44 +04:00
Alexander Barkov
c15f970dc8 WL#1349 Use operating system localization to send it as a default client character set 2009-10-21 17:59:47 +05:00
Alexander Nozdrin
03bf73de2f Merge from mysql-5.1. 2009-10-19 17:28:31 +04:00
Joerg Bruehe
29d526838d Merge the bug fixes into the push tree. 2009-10-15 20:28:04 +02:00
Alexander Nozdrin
c69629d269 Merge from mysql-5.1. 2009-10-13 13:42:38 +04:00
Joerg Bruehe
5710aae8bb Fix Bug #47957
A build "--without-server" fails if using "--with-ssl" (YaSSL)

The problem was the lack of directory "extra" in a build
which did not include the server.

configure.in:
  1) Ensure "extra" is in the list of client directories.
  2) Always handle the client directories first, as they will
     be contained in every build (we have client-only, but not
     server-only).
2009-10-09 21:31:37 +02:00
Jon Olav Hauglid
0da357645c Bug #44651 "have_community_features" variable should be renamed
"have_profiling"

1) Renamed have_community_features server system variable to
have_profiling.
2) Removed eable-community-features configure option and
ENABLE_COMMUNITY_FEATURES macro.
3) Removed COMMUNITY_SERVER macro and replaced its usage by 
ENABLED_PROFILING.

Only --enable-profiling is now needed to enable profiling.
It was the only existing "community feature", so there was
no need for both configure options.

Using --enable-community-features will give a warning message
since it no longer exists.
2009-10-09 15:59:25 +02:00
Alexander Nozdrin
798cbaa22a Merge from mysql-trunk. 2009-10-09 13:23:23 +04:00
Alexander Nozdrin
a8b2c0585c Change the version tag (to 5.5.0). 2009-10-09 13:22:26 +04:00
unknown
1cef459c50 Raise version number after cloning 5.1.40 2009-10-06 19:37:08 +02:00
Georgi Kodinov
370acc8b56 automerge 2009-10-04 12:15:05 +03:00
Ingo Struewing
4d57b851a0 WL#4259 - Debug Sync Facility
Backport from 6.0 to 5.1.
Only those sync points are included, which are used in debug_sync.test.

  The Debug Sync Facility allows to place synchronization points
  in the code:
  
  open_tables(...)
  
  DEBUG_SYNC(thd, "after_open_tables");
  
  lock_tables(...)
  
  When activated, a sync point can
  
  - Send a signal and/or
  - Wait for a signal
  
  Nomenclature:
  
  - signal:            A value of a global variable that persists
                       until overwritten by a new signal. The global
                       variable can also be seen as a "signal post"
                       or "flag mast". Then the signal is what is
                       attached to the "signal post" or "flag mast".
  
  - send a signal:     Assign the value (the signal) to the global
                       variable ("set a flag") and broadcast a
                       global condition to wake those waiting for
                       a signal.
  
  - wait for a signal: Loop over waiting for the global condition until
                       the global value matches the wait-for signal.
  
  Please find more information in the top comment in debug_sync.cc
  or in the worklog entry.


.bzrignore:
  WL#4259 - Debug Sync Facility
  Added the symbolic link libmysqld/debug_sync.cc.
CMakeLists.txt:
  WL#4259 - Debug Sync Facility
  Added definition for ENABLED_DEBUG_SYNC.
configure.in:
  WL#4259 - Debug Sync Facility
  Added definition for ENABLED_DEBUG_SYNC.
include/my_sys.h:
  WL#4259 - Debug Sync Facility
  Added definition for the DEBUG_SYNC_C macro.
libmysqld/CMakeLists.txt:
  WL#4259 - Debug Sync Facility
  Added sql/debug_sync.cc.
libmysqld/Makefile.am:
  WL#4259 - Debug Sync Facility
  Added sql/debug_sync.cc.
mysql-test/include/have_debug_sync.inc:
  WL#4259 - Debug Sync Facility
  New include file.
mysql-test/mysql-test-run.pl:
  WL#4259 - Debug Sync Facility
  Added option --debug_sync_timeout.
mysql-test/r/debug_sync.result:
  WL#4259 - Debug Sync Facility
  New test result.
mysql-test/r/have_debug_sync.require:
  WL#4259 - Debug Sync Facility
  New require file.
mysql-test/t/debug_sync.test:
  WL#4259 - Debug Sync Facility
  New test file.
mysys/my_static.c:
  WL#4259 - Debug Sync Facility
  Added definition for debug_sync_C_callback_ptr.
mysys/thr_lock.c:
  WL#4259 - Debug Sync Facility
  Added sync point "wait_for_lock".
sql/CMakeLists.txt:
  WL#4259 - Debug Sync Facility
  Added debug_sync.cc and debug_sync.h.
sql/Makefile.am:
  WL#4259 - Debug Sync Facility
  Added debug_sync.cc and debug_sync.h.
sql/debug_sync.cc:
  WL#4259 - Debug Sync Facility
  New source file.
sql/debug_sync.h:
  WL#4259 - Debug Sync Facility
  New header file.
sql/mysqld.cc:
  WL#4259 - Debug Sync Facility
  Added opt_debug_sync_timeout.
  Added calls to debug_sync_init() and debug_sync_end().
  Fixed a purecov comment (unrelated).
sql/set_var.cc:
  WL#4259 - Debug Sync Facility
  Added server variable "debug_sync".
sql/set_var.h:
  WL#4259 - Debug Sync Facility
  Added declaration for server variable "debug_sync".
sql/share/errmsg.txt:
  WL#4259 - Debug Sync Facility
  Added error messages ER_DEBUG_SYNC_TIMEOUT and ER_DEBUG_SYNC_HIT_LIMIT.
sql/sql_base.cc:
  WL#4259 - Debug Sync Facility
  Added sync points "after_flush_unlock" and "before_lock_tables_takes_lock".
sql/sql_class.cc:
  WL#4259 - Debug Sync Facility
  Added initialization for debug_sync_control to THD::THD.
  Added calls to debug_sync_init_thread() and debug_sync_end_thread().
sql/sql_class.h:
  WL#4259 - Debug Sync Facility
  Added element debug_sync_control to THD.
storage/myisam/myisamchk.c:
  Fixed a typo in an error message string (unrelated).
2009-09-29 17:38:40 +02:00
Joerg Bruehe
a6f7fbb850 Merge 5.1-build up into 5.4-build ("trunk-build"). 2009-09-28 11:39:36 +02:00
Joerg Bruehe
d609fdf98b Upmerge 5.0-build -> 5.1-build. 2009-09-28 11:07:31 +02:00
Joerg Bruehe
b80e34fe00 Merge the fix for bug#47137 into 5.0-build
Solaris binary packages should be compiled with '-g0', not '-g'
2009-09-28 10:43:26 +02:00
Alexander Nozdrin
60781e320f Update version in configure.in. 2009-09-23 13:50:31 +04:00
Alexander Nozdrin
dcf935a198 Update version. 2009-09-22 18:21:44 +04:00
Joerg Bruehe
c78915b218 Fix bug#47137
Solaris binary packages should be compiled with '-g0', not '-g'

The main fix for this is done in the build tools,
but in the sources it affects "configure.in"
which sets "DEBUG_CXXFLAGS" to be used in all debug builds.
2009-09-17 21:50:54 +02:00
Joerg Bruehe
db89051656 Fix bug#46980
Option "--without-server" still not working in 5.1

The general approach is to make sure that source files
which require thread support are only compiled if the build
really needs thread support,
which means when the server is built or a thread-safe client
library.

This required several changes:
- Make sure the subdirectories "storage/" and "plugin/" are
  only processed if the server is built, not ifclient-only.
- Make the compilation of some modules which inherently
  require threading depend on thread supportin the build.
- Separate the handling of threading in "configure.in" from
  that of server issues, threading is also needed in a
  non-server build of a thread-safe client library.

Also, "libdbug" must get built even in a client-only build,
so "dbug/" must be in the list of client directories.

In addition, calls to thread functions in source files which
can be built without thread support must use the wrapper
functions which handle the non-threaded build.
So the modules "client/mysqlimport.c" and "client/mysqlslap.c"
must call "my_thread_end()" only via "mysql_thread_end()".


Makefile.am:
  The directories "storage/" and "plugin/" contain files
  which are needed for the server only, so their contents
  is to be built only if a server is built.
  
  They must not be named unconditionally, because building
  their contents will fail unless threads are enabled.
  
  These directories are now listed in the "configure"
  variable "sql_server_dirs" which becomes part of
  "sql_union_dirs" if the server is to be built.
client/mysqlimport.c:
  Use the wrapper function "mysql_thread_end()" which
  correctly handles the case of a non-threaded build.
client/mysqlslap.c:
  Use the wrapper function "mysql_thread_end()" which
  correctly handles the case of a non-threaded build.
configure.in:
  Various changes to support builds "--without-server":
  
  1) For the unit tests, we need "libdbug".
  
  2) Separate the treatment of the server from that of the
     thread-safe client library.
  
  3) Introduce an "automake conditional" "NEED_THREAD"
     which can be checked in some "Makefile.am".
  
  4) Include "storage/" and "plugin/" in the list of
     "sql_server_dirs" so that they are handled in the
     top "Makefile.am" only if the server is to be built
     (see the change in that file).
mysys/Makefile.am:
  The code of "mf_keycache.c" in 5.1 is no longer safe
  to be built without thread support.
  (In 5.0, this was possible.)
  
  Rather than fix these issues, which is tedious and risky,
  avoid the need to ever build it without thread support:
  It is needed in the server only, which needs thread support.
  
  The only case where we build a "libmysys" without thread
  support is for a non-threaded client, where "mf_keycache"
  is not neded.
  So its inclusion in the list of source files can depend
  on the new conditional "NEED_THREAD".
unittest/mysys/Makefile.am:
  Test program "my_atomic-t" is to verify the correct handling
  of threads only, it cannot be built without thread support
  and is not needed in such cases either.
  
  Let its build depend on the new conditional "NEED_THREAD".
2009-09-17 18:34:24 +02:00
unknown
bd1038fecb Raise version number after cloning 5.0.86 2009-09-08 22:56:00 +02:00
Jonathan Perkin
19d0529819 Raise version number after cloning 5.1.39 2009-09-03 18:20:43 +02:00
unknown
ad49f732b4 Raise version number after cloning 5.4.2-beta 2009-08-26 11:59:49 +02:00
unknown
a2daa87980 Raise version number after cloning 5.0.85 2009-08-11 07:16:52 +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
unknown
606c7e0d12 Raise version number after cloning 5.1.38 2009-08-12 16:41:07 +02:00
unknown
7703b64bfb Raise version number after cloning 5.1.37 2009-07-13 22:43:31 +02:00
unknown
006d97dc97 Raise version number after cloning 5.0.84 2009-07-07 11:47:23 +02:00
Mikael Ronstrom
c75a265381 Merged in 5.1.35 2009-07-01 14:36:40 +02:00
Christoffer Hall
0d54c57c2d Merge from main branch 2009-06-29 14:55:22 +02:00
MySQL Build Team
eed527adc9 Un-drop version number after fiddling with mysql-5.4.1-release branch 2009-06-25 22:09:25 +02:00
Alexey Kopytov
c446ade8e5 Automerge. 2009-06-26 17:59:52 +04:00
Alexey Kopytov
67996ebc08 Automerge. 2009-06-26 17:52:44 +04:00
MySQL Build Team
8c6811c1e0 TEMPORARY drop of version number, only in 5.4.1-release branch 2009-06-24 01:24:20 +02:00
Christoffer Hall
ea963c3693 BUG#42721 configure.in invokes 'nm' directly
A hardcoded use of nm and libc was put into configure.in. This broke
cross-compiling and is bad practice. Fitting variables now used.
2009-06-22 14:43:19 +02:00
Georgi Kodinov
05ecbc7ad9 automerge 2009-06-22 14:53:22 +03:00
Davi Arnaut
4de6d1a80f Bug#42599: error: `pthread_setschedprio' was not declared in this scope
The problem was that a pthread.h header used by gcc did not
declare the pthread_setscheprio, yet the function is implemented
by the function is implemented, causing a autoconf check to pass
and compilation with C++ to fail. The solution is to add a
autoconf check to ensure that the function is properly declared.

configure.in:
  Check that the pthread_setschedprio is declared.
2009-06-18 20:21:47 -03:00
Alexey Kopytov
e544285dc2 Bug #41710: MySQL 5.1.30 crashes on the latest OpenSolaris 10
Change the default optimization level for Sun Studio to "-O1". 
This is a workaround for a Sun Studio bug (see bug #41710 
comments for details): 
 
1. Use $GCC instead of $ac_cv_prog_gcc to check for gcc, since 
the first one is the only documented way to do it. 
 
2. Use $GXX instead of $ac_cv_prog_cxx_g to check for g++, 
since the latter is set to "yes" when the C++ compiler accepts 
"-g" which is the case for both g++ and CC. 
 
3. When building with Sun Studio, set the default values for 
CFLAGS/CXXFLAGS to "-O1", since unlike GCC, Sun Studio 
interprets "-O" as "-xO3" (see the manual pages for cc and CC). 

configure.in:
  1. Use $GCC instead of $ac_cv_prog_gcc to check for gcc, since 
  the first one is the only documented way to do it. 
   
  2. Use $GXX instead of $ac_cv_prog_cxx_g to check for g++, 
  since the latter is set to "yes" when the C++ compiler accepts 
  "-g" which is the case for both g++ and CC. 
   
  3. When building with Sun Studio, set the default values for 
  CFLAGS/CXXFLAGS to "-O1", since unlike GCC, Sun Studio 
  interprets "-O" as "-xO3" (see the manual pages for cc and CC).
2009-06-18 17:11:47 +04:00
Jonathan Perkin
a0fcfc0c12 Raise version number after cloning 5.1.36 2009-06-16 14:00:04 +02:00
unknown
8057aca3f2 Raise version number after 5.4.1-beta build 2009-06-12 17:22:42 +02:00