Commit graph

18315 commits

Author SHA1 Message Date
Monty
2f2e7f8c9d Fixed compiler warnings in sphinx 2018-03-26 17:56:09 +03:00
Monty
ca0c96fc89 Adjust table_open_cache to avoid getting error 24 (too many open files)
MDEV--15609 engines/funcs.crash_manytables_number crashes with error 24
           (too many open files)
MDEV-10286  Adjustment of table_open_cache according to system limits
            does not work when open-files-limit option is provided

Fixed by adjusting tc_size downwards if there is not enough file
descriptors to use.

Other changes:
- Ensure that there is 30 (was 10) extra file descriptors for other usage
- Decrease TABLE_OPEN_CACHE_MIN to 200 as it's better to have a smaller
  table cache than getting error 24
- Increase minimum of max_connections and table_open_cache from 1 to 10
  as 1 is not usable for any real application, only for testing.
2018-03-26 17:53:17 +03:00
Thirunarayanan Balathandayuthapani
b6d68c6aa3 MDEV-13561 Mariabackup is incompatible with retroactively created innodb_undo_tablespaces
- Mariabackup supports starting undo tablespace id which is greater
than 1.
2018-03-22 14:19:16 +05:30
Marko Mäkelä
613be24b7a Merge 10.0 into 10.1 2018-03-20 19:25:08 +02:00
Marko Mäkelä
0492100059 Merge 5.5 into 10.0 2018-03-20 18:36:03 +02:00
Marko Mäkelä
e0a0fe7d81 MDEV-12396 IMPORT TABLESPACE: Do not retry partial reads
fil_iterate(), fil_tablespace_iterate(): Replace os_file_read()
with os_file_read_no_error_handling().

os_file_read_func(), os_file_read_no_error_handling_func():
Do not retry partial reads. There used to be an infinite amount
of retries. Because InnoDB extends both data and log files upfront,
partial reads should be impossible during normal operation.
2018-03-20 15:31:39 +02:00
Marko Mäkelä
a80af35a85 MDEV-12396 IMPORT cleanup: ROW_FORMAT=COMPRESSED
Initialize block.page.zip only once.

PageConverter::update(): Initialize m_page_zip_ptr
as late as possible.
(We should really remove it at some point.)

PageConverter::operator(): Refer to block->page.zip instead of
m_page_zip_ptr.

AbstractCallback::get_frame(): Define static. Refer
to block->page.zip.data directly.

fil_iterate(): Refer to block->page.zip.data directly.

fil_tablespace_iterate(): Initialize block.page.zip.data as soon
as possible.
2018-03-20 15:31:39 +02:00
Marko Mäkelä
eaa7bfb59f MDEV-12396 IMPORT TABLESPACE: Simplify validation
fil_iterate(): Validate the pages directly.

import_page_status_t, PageConverter::validate(): Remove.

AbstractCallback::filename(): New accessor.

AbstractCallback::is_interrupted(): Replaces periodic_check().

PageConverter::trigger_corruption(): Remove.
2018-03-20 15:31:39 +02:00
Marko Mäkelä
6247c64c2a MDEV-12396 IMPORT TABLESPACE cleanup
Reduce unnecessary inter-module calls for IMPORT TABLESPACE.
Move some IMPORT-related code from fil0fil.cc to row0import.cc.

PageCallback: Remove. Make AbstractCallback the base class.

PageConverter: Define some member functions inline.
2018-03-20 15:31:39 +02:00
Thirunarayanan Balathandayuthapani
eee73ddfbb MDEV-12255 innodb_prefix_index_cluster_optimization hits debug build
assert on UTF-8 columns

Problem:
=======
(1) Multi-byte character cases are not considered during prefix index
cluster optimization check. It leads to fetch of improper results during
read operation.
(2) Strict assert in row_sel_field_store_in_mysql_format_func and it asserts
for prefix index record to mysql conversion.

Solution:
========
(1) Consider the case of multi-byte character during prefix index
cluster optimization check.
(2) Relax the assert in row_sel_field_store_in_mysql_format_func to allow
prefix index record to mysql format conversion.

