Commit graph

175335 commits

Author SHA1 Message Date
vinchen
640051e06a Binlog compressed
Add some event types for the compressed event, there are:
     QUERY_COMPRESSED_EVENT,
     WRITE_ROWS_COMPRESSED_EVENT_V1,
     UPDATE_ROWS_COMPRESSED_EVENT_V1,
     DELETE_POWS_COMPRESSED_EVENT_V1,
     WRITE_ROWS_COMPRESSED_EVENT,
     UPDATE_ROWS_COMPRESSED_EVENT,
     DELETE_POWS_COMPRESSED_EVENT.
These events inheritance the uncompressed editor events. One of their constructor functions and write
function have been overridden for uncompressing and compressing. Anything but this is totally the same.

On slave, The IO thread will uncompress and convert them When it receiving the events from the master.
So the SQL and worker threads can be stay unchanged.

Now we use zlib as compress algorithm. It maybe support other algorithm in the future.
2016-10-19 20:20:35 +02:00
sensssz
36841ac799 Add INNODB_LOCK_SCHEDULE_ALGORITHM to sysvars_innodb.result 2016-10-19 10:10:22 -04:00
vinchen
0fa39ffba7 fix code style.. 2016-10-19 13:52:17 +02:00
vinchen
c334f4fe46 fix the code style for read_binlog_speed_limit 2016-10-19 13:52:17 +02:00
vinchen
ef77847ccf fix common test suite 2016-10-19 13:51:49 +02:00
vinchen
43789901c7 Control the binlog read speed for compressed protocol 2016-10-19 13:51:08 +02:00
vinchen
8eb0f5ca1a Control the Maximum speed(KB/s) to read binlog from master 2016-10-19 13:51:08 +02:00
Alexey Botchkov
27025221fe MDEV-9143 JSON_xxx functions.
strings/json_lib.c added as a JSON library.
        SQL frunction added with sql/item_jsonfunc.h/cc
2016-10-19 14:10:03 +04:00
sensssz
f62fd5add8 Bug fix: remove redundant code from check_deadlock_result. Remove assert. 2016-10-19 01:46:57 -04:00
sensssz
0f93b5331e Merge branch '10.2-vats' of https://github.com/sensssz/server into 10.2-vats
Rebase
2016-10-19 01:42:34 -04:00
sensssz
0e60f89c29 Change VATS implementation. 2016-10-19 01:42:10 -04:00
sensssz
03b3425d31 Disable VATS on slave servers during replication. 2016-10-19 01:42:10 -04:00
sensssz
c455898b2c Implement VATS in XtraDB and InnoDB. 2016-10-19 01:42:10 -04:00
sensssz
5661b5c1d2 Change VATS implementation. 2016-10-19 01:37:52 -04:00
sensssz
5c40954798 Merge branch '10.2-vats' of https://github.com/sensssz/server into 10.2-vats
Sync upstream and rebase.
2016-10-18 10:29:02 -04:00
sensssz
a9bdea5d14 Disable VATS on slave servers during replication. 2016-10-18 10:28:05 -04:00
sensssz
0b7c35cd6a Implement VATS in XtraDB and InnoDB. 2016-10-18 10:28:05 -04:00
sensssz
88519c99c2 Disable VATS on slave servers during replication. 2016-10-18 09:52:39 -04:00
sensssz
87abc87004 Implement VATS in XtraDB and InnoDB. 2016-10-17 21:56:05 -04:00
Sergey Vojtovich
8303aded29 MDEV-7148 - Recurring: InnoDB: Failing assertion: !lock->recursive
On PPC64 high-loaded server may crash due to assertion failure in InnoDB
rwlocks code.

This happened because load order between "recursive" and "writer_thread"
wasn't properly enforced.
2016-10-17 18:35:49 +04:00
Sergey Vojtovich
2b47f8ff03 MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes
Clean-up periodic mutex/rwlock waiters wake up. This was a hack needed to
workaround broken mutexes/rwlocks implementation. We must have sane
implementations now and don't need these anymore: release thread is
guaranteed to wake up waiters.

Removed redundant ifdef that has equivalent code in both branches.

Removed os0atomic.h and os0atomic.ic: not used anymore.

Clean-up unused cmake checks.
2016-10-17 18:35:49 +04:00
Sergey Vojtovich
5608a737ea MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes
No point to issue RELEASE memory barrier in os_thread_create_func(): thread
creation is full memory barrier.

No point to issue os_wmb in rw_lock_set_waiter_flag() and
rw_lock_reset_waiter_flag(): this is deadcode and it is unlikely operational
anyway. If atomic builtins are unavailable - memory barriers are most certainly
unavailable too.

