Commit graph

20 commits

Author SHA1 Message Date
Jan Lindström
e53dfb24be MDEV-11707: Fix incorrect memset() for structures containing
dynamic class GenericPolicy<TTASEventMutex<GenericPolicy> >'; vtable

Instead using mem_heap_alloc and memset, use mem_heap_zalloc
directly.
2017-02-06 15:40:17 +02:00
Jan Lindström
fe0112e252 MDEV-7424: InnoDB: Assertion failure in thread 139901753345792
in file buf0mtflu.cc line 439

  Analysis: At shutdown multi-threaded flush sends a exit work
  items to all mtflush threads. We wait until the work queue is
  empty. However, as we did not hold the mutex, some other thread
  could also put work-items to work queue.

  Fix: Take mutex before adding exit work items to work queue and
  wait until all work-items are really processed. Release
  mutex after we have marked that multi-threaded flush is not
  anymore active.

  Fix test failure on innodb_bug12902967 caused by unnecessary
  info output on xtradb/buf/buf0mtflush.cc.

   Do not try to enable atomic writes if the file type
   is not OS_DATA_FILE. Atomic writes are unnecessary
   for log files. If we try to enable atomic writes
   to log writes that are stored to media supporting
   atomic writes we will end up problems later.
2015-01-14 19:24:37 +02:00
Jan Lindström
a03dd94be8 MDEV-6936: Buffer pool list scan optimization
Merged Facebook commit 617aef9f911d825e9053f3d611d0389e02031225
authored by Inaam Rana to InnoDB storage engine (not XtraDB)
from https://github.com/facebook/mysql-5.6

WL#7047 - Optimize buffer pool list scans and related batch processing

Reduce excessive scanning of pages when doing flush list batches. The
fix is to introduce the concept of "Hazard Pointer", this reduces the
time complexity of the scan from O(n*n) to O.

The concept of hazard pointer is reversed in this work. Academically
hazard pointer is a pointer that the thread working on it will declar
such and as long as that thread is not done no other thread is allowe
do anything with it.

In this WL we declare the pointer as a hazard pointer and then if any
thread attempts to work on it, it is allowed to do so but it has to a
the hazard pointer to the next valid value. We use hazard pointer sol
reverse traversal of lists within a buffer pool instance.

Add an event to control the background flush thread. The background f
thread wait has been converted to an os event timed wait so that it c
signalled by threads that want to kick start a background flush when
buffer pool is running low on free/dirty pages.
2014-11-06 13:17:11 +02:00
Jan Lindström
b35c5912b6 MDEV-6376: InnoDB: Assertion failure in thread 139995225970432
in file buf0mtflu.cc line 570.

Analysis: Real timing bug, we should take the mutex before we
try to send those shutdown messages, that would make sure
that threads doing a unfinished flush (they have acquired
this mutex) have time to do their work before we add shutdown
messages to work queue. Currently, we just add those shutdown
messages to work queue and code assumes that at flush, there
is constant number of items to be processed and thus
leading to assertion.
2014-06-28 13:53:18 +03:00
Jan Lindström
972a14b59a Code cleanup after review. 2014-05-16 15:30:13 +03:00
Jan Lindström
6a756b3a44 Code cleanup: Removed some unnecessary outputs from standard builds (available on
special builds UNIV_PAGECOMPRESS_DEBUG and UNIV_MTFLUSH_DEBUG).

Added a new status variable compress_pages_page_compression_error to count possible
compression errors.
2014-03-21 15:46:36 +02:00
Jan Lindström
fd38dca5d5 Fixed a hang. The core issues is with the heap-thrashing by the
individual queue's. Tried to minimize memory allocation from heap
whenever it is unnecessary.
2014-03-03 18:14:29 +02:00
Jan Lindström
96100d6652 Merge: lp:maria/10.0 latest. 2014-03-03 14:27:56 +02:00
Jan Lindström
c88a0d48c6 Temporal fix for flush thread hang.
Added option to disable multi-threaded flush with innodb_use_mtflush = 0
option, by default multi-threaded flush is used.

Updated innochecksum tool, still it does not support new checksums.
2014-02-28 08:53:09 +02:00
Jan Lindström
b620e7368f Small fixes to work_item handling. 2014-02-26 19:00:24 +02:00
Jan Lindström
24235e99d8 Fixed memory leak on queue nodes by using local memory heap on normal
execution and global memory heap on shutdown.

Added a funcition to get work items from queue without waiting and
additional info when there is no work to do for a extended periods.
2014-02-25 13:15:55 +02:00
Jan Lindström
25318038a9 Fixed hang seen on TPC-C measure phase. We should not use timedwait on threads
waiting for a job. They should sleep and let other threads to their work. At
shutdown, we know that we put "work" and that is handled as soon as possible.
2014-02-15 09:51:06 +02:00
Jan Lindström
cae21c52f6 Fix timing on queues, this could clearly lead to starvation. 2014-02-14 15:02:26 +02:00
Jan Lindström
d17ecff410 Fixed issue on data dictionary corruption.
Fixed issue on multi-threaded flush at shutdown.
Removed unnecessary startup option innodb_compress_pages.
Added a new startup option innodb_mtflush_threads, default 8.
2014-02-13 09:13:56 +02:00
Jan Lindström
da927da04d Fixed issue on atomic writes and system tables. Atomic writes can be used
also on system tables but not per table.
2014-02-12 18:00:03 +02:00
Jan Lindström
f6ad325883 Code cleanup. Removed those questions that are now addressed. 2014-02-12 10:55:45 +02:00
Jan Lindström
fa9f5f63e9 Removed unnecessary files and set lz4 under HAVE_LZ4 compiler
option using cmake find_library. Fixed bunch of compiler
warnings.
2014-02-11 20:05:09 +02:00
Jan Lindström
a5cf3a800e Merged latest mt-flush code to xtradb. Cleaned up thread statistic output
code.
2014-02-07 15:31:31 +02:00
Jan Lindström
7f3950a2ae Moved mt-flush code to buf0mtflu.[cc|h] and cleaned it up. This is for
InnoDB.
2014-02-06 17:25:26 +02:00
Jan Lindström
5e55d1ced5 Changes for Fusion-io multi-threaded flush, page compressed tables and
tables using atomic write/table.

This is work in progress and some parts are at most POC quality.
2013-12-19 14:36:38 +02:00