The patch is taken from
1eee538087
2018-03-20 17:53:33 +05:30
Eugene Kosov
5a8f8f89d6 honor alignment rules and xtradb too 2018-03-20 10:46:57 +03:00
Varun Gupta
e390f7b675 MDEV-12737: tokudb_mariadb.mdev6657 fails in buildbot with different plan, and outside with valgrind warnings
Fixing the test by adding replace column for the rows column in the explain.
2018-03-20 11:05:28 +05:30
Jacob Mathew
7cf2428db3 MDEV-10991: Server crashes in spider_udf_direct_sql_create_conn - tests in spider/oracle* suites crash the server
The crash occurs due to code that is #ifdef'd out with HAVE_ORACLE_OCI that
pertains to the use of Spider with an Oracle data tier. Enabling this code
eliminates the crash.

The reason that MariaDB needs to support Oracle storage at the data tier is
to help customers migrate from Oracle. It is necessary to build Spider with
the additional build flag -DHAVE_ORACLE_OCI, and install and start Oracle
before running the Oracle test suite or any tests within it. Nevertheless,
if Spider is built normally and Oracle has not been started, these tests
should not cause the MariaDB server to crash. The bug fix replaces the
crash with the following error:
  ERROR 12501 (HY000) at line 4: The connect info 'ORACLE' is invalid

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.
2018-03-19 12:49:22 -07:00
Vicențiu Ciorbaru
24b353162f Merge branch '10.0-galera' into 10.1 2018-03-19 15:21:01 +02:00
Eugene Kosov
75c76dbb06 MDEV-15030 Add ASAN instrumentation
Learn both valgrind and asan to catch this bug:

  mem_heap_t* heap = mem_heap_create(1024);
  byte* p = reinterpret_cast<byte*>(heap) + sizeof(mem_heap_t);
  *p = 123;

Overflows of the last allocation in a block will be catched too.

mem_heap_create_block(): poison newly allocated memory
2018-03-19 16:18:53 +03:00
Sergey Vojtovich
0a534348c7 MDEV-14265 - RPMLint warning: shared-lib-calls-exit
Eliminated last exit() call from libmysqld.
2018-03-16 13:26:52 +04:00
Marko Mäkelä
7033af9e81 Conditionally define TRX_WSREP_ABORT 2018-03-16 08:38:48 +02:00
Marko Mäkelä
ca40330d1d Fix a deadlock in thd_report_wait_for()
Unlike commit a54abf0175 claimed,
the caller of THD::awake() may actually hold the InnoDB lock_sys->mutex.
That commit introduced a deadlock of threads in the replication slave
when running the test rpl.rpl_parallel_optimistic_nobinlog.

lock_trx_handle_wait(): Expect the callers to acquire and release
lock_sys->mutex and trx->mutex.

innobase_kill_query(): Restore the logic for conditionally acquiring
and releasing the mutexes. THD::awake() can be called from inside
InnoDB while holding one or both mutexes, via thd_report_wait_for() and
via wsrep_innobase_kill_one_trx().
2018-03-16 08:23:56 +02:00
Marko Mäkelä
dbb3960ad8 Follow-up to MDEV-11236/MDEV-14846 debug assertion
ha_innobase::unlock_row(): Use a relaxed version of the
trx_state_eq() debug assertion, because rr_unlock_row()
may be invoked after an error has been already reported
and the transaction has been rolled back.
2018-03-15 19:48:29 +02:00
Marko Mäkelä
723f87e9d3 lock_table_create(), lock_rec_create(): Clean up the WSREP code
By definition, c_lock->trx->lock.wait_lock==c_lock cannot hold.
That is, the owner transaction of a lock cannot be waiting for that
particular lock. It must have been waiting for some other lock.
Remove the dead code related to that. Also, test c_lock for NULLness
only once.
2018-03-15 19:44:24 +02:00
Marko Mäkelä
a54abf0175 innobase_kill_query(): Use lock_trx_handle_wait()
The caller of THD::awake() should never hold any InnoDB mutexes,
so we can always acquire lock_sys->mutex and trx->mutex.
2018-03-15 19:44:24 +02:00
Daniel Black
8b54c31486 MDEV-8743: where O_CLOEXEC is available, use for innodb buf_dump
As this is the only moderately critical fopened for writing file,
create an alternate path to use open and fdopen for non-glibc platforms
that support O_CLOEXEC (BSDs).

