Commit graph

650 commits

Author SHA1 Message Date
Sergei Petrunia
06aaaef51a MDEV-16200: -DPLUGIN_ROCKSDB=YES leads to errors during build
Mark the plugin as dynamic-only.
2018-05-18 23:58:24 +03:00
Sergei Petrunia
727d0d4f9b MDEV-15304: Server crash in print_keydup_error / key_unpack or unexpected ER_DUP_KEY
Fix two issues:
1. Rdb_ddl_manager::rename() loses the value of m_hidden_pk_val. new
object used to get 0, which means "not loaded from the db yet".

2. ha_rocksdb::load_hidden_pk_value() uses current transaction (and its
snapshot) when loading hidden PK value from disk. This may cause it to
load an out-of-date value.
2018-05-18 17:41:56 +03:00
Marko Mäkelä
4c7608aeb1 Merge 10.2 into 10.3 2018-05-17 08:42:53 +03:00
Sergei Golubchik
0e296947db add missing test result
followup for 21bcfeb996
2018-05-15 15:13:33 +02:00
Sergei Petrunia
21bcfeb996 MDEV-16155: UPDATE on RocksDB table with unique constraint does not work
RocksDB now supports "iterator bounds" which are min and max keys
that an iterator is interested in.

Iterator initialization function doesn't copy the keys, though, it keeps
pointers to them.
So if the buffer space for the keys is used for another iterator (the one
for checking for UNIUQE constraint violation in ha_rocksdb::ha_update_row)
then one can get incorrect query result.

Fixed by using a separate buffer for iterator bounds in the unique constraint
violation check.
2018-05-15 12:34:10 +03:00
Sergei Petrunia
a0048378f9
Merge pull request #753 from shinnok/10.3-macfixes
MDEV-15778: 10.3 macOS build fixes
2018-05-15 12:20:16 +03:00
Sergei Petrunia
0d033b6d34 Down-scale rocksdb.bulk_load* tests by 2x. This should fix MDEV-13904 2018-05-14 23:54:43 +03:00
Sergei Petrunia
4d2a36e8bc Post-merge fix for rocksdb.add_index_inplace_sstfilewriter
MariaDB has a scaled-down version of the test so we need to set
@@rocksdb_max_row_locks lower to trigger the desired error

