summaryrefslogtreecommitdiff
path: root/storage/innobase/include/trx0purge.h
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-10-29 22:37:12 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2019-11-15 18:09:30 +0100
commit5e62b6a5e06eb02cbde1e34e95e26f42d87fce02 (patch)
treee20f8c1d9cd084ae1b8a4d2bd33eec4027d9fa90 /storage/innobase/include/trx0purge.h
parent00ee8d85c925846acc76df2a6fc7c67a062c2ea6 (diff)
downloadmariadb-git-5e62b6a5e06eb02cbde1e34e95e26f42d87fce02.tar.gz
MDEV-16264 Use threadpool for Innodb background work.
Almost all threads have gone - the "ticking" threads, that sleep a while then do some work) (srv_monitor_thread, srv_error_monitor_thread, srv_master_thread) were replaced with timers. Some timers are periodic, e.g the "master" timer. - The btr_defragment_thread is also replaced by a timer , which reschedules it self when current defragment "item" needs throttling - the buf_resize_thread and buf_dump_threads are substitutes with tasks Ditto with page cleaner workers. - purge workers threads are not tasks as well, and purge cleaner coordinator is a combination of a task and timer. - All AIO is outsourced to tpool, Innodb just calls thread_pool::submit_io() and provides the callback. - The srv_slot_t was removed, and innodb_debug_sync used in purge is currently not working, and needs reimplementation.
Diffstat (limited to 'storage/innobase/include/trx0purge.h')
-rw-r--r--storage/innobase/include/trx0purge.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/storage/innobase/include/trx0purge.h b/storage/innobase/include/trx0purge.h
index 7c3343ce7d2..9f3438b7f7d 100644
--- a/storage/innobase/include/trx0purge.h
+++ b/storage/innobase/include/trx0purge.h
@@ -62,10 +62,6 @@ trx_purge(
ulint n_purge_threads, /*!< in: number of purge tasks to
submit to task queue. */
bool truncate /*!< in: truncate history if true */
-#ifdef UNIV_DEBUG
- , srv_slot_t *slot /*!< in/out: purge coordinator
- thread slot */
-#endif
);
/** Rollback segements from a given transaction with trx-no
@@ -144,14 +140,11 @@ private:
class purge_sys_t
{
public:
- /** signal state changes; os_event_reset() and os_event_set()
- are protected by rw_lock_x_lock(latch) */
- MY_ALIGNED(CACHE_LINE_SIZE)
- os_event_t event;
/** latch protecting view, m_enabled */
MY_ALIGNED(CACHE_LINE_SIZE)
rw_lock_t latch;
private:
+ bool m_initialized;
/** whether purge is enabled; protected by latch and std::atomic */
std::atomic<bool> m_enabled;
/** number of pending stop() calls without resume() */
@@ -162,9 +155,6 @@ public:
MY_ALIGNED(CACHE_LINE_SIZE)
ReadView view; /*!< The purge will not remove undo logs
which are >= this view (purge view) */
- /** Number of not completed tasks. Accessed by srv_purge_coordinator
- and srv_worker_thread by std::atomic. */
- std::atomic<ulint> n_tasks;
/** Iterator to the undo log records of committed transactions */
struct iterator
@@ -234,7 +224,7 @@ public:
uninitialised. Real initialisation happens in create().
*/
- purge_sys_t() : event(NULL), m_enabled(false), n_tasks(0) {}
+ purge_sys_t():m_initialized(false),m_enabled(false) {}
/** Create the instance */