Tested on Linux (by modifing the GLIBC defination) to take this
alternate path:

$ cd /proc/23874
$ more fdinfo/71
pos:    0
flags:  02100001
mnt_id: 24
$ ls -la fd/71
l-wx------. 1 dan dan 64 Mar 14 13:30 fd/71 -> /dev/shm/var_auto_i7rl/mysqld.1/data/ib_buffer_pool.incomplete
2018-03-15 12:07:43 +02:00
Sergey Vojtovich
12f9cf075f Removed unused variables.
Based on contribution by Daniel Black.
2018-03-12 16:49:50 +04:00
Marko Mäkelä
0be18c4038 Merge 10.0 into 10.1 2018-03-12 13:22:13 +02:00
Marko Mäkelä
4a35e76f64 MDEV-14773 DROP TABLE hangs for InnoDB table with FULLTEXT index
fts_sync(): If the dict_table_t::to_be_dropped flag is set,
do not "goto begin_sync".

Also, clean up the way how dict_index_t::index_fts_syncing
is cleared.

It looks like this regression was introduced by merging
Oracle Bug #24938374 MYSQL CRASHED AFTER LONG WAIT ON DICT OPERATION LOCK
WHILE SYNCING FTS INDEX
068f8261d4
from MySQL 5.6.38 into MariaDB 10.0.33, 10.1.29, 10.2.10.
The same hang is present in MySQL 5.7.20.
2018-03-12 13:06:21 +02:00
Marko Mäkelä
8ef727b3d0 MDEV-14904 Backport innodb_default_row_format
InnoDB in Debian uses utf8mb4 as default character set since
version 10.0.20-2. This leads to major pain due to keys longer
than 767 bytes.

MariaDB 10.2 (and MySQL 5.7) introduced the setting
innodb_default_row_format that is DYNAMIC by default. These
versions also changed the default values of the parameters
innodb_large_prefix=ON and innodb_file_format=Barracuda.
This would allow longer column index prefixes to be created.
The original purpose of these parameters was to allow InnoDB
to be downgraded to MySQL 5.1, which is long out of support.

Every InnoDB version since MySQL 5.5 does support operation
with the relaxed limits.

We backport the parameter innodb_default_row_format to
MariaDB 10.1, but we will keep its default value at COMPACT.
This allows MariaDB 10.1 to be configured so that CREATE TABLE
is less likely to encounter a problem with the limitation:

	loose_innodb_large_prefix=ON
	loose_innodb_default_row_format=DYNAMIC

(Note that the setting innodb_large_prefix was deprecated in
MariaDB 10.2 and removed in MariaDB 10.3.)

The only observable difference in the behaviour with the default
settings should be that ROW_FORMAT=DYNAMIC tables can be created
both in the system tablespace and in .ibd files, no matter what
innodb_file_format has been assigned to. Unlike MariaDB 10.2,
we are not changing the default value of innodb_file_format,
so ROW_FORMAT=COMPRESSED tables cannot be created without
changing the parameter.
2018-03-07 17:49:42 +02:00
Sergei Golubchik
176d603cc7 MDEV-15462 TokuDB does not build on openSUSE
fix 50359719f0
don't rely on any specific engine checking order
2018-03-04 18:59:29 +01:00
Daniel Black
26e4a48bda MDEV-8743: ib_logfile0 Use O_CLOEXEC so galera SST scripts don't get fd 2018-03-02 11:09:51 +11:00
Sergei Golubchik
a04e4f531a Merge branch '10.0' into 10.1 2018-02-22 14:12:02 +01:00
Sergei Golubchik
b728641e86 Merge branch '5.5' into 10.0 2018-02-22 09:22:03 +01:00
Sergei Golubchik
50359719f0 fix compilation -DWITH_PERFSCHEMA=NO
tokudb apparently requires perfschema now
2018-02-21 17:48:25 +01:00
Sergei Golubchik
18455ec3f1 fix compilation wih -DPLUGIN_PARTITION=NO 2018-02-21 17:48:25 +01:00
Sergei Golubchik
88d1c1c551 MDEV-15288 Configure errors when building without INNOBASE 2018-02-21 14:42:56 +01:00
Monty
55bc3f1dd9 Fixed performance problem with Aria in find_head()
For some simple benchmarks, a majority of time was
spend in find_head() which tries to find the best
place to put the record.

