Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

MySQL release 5.7.25 28 #9

Merged
merged 378 commits into from
Apr 3, 2019
Merged

Conversation

TCeason
Copy link

@TCeason TCeason commented Apr 2, 2019

No description provided.

inikep and others added 30 commits November 7, 2018 10:29
PS-4790: Improve user statistics accuracy (5.6)
…TATS

1. Add missing SQLCOM_SHOW_USER_STATS, SQLCOM_SHOW_TABLE_STATS, SQLCOM_SHOW_INDEX_STATS, SQLCOM_SHOW_CLIENT_STATS, SQLCOM_SHOW_THREAD_STATS to `init_sql_command_flags()` and `mysql_execute_command()`
2. Use proper SQLCOM_SHOW_XXXX_STATS in `sql_yacc.yy` for `SHOW XXXX_STATISTICS;` instead of SQLCOM_SELECT
3. Re-record percona_userstat.result
PS-4781: sql_yacc.yy uses SQLCOM_SELECT instead of SQLCOM_SHOW_XXXX_STATS (5.6)
This is a backport of:
Bug#28785835 WORKAROUND ASAN BUG FOR TIRPC

Sun RPC, and XDR, is being removed from glibc, and into a separate libtirpc
library. This is not compatible with libasan. The interceptor functions
inserted into the code will segfault.
As a workaround, do LD_PRELOAD=/lib64/libtirpc.so
For dynamically linked libasan (default for gcc), we must preload that as well.

This currently affects fedora, but will likely also affect other linux
variants in the future.

This patch also enables ASAN suppressions in asan.supp
This patch also enables LSAN suppressions in lsan.supp

Change-Id: I1bc777482535ce21595a48ae12679c325667d722
(cherry picked from commit aa9698313b6d412265608fe9f1ffc05938448f81)
1. Add clang-7 to the list of compilers
2. Cache the commit number of last successful build and use it for pushes to the trunk.
   It fixes issues when "Auto cancel branch builds" is turned on at https://travis-ci.org/percona/percona-server/settings
PS-4881: Add LLVM/clang 7 to Travis-CI (5.6)
Problem
-------
The Relay_Log_Space variable shown in SHOW SLAVE STATUS is
sometimes much higher than the actual disk space used by relay
logs.

Analysis
--------
This is because we are not writing to
Relay_log_info::log_space_total in a synchronized manner. i.e, no
lock is being taken by the IO thread while updating the variable.

Fix
---
The Relay_log_info::log_space_total is now guarded by the
Relay_log_info::log_space_lock and this protects concurrent
update on Relay_log_info::log_space_total.
PS-4979 : Dropping TokuDB table with non-alphanumeric characters coul…
When certification information was too big to transmit an event was
generated that caused failures in all group members.
To avoid this, we no longer send this information if its size is too
big. We instead encode an error that will make the joiner leave the
group.
In debug builds, this setting is allowed to be turned off temporarily after it was
turned on during startup. Howewer memory garbage also caused it to be accidentally
turned on when it was disabled at startup.
The fix rejects malformed assignments with a syntax error.
The patch has fixed wrong OOM checks.

Change-Id: I19c7c3cc54a0aac8996c101aa5d88278d35914e3
               ON PB2 5.7

Description :- Keyring aws tests are failing for valgrind
runs on PB2 daily-5.7 and weekly-5.7

Fix :- Valgrind suppression are added for resolving the
keyring aws valgrind test failures.
               'CREATE USER' STATEMENT

DESCRIPTION:
============
When a 'create user' statement is rolled back, there is
a server crash because of an ASSERTION failure.

ANALYSIS:
========
When a rollback happens, the plugin decides whether to abort
the transaction and then set an error on the thread.
However, this error is ignored and not correctly propagated
to the calling functions because of which mysql_create_user
finally returns success. Later on, the server crashes
in my_ok where it expects that there should not have been
any error.

FIX:
====
The fix makes sure that the error is correctly captured.
               MAIN.MYSQLPUMP_PARTIAL_BKP MTR TEST CASE

DESCRIPTION:
===========
When mysqlpump encounters an error, it does not free all
allocated resources resulting in memory leaks.

