1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-17 12:02:09 +03:00
Commit Graph

47 Commits

Author SHA1 Message Date
213265130e Remove some trailing whitespaces. 2020-05-29 13:05:35 +02:00
37c14690fc Merge 10.4 into 10.5 2020-03-30 19:07:25 +03:00
9eae063e79 num_worker_threads my_atomic to Atomic_counter 2020-03-27 11:41:46 +04:00
d28686ada6 Merge 10.4 into 10.5 2019-09-12 16:36:46 +03:00
60c04be659 Merge 10.3 into 10.4 2019-09-12 12:16:40 +03:00
da9201dd5b Merge 10.2 into 10.3 2019-09-10 09:25:20 +03:00
2336e0b394 MDEV-20206 : Crash inside timer_callback()[threadpool_win.cc:419]
The most likely cause of the crash is that a timer fired, after it was closed.

MSDN documents such a possibility, in the documentation for
CloseThreadpoolTimer() function, and recommends disabling the timer before
calling WaitForThreadpoolTimerCallbacks()/CloseThreadpoolTimer().

The fix follows this recommendation.

Note, that 5.5-10.1 disabled the timer before close, but this code
was lost in threadpool refactoring in 10.2
2019-09-09 13:52:30 +02:00
44d06cd39d Fix compile warning/error on Windows. 2019-06-18 09:02:52 +02:00
10ebabc364 Windows related cleanups, remove old code.
- Do not scan registry to check if TCPIP is supported.
- Do not read registry under HKEY_LOCAL_MACHINE\SOFTWARE\MySQL anymore.
- Do not load threadpool function dynamically, it is available
since Win7.
- simplify win32_init_tcp_ip(), and return error of WSAStartup() fails.
- Correct comment in my_parameter_handler()
2019-06-18 00:37:10 +01:00
826f9d4f7e Merge 10.4 into 10.5 2019-05-23 10:32:21 +03:00
ce30c99478 Moved vio allocation to connection thread
Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
c07325f932 Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
be85d3e61b Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
f177f125d4 Merge branch '5.5' into 10.1 2019-05-11 19:15:57 +03:00
17b4f99928 Update FSF address
This commit is based on the work of Michal Schorm, rebased on the
earliest MariaDB version.

Th command line used to generate this diff was:

find ./ -type f \
  -exec sed -i -e 's/Foundation, Inc., 59 Temple Place, Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \
  -exec sed -i -e 's/Foundation, Inc. 59 Temple Place.* Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \
  -exec sed -i -e 's/MA.*.....-1307.*USA/MA 02110-1335 USA/g' {} \; \
  -exec sed -i -e 's/Foundation, Inc., 59 Temple/Foundation, Inc., 51 Franklin/g' {} \; \
  -exec sed -i -e 's/Place, Suite 330, Boston, MA.*02111-1307.*USA/Street, Fifth Floor, Boston, MA 02110-1335 USA/g' {} \; \
  -exec sed -i -e 's/MA.*.....-1307/MA 02110-1335/g' {} \;
2019-05-10 20:52:00 +03:00
8f329e8d37 MDEV-10384 Windows : Refactor threading in mysqld startup.
Remove threads that are doing nothing but wait
- main thread now handles the connections
(if threadpool is used, also threadpool threads would wait for connections)
- thread for socket and pipe connections are removed
- shutdown thread is now removed, we wait for shutdown
notification in main thread as well
- kill_server() is also called inside the main thread, after connection
loop finished.
2018-10-05 09:29:22 +01:00
ee98e95e25 MDEV-16536 Remove shared memory transport 2018-08-20 14:11:36 +01:00
30ebc3ee9e Add likely/unlikely to speed up execution
Added to:
- if (error)
- Lex
- sql_yacc.yy and sql_yacc_ora.yy
- In header files to alloc() calls
- Added thd argument to thd_net_is_killed()
2018-05-07 00:07:32 +03:00
56e7b7eaed Make possible to use clang on Windows (clang-cl)
-DWITH_ASAN can be used as well now, on x64

Fix many clang-cl warnings.
2018-02-20 21:17:36 +00:00
4aaa38d26e Enusure that my_global.h is included first
- Added sql/mariadb.h file that should be included first by files in sql
  directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables
  that must be done before my_global.h is included)
- Removed a lot of include my_global.h from include files
- Removed include's of some files that my_global.h automatically includes
- Removed duplicated include's of my_sys.h
- Replaced include my_config.h with my_global.h
2017-08-24 01:05:44 +02:00
74543698a7 MDEV-13179 main.errors fails with wrong errno
The problem was that the introduction of max-thread-mem-used can cause
an allocation error very early, even before mysql_parse() is called.
As mysql_parse() calls thd->reset_for_next_command(), which called
clear_error(), the error number was lost.

Fixed by adding an option to have unique messages for each KILL
signal and change max-thread-mem-used to use this new feature.
This removes a lot of problems with the original approach, where
one could get errors signaled silenty almost any time.

ixed by moving clear_error() from reset_for_next_command() to
do_command(), before any memory allocation for the thread.