The result of this patch is a 2x or more speedup for
inserts without keys for format PAGE. All changes
are only related to how rows are stored

Should fix some of the problems mentioned in:
MDEV-8132 Temporary tables using Aria with very poor performance
MDEV-9079 Aria very slow for internal temporary tables
MDEV-5841 Mariadb very poor temporary performance

The following changes where done:
- For rows with a small row length that fits into
  a page (818 bytes with 8192 pages), stop as soon as we
  hit a match.
- Added markers full_head_size and full_tail_size that tells
  us where to start searching on the bitmap page
- Ensure that page->used_size is correctly updated when
  bitmap grows. This allows us to stop searching at used_size
- Added code to check that the bitmap variables are correct.
- Fixed a wrong test where we set "first_bitmap_with_space".
  This shouldn't have caused any notable problems.
2018-02-17 18:04:59 +02:00
Monty
965e16376c TokuDB didn't compile with valgrind
TokuDB uses USE_VALGRIND while MariaDB uses HAVE_valgrind

Fixed by defining USE_VALGRIND in TokuDB if HAVE_valgrind is used
2018-02-17 18:04:59 +02:00
Marko Mäkelä
9a46d97149 MDEV-15333 MariaDB (still) slow start
This performance regression was introduced in the MariaDB 10.1
file format incompatibility bug fix MDEV-11623 (MariaDB 10.1.21
and MariaDB 10.2.4) and partially fixed in MariaDB 10.1.25 in
MDEV-12610 without adding a regression test case.

On a normal startup (without crash recovery), InnoDB should not read
every .ibd data file, because this is slow. Like in MySQL, for now,
InnoDB will still open every data file (without reading), and it
will read every .ibd file for which an .isl file exists, or the
DATA DIRECTORY attribute has been specified for the table.

The test case shuts down InnoDB, moves data files, replaces them
with garbage, and then restarts InnoDB, expecting no messages to
be issued for the garbage files. (Some messages will for now be
issued for the table that uses the DATA DIRECTORY attribute.)
Finally, the test shuts down the server, restores the old data files,
and restarts again to drop the tables.

