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

58 Commits

Author SHA1 Message Date
facd9d524d Merge branch '10.5' into 10.6 2021-10-29 13:01:02 +02:00
1c1396f09c Merge branch '10.4' into 10.5 2021-10-29 10:21:52 +02:00
89f69c62cf Merge branch '10.3' into 10.4 2021-10-28 13:57:15 +02:00
2ddea602ce Merge branch '10.2' into 10.3 2021-10-28 12:41:27 +02:00
ff3274dd7c Fix message severity for "thread pool blocked" messages.
Those messages don't indicate errors, they should be normal warnings.
2021-10-28 09:59:24 +02:00
49f95c4065 Merge 10.5 into 10.6 2021-08-23 11:21:33 +03:00
4009e9b253 MDEV-19313 post-fix
If --thread-pool-dedicated-listener is set, worker should not pick up
events. Dedicated listener constantly drains all events, thus polling
also from another thread makes no sense.
2021-08-19 17:49:39 +02:00
eb9a28478f Merge 10.5 into 10.6 2021-07-20 10:54:17 +03:00
ddad20c63b MDEV-26043: Fix performance_schema instrument "threadpool/group_mutex"
The performance_schema data related to instrument "wait/synch/mutex/threadpool/group_mutex" was incorrect. The root cause is the group_mutex was initialized in thread_group_init before registerd in PSI_register(mutex).
The fix is to put PSI_register before thread_group_init, which ensures the right order.
2021-07-19 12:32:31 +02:00
860e754349 Merge 10.5 into 10.6 2021-05-26 11:22:40 +03:00
nia
6d549aecf5 threadpool_generic: support future NetBSD kqueue versions
In NetBSD 9.x and prior, udata is an intptr_t, but in 10.x (current
development branch) it was changed to be a void * for compatibility
with other BSDs a year or so ago.

Unfortunately, this does not simplify the code, as NetBSD 8.x and 9.x
are still supported and will be for a few more years.