RELEASE memory barrier is definitely abused in buf_pool_withdraw_blocks(): most
probably it was supposed to commit volatile variable update, which is not what
memory barriers actually do. To operate properly it needs corresponding ACQUIRE
barrier without an associated atomic operation anyway.

ACQUIRE memory barrier is definitely abused in log_write_up_to(): most probably
it was supposed to synchronize dirty read of log_sys->write_lsn. To operate
properly it needs corresponding RELEASE barrier without an associated atomic
operation anyway.

Removed a bunch of ACQUIRE memory barriers from InnoDB rwlocks. They're
meaningless without corresponding RELEASE memory barriers.

Valid usage example of memory barriers without an associated atomic operation:
http://en.cppreference.com/w/cpp/atomic/atomic_thread_fence
2016-10-17 18:35:49 +04:00
Sergey Vojtovich
f4d885c4e9 MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes
Replaced InnoDB atomic operations with server atomic operations.

Moved INNODB_RW_LOCKS_USE_ATOMICS - it is always defined (code won't compile
otherwise).

NOTE: InnoDB uses thread identifiers as a target for atomic operations.
Thread identifiers should be considered opaque: any attempt to use a
thread ID other than in pthreads calls is nonportable and can lead to
unspecified results.
2016-10-17 18:35:48 +04:00
Sergey Vojtovich
d055e28f61 MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes
Simplified InnoDB mutex implementations, corrected memory barriers usage, use
server atomic builtins.
2016-10-17 18:35:48 +04:00
Kristian Nielsen
cc49f00994 Move InnoDB/XtraDB to async deadlock kill for parallel replication.
In 10.2, use the thd_rpl_deadlock_check() API. This way, all the
locking hacks around thd_report_wait_for() can be removed. Now
parallel replication deadlock kill happens asynchroneously, from the
slave background thread.

In InnoDB, remove also the buffering of wait reports, to simplify the
code, as this is no longer needed when the locking issues are gone.

In XtraDB, the buffering is kept for now. This is just because
presumably XtraDB will eventually be updated to MySQL 5.7-based InnoDB
as well, so there is little need to modify the existing code only for
clean-up purposes.

The old synchronous function thd_report_wait_for() is no longer used
and removed in this patch.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-17 12:52:14 +02:00
Elena Stepanova
4d3e3669ec MDEV-11061 Valgrind builder produces warnings with OpenSSL 2016-10-17 00:59:02 +03:00
Kristian Nielsen
e1ef99c3dc MDEV-7145: Delayed replication
Merge feature into 10.2 from feature branch.

Delayed replication adds an option

  CHANGE MASTER TO master_delay=<seconds>

Replication will then delay applying events with that many
seconds. This creates a replication slave that reflects the state of
the master some time in the past.

Feature is ported from MySQL source tree.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-16 23:44:44 +02:00
Vladislav Vaintroub
057c560ee4 MDEV-10943 . Workaround linker error on Linux. Linux does not actually use __bss_start, put __bss_start into #ifndef __linux__ section 2016-10-15 02:27:28 +02:00
Kristian Nielsen
fb13616518 MDEV-7145: Delayed replication.
Add test cases for delayed slave with parallel replication.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-14 23:15:59 +02:00
Kristian Nielsen
3011060b2a MDEV-7145: Delayed slave.
Extend to work also for parallel replication.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-14 23:15:59 +02:00
Kristian Nielsen
09136ec304 MDEV-7145, Delayed slave.
Only run testcase in --big. It takes a long time due to excessive sleeps.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-14 23:15:59 +02:00
Kristian Nielsen
814880711f BUG#56442: Slave executes delayed statements when STOP SLAVE is issued
Problem:
When using the delayed slave feature, and the SQL thread is delaying,
and the user issues STOP SLAVE, the event we wait for was executed.
It should not be executed.
Fix:
Check the return value from the delay function,
slave.cc:slave_sleep(). If the return value is 1, it means the thread
has been stopped, in this case we don't execute the statement.

Also, refactored the test case for delayed slave a little: added the
test script include/rpl_assert.inc, which asserts that a condition holds
and prints a message if not. Made rpl_delayed_slave.test use this. The
advantage is that the test file is much easier to read and maintain,
because it is clear what is an assertion and what is not, and also the
expected result can be found in the test file, you don't have to compare
it to the result file.

Manually merged into MariaDB from MySQL commit
fd2b210383358fe7697f201e19ac9779879ba72a

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-14 23:15:59 +02:00
Kristian Nielsen
851c401c0d MDEV-7145: Delayed replication, fix wsrep build failure.
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-14 23:15:59 +02:00
Kristian Nielsen
b2bc6dadee MDEV-7145: Delayed replication, cleanup some code
The original MySQL patch left some refactoring todo's, possibly
because of known conflicts with other parallel development (like
info-repository feature perhaps).