fil_open_single_table_tablespace(): Remove the condition on flags,
and only call fsp_flags_try_adjust() if validate==true
(reading the first page has been requested). The only caller with
validate==false is at server startup when we are processing all
records from SYS_TABLES. The flags passed to this function are
actually derived from SYS_TABLES.TYPE and SYS_TABLES.N_COLS,
and there never was any problem with SYS_TABLES in MariaDB 10.1.
The problem that MDEV-11623 was that incorrect tablespace flags
were computed and written to FSP_SPACE_FLAGS.
2018-02-17 14:20:33 +02:00
Sergey Vojtovich
a351f40cba MDEV-14541 - Workaround GCC ICE on ARM64 2018-02-16 14:14:43 +04:00
Sergei Golubchik
2709380587 MDEV-13748 Assertion `status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory' failed in virtual THD::~THD after query with INTERSECT
my_safe_alloca()/my_safe_afree() work as alloca() or malloc()/free()
depending on the memory size to allocate, that is, depending on
reclength here. They only work correctly if reclength doesn't
change in the middle.
2018-02-14 18:41:37 +01:00
Marko Mäkelä
2202afd541 Merge 10.0 into 10.1 2018-02-13 14:32:17 +02:00
Marko Mäkelä
c051eaba46 MDEV-14988 innodb_read_only tries to modify files if transactions were recovered in COMMITTED state
lock_trx_release_locks(): Relax a debug assertion to allow
recovered TRX_STATE_COMMITTED_IN_MEMORY transactions.

trx_commit_in_memory(): Add DEBUG_SYNC instrumentation.

trx_undo_insert_cleanup(): Skip persistent changes if innodb_read_only
is set. This should only happen when a recovered committed transaction
would be cleaned up at shutdown.
2018-02-13 14:29:32 +02:00
Sergei Golubchik
7c6cf7fefe bug: ha_heap was unilaterally increasing reclength
proper fix replacing the hack from b80fa4000d

don't confuse length of the data area (reclength) with the
offset to the "deleted" mark.
2018-02-11 18:36:54 +01:00
Alexey Botchkov
b88542681b MDEV-14611 ALTER TABLE EXCHANGE PARTITION does not work properly when used with DATA DIRECTORY.
When table is renamed, the InnoDB's dictionary cache didn't
        change the ib_table->data_dir_path accordingly.
        Now it's set to NULL.
2018-02-10 22:17:49 +04:00
Alexander Barkov
e07451f71f Merge remote-tracking branch 'origin/10.0' into 10.1 2018-02-10 00:06:10 +04:00
Jan Lindström
564891c532 MDEV-14508: encryption.innodb-compressed-blob failed in buildbot, assertion in btr0cur.cc line 1398
Before that line there is call to buf_page_get_gen that could
return block = NULL when decrypting a page fails. However,
we should set error to be != DB_SUCCESS also. In error log
there was error about decompression but in that code there
is one case where error is not set correctly.
2018-02-09 17:17:32 +02:00
Vicențiu Ciorbaru
6f0b316fbe Update wrong xtradb version
The update was lost during merge.
2018-02-08 21:12:11 +02:00
Marko Mäkelä
871f2a6ee2 Merge 10.0 into 10.1 2018-02-08 13:29:08 +02:00
Marko Mäkelä
5421e3aee7 MDEV-15249 Crash in MVCC read after IMPORT TABLESPACE
PageConverter::adjust_cluster_record(): Instead of writing
the invalid value DB_ROLL_PTR=0, write a value that indicates
a fresh insert, that is, prevents the DB_ROLL_PTR from being
dereferenced in any circumstances.

It can be argued that IMPORT TABLESPACE should actually
update the dict_index_t::trx_id to prevent older transactions
from accessing the table, similar to what I did on table
rebuild in MySQL 5.6.6 in
03f81a55f2
2018-02-08 12:59:32 +02:00
Marko Mäkelä
ec03390f9b fil_write_flushed_lsn(): Ensure that the return value is initialized
Previously, the function could theoretically return an uninitialized
value if the system tablespace contained no data files. It should be
impossible for InnoDB to start up in such scenario.
2018-02-03 12:52:25 +02:00
Marko Mäkelä
f69a3b2e92 After-merge fix for commit d4df7bc9b1
The merge omitted some InnoDB and XtraDB conflict resolutions,
most notably, failing to merge the fix of MDEV-12173.

ibuf_merge_or_delete_for_page(), lock_rec_block_validate():
Invoke fil_space_acquire_silent() instead of fil_space_acquire().
This fixes MDEV-12173.

wsrep_debug, wsrep_trx_is_aborting(): Removed unused declarations.

_fil_io(): Remove. Instead, declare default parameters for the XtraDB
fil_io().

buf_read_page_low(): Declare default parameters, and clean up some
callers.

os_aio(): Correct the macro that is defined when !UNIV_PFS_IO.
2018-02-02 19:57:59 +02:00
Sergei Golubchik
d4df7bc9b1 Merge branch 'github/10.0' into 10.1 2018-02-02 10:09:44 +01:00