(didn't catch this on test BB run because this test is marked as "big")
2018-05-14 20:25:02 +03:00
Sergei Petrunia
279184a04d MDEV-14562: rocksdb.bloomfilter failed in buildbot
Bloom filter is only used when reading the data from disk. If the data
happens to be still in the memtable, bloomfilter wont be used.

Stabilize the testcase by making sure the data is on disk before we
read it.
2018-05-14 19:51:19 +03:00
Sergei Petrunia
16a8a241c2 MDEV-14375: rocksdb.bulk_load_unsorted fails
Down-scale the test by a factor of 2.
2018-05-14 17:57:33 +03:00
Sergei Petrunia
7e7592ade5 MDEV-16154: Server crashes in in myrocks::ha_rocksdb::load_auto_incr_value_from_index
Backport the fix from the upstream and add our testcase.
Backported cset:
commit 997a979bf5e2f75ab88781d9d3fd22dddc1fc21f
Author: Manuel Ung <mung@fb.com>
Date:   Thu Feb 15 08:38:12 2018 -0800

    Fix crashes in autoincrement code paths

    Summary:
    There are two issues related to autoincrement that can lead to crashes:

    1. The max value for double/float type for autoincrement was not implemented in MyRocks, and can lead to assertions. The fix is to add them in.
    2. If we try to set auto_increment via alter table on a table without an auto_increment column defined, we segfault because there is no index from which to read the last value. The fix is to perform a check to see if autoincrement exists before reading from index (similar to code ha_rocksdb::open).

    Fixes https://github.com/facebook/mysql-5.6/issues/792
    Closes https://github.com/facebook/mysql-5.6/pull/794

    Differential Revision: D6995096

    Pulled By: lth

    fbshipit-source-id: 1130ce1
2018-05-14 15:59:51 +03:00
Marko Mäkelä
15419a5583 Merge 10.2 into 10.3 2018-05-12 22:14:59 +03:00
Sergei Petrunia
c686483264 MDEV-12427: rocksdb.write_sync fails
Enable the test as the cause of the failure has been fixed
2018-05-11 13:56:42 +03:00
Sergei Petrunia
e5bd75fb4e MyRocks: disable rocksdb.check_ignore_unknown_options on Windows 2018-05-10 21:46:57 +03:00
Sergei Petrunia
ffb48234df MyRocks on windows: make bulk_load_unsorted pass.
It produced warnings due to perl code printing \r\n into the text
file which is then used by LOAD DATA INFILE.
2018-05-10 20:16:15 +03:00
Sergei Petrunia
b0269816a5 MyRocks: post-merge fixes for Windows: take into account FN_LIBCHAR2
Table name may be passed either as "./db/table" or as ".\\db\\table".
2018-05-10 19:05:13 +03:00
Teodor Mircea Ionita
70e88b5089 MDEV-15778: Rocksdb missing linkage to dbug library
Was failing with Debug build on macOS 10.13.4
2018-05-10 12:21:37 +03:00
Sergei Petrunia
4d51009a77 MyRocks: fix rocksdb.rocksdb_range test attempt 3 2018-05-08 13:00:26 +03:00
Sergei Petrunia
45ef87ee92 Post-merge fixes: fix rocksdb.rocksdb_checksums test
(see also: MDEV-15911)
2018-05-07 22:13:18 +03:00
Sergei Petrunia
dbe73588cd Merge branch 'bb-10.2-mariarocks-merge' of github.com:MariaDB/server into 10.2
Manually resolved the conflicts
2018-05-07 21:38:18 +03:00
Sergei Petrunia
e3661b9f7c Cherry-picked from MyRocks upstream: Issue #809: Wrong query result with bloom filters
In reverse-ordered column families, if one wants to start reading at the
  logical end of the index, they should Seek() to a key value that is not
  covered by the index. This may (and typically does) prevent use of a bloom
  filter.
  The calls to setup_scan_iterator() that are made for index and table scan
  didn't take this into account and passed eq_cond_len=INDEX_NUMBER_SIZE.
  Fixed them to compute and pass correct eq_cond_len.

  Also, removed an incorrect assert in ha_rocksdb::setup_iterator_bounds.
2018-05-07 20:21:35 +03:00
Thirunarayanan Balathandayuthapani
85cc6b70bd MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ALGORITHM=INSTANT
Introduced new alter algorithm type called NOCOPY & INSTANT for
inplace alter operation.

NOCOPY - Algorithm refuses any alter operation that would
rebuild the clustered index. It is a subset of INPLACE algorithm.

INSTANT - Algorithm allow any alter operation that would
modify only meta data. It is a subset of NOCOPY algorithm.

Introduce new variable called alter_algorithm. The values are
DEFAULT(0), COPY(1), INPLACE(2), NOCOPY(3), INSTANT(4)

Message to deprecate old_alter_table variable and make it alias
for alter_algorithm variable.

alter_algorithm variable for slave is always set to default.
2018-05-07 14:58:11 +05:30
Elena Stepanova
d36034b6d8 Follow up for 9a84980668 - adjustments to storage_engine tests 2018-05-03 20:54:23 +03:00
Monty
2ccd6716fc Fix a lot of compiler warnings found by -Wunused 2018-04-26 17:35:12 +03:00
Marko Mäkelä
c6ba758d1d Merge 10.2 into 10.3 2018-04-23 09:49:58 +03:00
Sergei Petrunia
39fbafbcc2 Post-merge fixes: make rocksdb.allow_to_start_after_corruption pass 2018-04-19 16:28:05 +03:00
Sergei Petrunia
955233256e MyRocks: fix rocksdb.information_schema testcase.
"The Store binlog position inside RocksDB" feature is only needed for
obtaining binlog position after having restored a MyRocks backup.

This is not yet supported in MariaDB, so properly disable it in both
places where it is done.
2018-04-19 15:41:13 +03:00
Marko Mäkelä
d71a8855ee Merge 10.2 to 10.3
Temporarily disable main.cte_recursive due to hang in
an added test related to MDEV-15575.
2018-04-19 15:23:21 +03:00
Sergei Petrunia
0c02c91bc1 MyRocks: MDEV-15911: Reduce debug logging on default levels in error log
MyRocks internally will print non-critical messages to
sql_print_verbose_info() which will do what InnoDB does in similar cases:
check if (global_system_variables.log_warnings > 2).
2018-04-19 14:13:28 +03:00
Sergei Petrunia
6bea5e9e0f MyRocks: Post-merge fixes in bulk_load_error.test 2018-04-17 15:04:15 +03:00
Sergei Petrunia
a7e5049fec MyRocks: Fix link error on Windows
rocksdb_aux_lib.lib(rdb_sst_info.obj) : error LNK2001: unresolved
external symbol PSI_server
[D:\winx64-packages\build\storage\rocksdb\rocksdb.vcxproj]

rocksdb_aux_lib is an utility library used by standalone tools. These
won't have PSI_server.

FIxed by moving rdb_sst_info.* out of the library (as they do not seem
to be used by these standalone tools)
2018-04-17 11:10:11 +03:00
Sergei Petrunia
40bed2d39e MyRocks: Add files lost during the merge
Include files that upstream has in mysql-test/include and so they were
not picked up by the merge process
2018-04-16 11:06:43 +03:00
Sergei Petrunia
ce4149fc9b Post-merge fixes: make rocksdb.use_direct_reads_writes pass 2018-04-15 21:15:21 +03:00
Sergei Petrunia
0fad97a9ec Post-merge fixes: add a suppression for rocksdb.skip_validate_tmP_table 2018-04-15 15:34:06 +03:00
Sergei Petrunia
261d4755f4 Post-merge fixes: rocksdb.check_ignore_unknown_options 2018-04-15 14:34:56 +03:00
Sergei Petrunia
8496e84f05 Trivial post-merge fixes 2018-04-15 12:52:27 +03:00
Sergei Petrunia
78e42153b5 Fix compile on windows: O_SYNC is not available, use a my_sync() call instead. 2018-04-13 20:26:40 +03:00
Sergei Petrunia
d13e3547e4 MDEV-14460: Memory leak with only SELECT statements
Cherry-pick this fix from the upstream:
commit 6ddedd8f1e0ddcbc24e8f9a005636c5463799ab7
Author: Sergei Petrunia <psergey@askmonty.org>
Date:   Tue Apr 10 11:43:01 2018 -0700

    [mysql-5.6][PR] Issue #802: MyRocks: Statement rollback doesnt work correctly for nes…

    Summary:
    …ted statements

    Variant #1: When the statement fails, we should roll back to the latest
    savepoint taken at the top level.
    Closes https://github.com/facebook/mysql-5.6/pull/804

    Differential Revision: D7509380

    Pulled By: hermanlee

    fbshipit-source-id: 9a6f414
2018-04-13 01:56:01 +03:00
Sergei Petrunia
5545753b0b Update test results
In the upstream include/search_pattern_in_file.inc prints nothing
when it has found the searched string (if it hasn't, it produces an error)

In MariaDB, it prints "FOUND n ..."
2018-04-13 00:39:51 +03:00
Sergei Petrunia
34e6b5fa6f Undo fix for MDEV-13852: RocksDB now has a proper WinWriteableFile::IsSyncThreadSafe()
Commit being reverted is:
commit 689168be12
Author: Vladislav Vaintroub <wlad@mariadb.com>
Date:   Thu Nov 16 18:57:18 2017 +0000

    MDEV-13852 - redefine WinWriteableFile such as IsSyncThreadSafe()
    is set to true, as it should.

    Copy and modify original io_win.h header file to a different location
    (as we cannot patch anything in submodule). Make sure modified header is
    used.
2018-04-12 20:28:54 +03:00
Vicențiu Ciorbaru
65eefcdc60 Merge remote-tracking branch '10.2' into 10.3 2018-04-12 12:41:19 +03:00
Sergei Petrunia
5715177a76 - Fix a merge error
- Test result updates
2018-04-11 18:39:06 +03:00
Sergei Petrunia
7e700bd2a8 Fix ha_rocksdb::calc_eq_cond_len() to handle HA_READ_PREFIX_LAST_OR_PREV correctly
This is Variant#2.
- Undo Variant#1
- Instead, swap the range bounds if we are doing a reverse-ordered scan.
2018-04-09 19:12:23 +03:00
Sergei Petrunia
8628c589f6 Fix ha_rocksdb::calc_eq_cond_len() to handle HA_READ_PREFIX_LAST_OR_PREV correctly 2018-04-09 15:27:35 +03:00
Sergei Petrunia
e7efc79350 Make rocksdb.information_schema test stable 2018-04-09 01:10:43 +03:00
Sergei Petrunia
1cb2e0333d MDEV-12466 : Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || ...
When "FLUSH TABLE ... FOR EXPORT" fails, the SQL layer should rollback
the statement. Otherwise we hit an assert when we try to close the
tables while having a non-empty list of statement transaction participants.
2018-04-07 14:05:28 +03:00
Marko Mäkelä
980dd09be6 Merge 10.2 into 10.3 2018-03-29 17:03:34 +03:00
Sergei Petrunia
b922741074 MDEV-15472: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failure
MariaDB differs from the upstream for "DDL-like" command. For these,
it sets binlog_format=STATEMENT for the duration of the statement.
This doesn't play well with MyRocks, which tries to prevent DML
commands with binlog_format!=ROW.

Also, if Locked_tables_list::reopen_tables() returned an error, then
close_cached_tables should propagate the error condition and not silently
consume it (it's difficult to have test coverage for this because this
error condition is rare)
2018-03-29 14:43:08 +03:00
Monty
2dbeebdb16 Changed static const in Alter_info and Alter_online_info to defines
Main reason was to make it easier to print the above structures in
a debugger. Additional benefits is that I was able to use same
defines for both structures, which simplifes some code.

Most of the code is just removing Alter_info:: and Alter_inplace_info::
from alter table flags.

Following renames was done:
HA_ALTER_FLAGS        -> alter_table_operations
CHANGE_CREATE_OPTION  -> ALTER_CHANGE_CREATE_OPTION
Alter_info::ADD_INDEX -> ALTER_ADD_INDEX
DROP_INDEX            -> ALTER_DROP_INDEX
ADD_UNIQUE_INDEX      -> ALTER_ADD_UNIQUE_INDEX
DROP_UNIQUE_INDEx     -> ALTER_DROP_UNIQUE_INDEX
ADD_PK_INDEX          -> ALTER_ADD_PK_INDEX
DROP_PK_INDEX         -> ALTER_DROP_PK_INDEX
Alter_info:ALTER_ADD_COLUMN    -> ALTER_PARSE_ADD_COLUMN
Alter_info:ALTER_DROP_COLUMN   -> ALTER_PARSE_DROP_COLUMN
Alter_inplace_info::ADD_INDEX  -> ALTER_ADD_NON_UNIQUE_NON_PRIM_INDEX
Alter_inplace_info::DROP_INDEX -> ALTER_DROP_NON_UNIQUE_NON_PRIM_INDEX

Other things:
- Added typedef alter_table_operatons for alter table flags
- DROP CHECK CONSTRAINT can now be done online
- Added checks for Aria tables in alter_table_online.test
- alter_table_flags now takes an ulonglong as argument.
- Don't support online operations if checksum option is used.
- sql_lex.cc doesn't add ALTER_ADD_INDEX if index is not created
2018-03-29 13:59:40 +03:00
Sergei Petrunia
0d2fffb612 MDEV-15686: Loading MyRocks plugin back after it has been unloaded causes a crash
Adjust the testcase to handle all possible outcomes.
2018-03-29 11:08:32 +03:00