ANALYSIS:
========
In normal scenario, when a dump task is being processed,
it is added to the vector which gets cleaned up at the end
of the execution. However, when an error is encountered,
we simply return from the processing function without
keeping a track of those tasks. This doesn't let
cleanup to happen properly and results in memory leak.

FIX:
====
Added code to clean up the resources in case of errors.
[BLD-1012] Add new selinux rules for tokudb and fix flush_caches
PS-4529 : MTR: index_merge_rocksdb2 inadvertently tests InnoDB instea…
laurynas-biveinis and others added 27 commits January 30, 2019 10:31
Fix PS-5369 (buf_pool_zip_hash mutex declared with buf_pool_zip_free …
…NFORMATION-SCHEMA-5.7

PS-4668: information schema tables - add section
…PS-4688.SSL-CERTIFICATE-COMPATIBILITY-MATRIX-5.7
…FICATE-COMPATIBILITY-MATRIX-5.7

Ps 4688.ssl certificate compatibility matrix 5.7
https://jira.percona.com/browse/PS-4833

***
Our fix for PS-3925
"MSAN: do not compare uninitailized memory in log_in_use"
(https://jira.percona.com/browse/PS-3925)
(commit 96f907b)
left intact as it is identical to the upstream fix for Bug #28178776 / #90238
"Comparison of uninitailized memory in log_in_use"
(https://bugs.mysql.com/bug.php?id=90238)
(commit mysql/mysql-server@d3b0f81).

***
Reverted our source code fixes for PS-964
"LP #1539504: CREATE TEMPORARY TABLE creates a transaction in binary log on read only server"
(https://jira.percona.com/browse/PS-964)
(commit 9d652c2)
and for PS-1071
"LP #1671013: CREATE TEMPORARY TABLE ... SELECT ... gets a DROP binlogged on disconnect in mixed"
(https://jira.percona.com/browse/PS-1071)
(commit ae47091)
in favor of the upstream fix for the Bug #28606948 / #83003
(https://bugs.mysql.com/bug.php?id=83003)
(commit mysql/mysql-server@9827f13).
Our MTR test cases improvements left intact:
- 'mysql-test/extra/binlog_tests/drop_temp_table.test';
- 'mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test'.

'rpl.rpl_row_gtid_disconnect_drop_temporary_table' MTR test case renamed to
'rpl.rpl_row_mix_gtid_disconnect_drop_temporary_table'
('--source' directive changed to 'include/have_binlog_format_mixed_or_row.inc').

'rpl.rpl_stm_mix_gtid_disconnect_drop_temporary_table' MTR test case renamed to
'rpl.rpl_stm_gtid_disconnect_drop_temporary_table'
('--source' directive changed to 'include/have_binlog_format_statement.inc').

***
Re-recorded 'main.mysql_config_editor' MTR test case because of the changed
copyright notice (2018->2019).

***
Re-recorded 'binlog_encryption.binlog_index' MTR test case because of the
extensions added to 'binlog.binlog_index' MTR test case made in the fix
for the upstream Bug #25839610
"ABORT OCCUR DURING SLAVE BACKUP WHEN RELAY LOG INDEX IS LOCK"
(commit mysql/mysql-server@e76d513).

***
Re-recorded 'tokudb.type_temporal_fractional' MTR test case because of the
fix for the upstream Bug #28022129
"NOW() DOESN'T HONOR NO_ZERO_DATE SQL_MODE"
(commit mysql/mysql-server@fd0abb1)
(commit mysql/mysql-server@ade9927).

***
The following MTR test cases re-recorded because of the combination of
different optimizer improvements both Oracle and Percona made:
- 'main.opt_hints';
- 'main.range_all';
- 'main.range_icp';
- 'main.range_icp_mrr';
- 'main.range_mrr';
- 'main.range_mrr_cost';
- 'main.range_none';
- 'main.subquery_bugs';
- 'innodb.innodb_mysql'.
See PS-4949
"Bad select+order by+limit performance in 5.7"
(https://jira.percona.com/browse/PS-4949)
(commit 37fb60e)
and
Oracle Bug #28086754
"OPTIMIZER SKIP THE RANGE SCAN ON SECOND COLUMN IN A COMPOSITE INDEX"
(commit mysql/mysql-server@4736e3b).

***
VERSION raised to "5.7.25-28".
univ.i version raised to "28".

***
This merge also fixes PS-4791
"SQL injection on slave due to non-quoting in binlogged ROLLBACK TO SAVEPOINT"
(https://jira.percona.com/browse/PS-4791)
as corresponding upstream Bug #28569645
"SQL INJECTION ON SLAVE DUE TO NON-QUOTING IN BINLOGGED ROLLBACK TO SAVEPOINT"
was fixed in 5.7.25
(commit mysql/mysql-server@3dadc95).
Replication: A patch to correct the handling of quotes for identifiers in
ROLLBACK TO SAVEPOINT statements in the binary log was not correctly applied
to subsequent MySQL versions.

***
This merge also fixes PS-4878
"Deadlock by concurrent show binlogs, pfs session_variables table & binlog purge"
(https://jira.percona.com/browse/PS-4878)
and PS-4716
"MySQL connection exhaustion due to too many in CLOSE_WAIT state"
(https://jira.percona.com/browse/PS-4716)
as corresponding upstream Bugs #28511326 / #91941, #92108, #92858
"Deadlock during purge_logs_before_date"
(https://bugs.mysql.com/bug.php?id=91941)
(https://bugs.mysql.com/bug.php?id=92108)
(https://bugs.mysql.com/bug.php?id=92858)
was fixed in 5.7.25
(commit mysql/mysql-server@38a6d1d)
(commit mysql/mysql-server@aedab91).
Replication: When the system variables binlog_transaction_dependency_tracking
and binlog_transaction_dependency_history_size were set or read, the types of
lock that were required could result in a deadlock scenario, because the same
locks were also required for working with the active binary logs. A new lock
type is now used instead for access to the transaction dependency tracking
system variables, so that this deadlock cannot occur.

***
This merge also fixes PS-4763
"ASan: Direct leak of 272 byte(s) in main.mysqlpump_partial_bkp MTR test case"
(https://jira.percona.com/browse/PS-4763)
as corresponding upstream Bugs #28538971 / #92131
"ASan: Direct leak of 272 byte(s) in main.mysqlpump_partial_bkp MTR test case"
(https://bugs.mysql.com/bug.php?id=92131)
was fixed in 5.7.25
(commit mysql/mysql-server@da632a9).
mysqlpump did not free all allocated resources when it encountered an error,
resulting in memory leaks.
PS-5018: Test fix after PS-3839 merge
Merge upstream 5.7.25 into Percona Server
…7-bugps1827-binlog_skip_flush_commands

Re-recorded 'binlog.percona_binlog_skip_flush_commands' MTR test case because
of the new 'FLUSH QUERY CACHE is deprecated' warning introduced in 5.7.

'perfschema.show_sanity' MTR test case extended with a new known system
variable 'binlog_skip_flush_commands'.

References to 'information_schema' in the
'sys_vars.binlog_skip_flush_commands_basic' MTR test case changed to
'performance_schema'.

Updated and re-recorded 'group_replication.gr_recovery_slave_commands'
MTR test case because of the new behavior of 'FLUSH RELAY LOGS' under
'super_read_only = ON'.
[PS-5317] Revert changes for libcurl dependency
@TCeason TCeason force-pushed the MySQL-release-5.7.25-28 branch from 56fc666 to 2e823c7 Compare April 2, 2019 03:30
@BohuTANG BohuTANG merged commit 914b0f5 into xelabs:5.7 Apr 3, 2019
TCeason pushed a commit to TCeason/tokudb that referenced this pull request Jun 17, 2019
…E TO A SERVER

Problem
========================================================================
Running the GCS tests with ASAN seldomly reports a user-after-free of
the server reference that the acceptor_learner_task uses.

Here is an excerpt of ASAN's output:

==43936==ERROR: AddressSanitizer: heap-use-after-free on address 0x63100021c840 at pc 0x000000530ff8 bp 0x7fc0427e8530 sp 0x7fc0427e8520
WRITE of size 8 at 0x63100021c840 thread T3
    #0 0x530ff7 in server_detected /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_transport.c:962
    #1 0x533814 in buffered_read_bytes /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_transport.c:1249
    #2 0x5481af in buffered_read_msg /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_transport.c:1399
    xelabs#3 0x51e171 in acceptor_learner_task /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:4690
    xelabs#4 0x562357 in task_loop /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/task.c:1140
    xelabs#5 0x5003b2 in xcom_taskmain2 /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:1324
    xelabs#6 0x6a278a in Gcs_xcom_proxy_impl::xcom_init(unsigned short, node_address*) /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_proxy.cc:164
    xelabs#7 0x59b3c1 in xcom_taskmain_startup /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_control_interface.cc:107
    xelabs#8 0x7fc04a2e4dd4 in start_thread (/lib64/libpthread.so.0+0x7dd4)
    xelabs#9 0x7fc047ff2bfc in __clone (/lib64/libc.so.6+0xfebfc)

0x63100021c840 is located 64 bytes inside of 65688-byte region [0x63100021c800,0x63100022c898)
freed by thread T3 here:
    #0 0x7fc04a5d7508 in __interceptor_free (/lib64/libasan.so.4+0xde508)
    #1 0x52cf86 in freesrv /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_transport.c:836
    #2 0x52ea78 in srv_unref /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_transport.c:868
    xelabs#3 0x524c30 in reply_handler_task /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:4914
    xelabs#4 0x562357 in task_loop /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/task.c:1140
    xelabs#5 0x5003b2 in xcom_taskmain2 /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:1324
    xelabs#6 0x6a278a in Gcs_xcom_proxy_impl::xcom_init(unsigned short, node_address*) /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_proxy.cc:164
    xelabs#7 0x59b3c1 in xcom_taskmain_startup /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_control_interface.cc:107
    xelabs#8 0x7fc04a2e4dd4 in start_thread (/lib64/libpthread.so.0+0x7dd4)

previously allocated by thread T3 here:
    #0 0x7fc04a5d7a88 in __interceptor_calloc (/lib64/libasan.so.4+0xdea88)
    #1 0x543604 in mksrv /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_transport.c:721
    #2 0x543b4c in addsrv /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_transport.c:755
    xelabs#3 0x54af61 in update_servers /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_transport.c:1747
    xelabs#4 0x501082 in site_install_action /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:1572
    xelabs#5 0x55447c in import_config /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/site_def.c:486
    xelabs#6 0x506dfc in handle_x_snapshot /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:5257
    xelabs#7 0x50c444 in xcom_fsm /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:5325
    xelabs#8 0x516c36 in dispatch_op /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:4510
    xelabs#9 0x521997 in acceptor_learner_task /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:4772
    xelabs#10 0x562357 in task_loop /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/task.c:1140
    xelabs#11 0x5003b2 in xcom_taskmain2 /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:1324
    xelabs#12 0x6a278a in Gcs_xcom_proxy_impl::xcom_init(unsigned short, node_address*) /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_proxy.cc:164
    xelabs#13 0x59b3c1 in xcom_taskmain_startup /home/tvale/mysql/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_control_interface.cc:107
    xelabs#14 0x7fc04a2e4dd4 in start_thread (/lib64/libpthread.so.0+0x7dd4)

Analysis
========================================================================
The server structure is reference counted by the associated sender_task
and reply_handler_task.
When they finish, they unreference the server, which leads to its memory
being freed.

However, the acceptor_learner_task keeps a "naked" reference to the
server structure.
Under the right ordering of operations, i.e. the sender_task and
reply_handler_task terminating after the acceptor_learner_task acquires,
but before it uses, the reference to the server structure, leads to the
acceptor_learner_task accessing the server structure after it has been
freed.

Solution
========================================================================
Let the acceptor_learner_task also reference count the server structure
so it is not freed while still in use.

Reviewed-by: André Negrão <andre.negrao@oracle.com>
Reviewed-by: Venkatesh Venugopal <venkatesh.venugopal@oracle.com>
RB: 21209
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.