This patch fixes those todos/refactorings.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-14 23:15:59 +02:00
Kristian Nielsen
a9fb480fd6 MDEV-7145: Delayed replication, fixing test failures.
Two merge error fixed, and testsuite updated to removed some other
test failues.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-14 23:15:58 +02:00
Kristian Nielsen
19abe79fd1 MDEV-7145: Delayed replication, intermediate commit.
Initial merge of delayed replication from MySQL git.

The code from the initial push into MySQL is merged, and the
associated test case passes. A number of tasks are still pending:

1. Check full test suite run for any regressions or .result file updates.

2. Extend the feature to also work for parallel replication.

3. There are some todo-comments about future refactoring left from
MySQL, these should be located and merged on top.

4. There are some later related MySQL commits, these should be checked
and merged. These include:
    e134b9362ba0b750d6ac1b444780019622d14aa5
    b38f0f7857c073edfcc0a64675b7f7ede04be00f
    fd2b210383358fe7697f201e19ac9779879ba72a
    afc397376ec50e96b2918ee64e48baf4dda0d37d

5. The testcase from MySQL relies heavily on sleep and timing for
testing, and seems likely to sporadically fail on heavily loaded test
servers in buildbot or distro build farms.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-14 23:15:58 +02:00
Kristian Nielsen
50f19ca809 Remove unnecessary global mutex in parallel replication.
The function apply_event_and_update_pos() is called with the
rli->data_lock mutex held. However, there seems to be nothing in the
function actually needing the mutex to be held. Certainly not in the
parallel replication case, where sql_slave_skip_counter is always 0
since the non-zero case is handled by the SQL driver thread.

So this patch makes parallel replication use a variant of
apply_event_and_update_pos() without the need to take the
rli->data_lock mutex. This avoids one contended global mutex for each
event executed, which might improve performance on CPU-bound workloads
somewhat.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-14 22:44:40 +02:00
Elena Stepanova
9208b87f18 Follow-up for big error-message cleanup (trailing dots were removed) 2016-10-13 16:54:59 +03:00
Alexander Barkov
5058ced5df MDEV-7769 MY_CHARSET_INFO refactoring# On branch 10.2
Part 3 (final): removing MY_CHARSET_HANDLER::well_formed_len().
2016-10-10 14:36:09 +04:00
Otto Kekäläinen
a6f032af57 Deb: use --mem to run mtr faster and keep Travis-CI well below 50 min 2016-10-09 13:46:09 +03:00
Otto Kekäläinen
c416ed8b46 Deb: build faster using ccache when available 2016-10-09 13:42:36 +03:00
Otto Kekäläinen
0331df13fa Travis-CI: clean away cruf in definition file and use correct syntax 2016-10-08 16:41:47 +03:00
Alexander Barkov
553ca406cd A post-fix for MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressions
The result of binlog_{row|stm}_ctype_ucs.test depended on the machine
time zone setting. Making the test timzone independent.
2016-10-08 15:20:16 +04:00
Alexander Barkov
46dc7bdf1d MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressions
MDEV-10867 PREPARE..EXECUTE is not consistent about non-ASCII characters
2016-10-08 13:06:15 +04:00
Alexander Barkov
e1a212ebbc MDEV-10585 EXECUTE IMMEDIATE statement 2016-10-08 12:32:52 +04:00
Alexander Barkov
4c45b820aa MDEV-10709 Expressions as parameters to Dynamic SQL 2016-10-08 11:50:18 +04:00
Alexander Barkov
8ea2e143f0 MDEV-10772 Introduce Item_param::CONVERSION_INFO 2016-10-08 09:57:35 +04:00
Otto Kekäläinen
62d1cfe16c Deb: always build mariadb-cracklib-password-check, even on Travis-CI
Previously Travis-CI stated that cracklib is forbidden, but it does
not longer seem to be the case.
2016-10-07 15:33:02 +03:00
Otto Kekäläinen
1369696b8a Deb: Re-factor conditional build dependency checking and injecting
Now we check if a dependency is available and not just if older versions
are available. Also use correct name of libcrack2 to actually detect it.

Use sed to inject dependency at the end of the dependency list.
Otherwise keep the control line clean and parseable by Debian tools.
2016-10-07 15:32:59 +03:00
Otto Kekäläinen
44dd9a534a Deb: wrap-and-sort 2016-10-07 15:32:56 +03:00