Signed-off-by: Nia Alarie <nia@NetBSD.org>
2021-05-26 11:15:33 +10:00
4df0249b9a MDEV-24341 Innodb - do not block in foreground thread in log_write_up_to( 2021-02-14 18:30:39 +01:00
5edf3e0388 Merge branch '10.5' into 10.6 2020-09-02 14:36:14 +02:00
cf87f3e08c Merge 10.4 into 10.5 2020-08-14 11:33:35 +03:00
2f7b37b021 Merge 10.3 into 10.4, except MDEV-22543
Also, fix GCC -Og -Wmaybe-uninitialized in run_backup_stage()
2020-08-13 18:48:41 +03:00
4bd56a697f Merge 10.2 into 10.3 2020-08-13 18:18:25 +03:00
78ea8ad425 MDEV-23378 - fix an alleged memory "leak" in threadpool.
Implement a workaround to shut the "memory not freed" message.
2020-08-10 18:03:05 +00:00
9a7948e3f6 Merge 10.5 into 10.6 2020-08-04 07:55:16 +03:00
50a11f396a Merge 10.4 into 10.5 2020-08-01 14:42:51 +03:00
9216114ce7 Merge 10.3 into 10.4 2020-07-31 18:09:08 +03:00
71015d844e MDEV-21101 unexpected wait_timeout with pool-of-threads
Due to restricted size of the threadpool, execution of client queries can
be delayed (queued) for a while. This delay was interpreted as client
inactivity, and connection is closed, if client idle time + queue time
exceeds wait_timeout.

But users did not expect queue time to be included into wait_timeout.

This patch changes the behavior. We don't close connection anymore,
if there is some unread data present on connection,
even if wait_timeout is exceeded. Unread data means that client
was not idle, it sent a query, which we did not have time to process yet.
2020-07-30 10:17:45 +02:00
272828a171 Merge branch '10.5' into 10.6 2020-07-04 11:53:26 +02:00
d15c839c0d MDEV-22990 Threadpool : Optimize network/named pipe IO for Windows
This patch reduces the overhead of system calls prior to a query, for
threadpool.  Previously, 3 system calls were done

1. WSARecv() to get notification of input data from client, asynchronous
equivalent of select() in one-thread-per-connection

2. recv(4 bytes) - reading packet header length
3. recv(packet payload)

Now there will be usually, just WSARecv(), which pre-reads user data into
a buffer, so we spared 2 syscalls

Profiler shows the most expensive call WSARecv(16%CPU) becomes 4% CPU,
after the patch, benchmark results (network heavy ones like point-select)
improve by ~20%

The buffer management was rather carefully done to keep
buffers together, as Windows would keeps the pages pinned
in memory for the duration of async calls.
At most 1MB memory is used for the buffers, and overhead per-connection is
only 256 bytes, which should cover most of the uses.

SSL does not yet use the optmization, so far it does not properly use
VIO for reads and writes. Neither one-thread-per-connection would get any
benefit, but that should be fine, it is not even default on Windows.
2020-06-26 14:44:36 +02:00
213265130e Remove some trailing whitespaces. 2020-05-29 13:05:35 +02:00
e6f0371556 MDEV-22696 TP_pool_generic::set_pool_size logic so that it marks each connection to change group before the next socket read. 2020-05-25 14:54:11 +02:00
17437eb259 Threadpool - support changing group on Windows with generic thread pool 2020-05-25 14:54:00 +02:00
37c14690fc Merge 10.4 into 10.5 2020-03-30 19:07:25 +03:00
e129555462 MDEV-20372 thread_pool_info fails randomly in 10.5
Rework stats a bit, so we're not missing any queue_get() now.

Don't do stats_reset_table(), if generic threadpool is off.
2020-03-28 01:46:53 +01:00
9eae063e79 num_worker_threads my_atomic to Atomic_counter 2020-03-27 11:41:46 +04:00
e91a3ea732 shutdown_group_count my_atomic to Atomic_counter 2020-03-27 02:17:40 +04:00
ed8bf7c98f next_timeout_check my_atomic to std::atomic 2020-03-27 02:08:53 +04:00
7c58e97bf6 perfschema memory related instrumentation changes 2020-03-10 19:24:22 +01:00
8cc15c036d Merge 10.4 into 10.5 2019-12-27 21:17:16 +02:00
4c25e75ce7 Merge 10.3 into 10.4 2019-12-27 18:20:28 +02:00
5ab70e7f68 Merge 10.2 into 10.3 2019-12-27 15:14:48 +02:00
189fa30085 MDEV-21343 Threadpool/Unix- wait_begin() function does not wake/create threads, when it should
Fixed the condition for waking up/creating another thread.

If there is some work to do (if the request queue is not empty),
a thread should be woken or created.

The condition was incorrect since 18c9b345b4
2019-12-17 21:57:40 +01:00
daeaa600ef MDEV-19312 Make throttling interval depend on thread_pool_stall_limit
A thread_pool_stall_limit which is smaller than default would result
in quicker creation of threads.
2019-05-31 15:04:11 +02:00
307ca69356 Add some variables to the generic threadpool, that could help to analyze
stalls etc better.

- thread_pool_exact_stats -  uses high precision timestamp for
the time when connection was added to the queue. This timestamp helps
calculating queuing time shown in I_S.THREADPOOL_QUEUES entries.

- If thread_pool_dedicated_listener is on, then each group will have its
own dedicated listener, that does not convert to worker.
With this variable on, the queueing time in I_S.THREADPOOL_QUEUES , and
actual queue size in I_S.THREADPOOOL_GROUPS will be more exact, since
IO request are immediately dequeued from poll, without delay.


Part of MDEV-19313.
2019-05-26 19:20:35 +02:00
2fc13d04d1 MDEV-19313 Threadpool : provide information schema tables for internals of generic threadpool
Added thread_pool_groups, thread_pool_queues, thread_pool_waits and
thread_pool_stats tables to information_schema.
2019-05-26 19:20:35 +02: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
3503fbbebf Move THD list handling to THD_list
Implemented and integrated THD_list as a replacement for the global
thread list. It uses own mutex instead of LOCK_thread_count for THD
list protection.

Removed unused first_global_thread() and next_global_thread().

delayed_insert_threads is now protected by LOCK_delayed_insert. Although
this patch doesn't fix very wrong synchronization of this variable.

After this patch there are only 2 legitimate uses of LOCK_thread_count
left, both in mysqld.cc: thread_count and ready_to_exit.

Aim is to reduce usage of LOCK_thread_count and COND_thread_count.
Part of MDEV-15135.
2019-01-28 17:39:07 +04:00
c0c62196ca Removed \n from sql_print_error() 2019-01-26 19:18:22 +02: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
b006d2ead4 Merge bb-10.2-ext into 10.3 2018-02-15 10:22:03 +02:00
e2387835ef Cleanup - removed warning suppression - no longer needed. 2018-02-07 20:23:10 +00:00
b56f9fbe2f threadpool: release mutex on io_poll_create failure
Also use the group pointer previously allocated.
2018-01-31 11:43:36 +01:00