Related changes:
- reset_for_next_command() now have an optional parameter if we should
  call clear_error() or not. By default it's called, but not anymore from
  dispatch_command() which was the original problem.
- Added optional paramater to clear_error() to force calling of
  reset_diagnostics_area(). Before clear_error() only called
  reset_diagnostics_area() if there was no error, so we normally
  called reset_diagnostics_area() twice.
- This change removed several duplicated calls to clear_error()
  when starting a query.
- Reset max_mem_used on COM_QUIT, to protect against kill during
  quit.
- Use fatal_error() instead of setting is_fatal_error (cleanup)
- Set fatal_error if max_thead_mem_used is signaled.
  (Same logic we use for other places where we are out of resources)
2017-08-07 03:48:58 +03:00
da4d71d10d Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
f0ec34002a Correct FSF address 2017-03-10 18:21:29 +01:00
f7a7c0c2fe MDEV-10297 Add priorization to threadpool
Also MDEV-10385 Threadpool refactoring
2016-09-22 17:01:28 +00:00
3a7bc23a16 MDEV-9154 : Remove workarounds (mainly dynamic function loading)
for running obsolete versions of Windows
2016-06-01 20:29:10 +02:00
f67a2211ec Merge branch '10.1' into 10.2 2016-03-23 22:36:46 +01:00
351026ca53 Fix threadpool memory leak and connect2 test 2016-03-09 10:19:09 +01:00
1a3db0e24f Fix threadpool after it was broken by MDEV-6150 2016-03-08 10:28:26 +01:00
1777fd5f55 Fix spelling: occurred, execute, which etc 2016-03-04 02:09:37 +02:00
b436db98fe Fix compilation 2016-02-10 00:20:23 +01:00
3d4a7390c1 MDEV-6150 Speed up connection speed by moving creation of THD to new thread
Creating a CONNECT object on client connect and pass this to the working thread which creates the THD.
Split LOCK_thread_count to different mutexes
Added LOCK_thread_start to syncronize threads
Moved most usage of LOCK_thread_count to dedicated functions
Use next_thread_id() instead of thread_id++

Other things:
- Thread id now starts from 1 instead of 2
- Added cast for thread_id as thread id is now of type my_thread_id
- Made THD->host const (To ensure it's not changed)
- Removed some DBUG_PRINT() about entering/exiting mutex as these was already logged by mutex code
- Fixed that aborted_connects and connection_errors_internal are counted in all cases
- Don't take locks for current_linfo when we set it (not needed as it was 0 before)
2016-02-07 10:34:03 +02:00
50160216ea MDEV-9156 : Fix tp_add_connection()'s error handling
Avoid possible my_thread_end() in the main polling thread.
2015-12-04 18:16:04 +01:00
40e94a3734 merge with 5.5 2012-11-03 12:28:51 +01:00
4ffc9c3b01 MDEV-531 : Warning: Forcing close of thread ... in rpl_binlog_index
Use post_kill_notification in for one_thread_per_connection scheduler, 
the same as already used in threadpool, to reliably wake a thread  stuck in 
read() or in different poll() variations.
2012-11-02 10:43:52 +01:00
ae325ec6ce Compile 10.0 on Windows 2012-08-30 11:36:24 +02:00
550d6871a5 MDEV-246 - Aborted_clients incremented during ordinary connection close
The problem was increment of aborted_threads variable due to thd->killed which was set when threadpool connection was terminated .  The fix is not to set thd->killed anymore, there is no real reason for doing it..

Added a test that checks that status variable aborted_clients does not grow for ordinary disconnects, and that successful KILL increments this variable.
2012-05-03 02:47:06 +02:00
b43494620f mdev-208 thread pool breaks the server on XP 2012-04-05 15:57:27 +02:00
ec032ae54b Windows threadpool - always disassociate current thread from callback when destroying connection
prior to closing callbacks and calling DestroyThreadpoolEnvironment,  to make sure callbacks 
do not wait for themselves to finish.
2012-03-28 01:11:05 +02:00
b932e57b27 Store callback instance in the connection structure, to call CallbackMayRunLong on long
waits (currently binlog only)

Also add copyright notice.
2012-02-17 23:23:54 +01:00
804f3bfeaf Threadpool : Rest of monty's review 2012-01-27 19:52:53 +01:00
8b945a1419 close callbacks prior to closing connection to avoid potential race when e.g timer callback and connection_destroy run in parallel 2012-01-27 00:39:23 +01:00
57b6cb39aa Further review points and simplify Windows implementation 2012-01-26 04:35:54 +01:00
d50649ecf7 small cleanups 2012-01-24 03:23:14 +01:00
d212991e89 Get rid of idle thread counter atomic variable.
Instead, use function that loops over groups and 
calculates  idle threads for  "show status".
2012-01-15 15:41:25 +01:00
a5a22e9f64 Small adjustements to threadpool 2011-12-18 20:40:38 +01:00
e91bbca5fb Initial threadpool implementation for MariaDB 5.5 2011-12-08 19:17:49 +01:00