Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
MXS-1751: Fix crash with available_when_donor=true
The `MYSQL_ROW row` variable was being overwritten by the extra query done by the SST method detection code. Moving it into its own function prevents this and makes the code significantly easier to comprehend. Added a test case that reproduced the problem (MaxScale crashed) and verifies that the patch fixes the problem.
- Loading branch information
Showing
4 changed files
with
128 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
maxscale-system-test/cnf/maxscale.cnf.template.mxs1751_available_when_donor_crash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| [maxscale] | ||
| threads=###threads### | ||
|
|
||
| [Galera Monitor] | ||
| type=monitor | ||
| module=galeramon | ||
| servers=server1,server2,server3 | ||
| user=maxskysql | ||
| passwd=skysql | ||
| monitor_interval=100 | ||
| available_when_donor=true | ||
|
|
||
| [RW Split Router] | ||
| type=service | ||
| router=readwritesplit | ||
| servers=server1,server2,server3 | ||
| user=maxskysql | ||
| passwd=skysql | ||
| master_accept_reads=true | ||
|
|
||
| [RW Split Listener] | ||
| type=listener | ||
| service=RW Split Router | ||
| protocol=MySQLClient | ||
| port=4006 | ||
|
|
||
| [CLI] | ||
| type=service | ||
| router=cli | ||
|
|
||
| [CLI Listener] | ||
| type=listener | ||
| service=CLI | ||
| protocol=maxscaled | ||
| socket=default | ||
|
|
||
| [server1] | ||
| type=server | ||
| address=###galera_server_IP_1### | ||
| port=###galera_server_port_1### | ||
| protocol=MySQLBackend | ||
|
|
||
| [server2] | ||
| type=server | ||
| address=###galera_server_IP_2### | ||
| port=###galera_server_port_2### | ||
| protocol=MySQLBackend | ||
|
|
||
| [server3] | ||
| type=server | ||
| address=###galera_server_IP_3### | ||
| port=###galera_server_port_3### | ||
| protocol=MySQLBackend |
30 changes: 30 additions & 0 deletions
30
maxscale-system-test/mxs1751_available_when_donor_crash.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* | ||
| * Copyright (c) 2016 MariaDB Corporation Ab | ||
| * | ||
| * Use of this software is governed by the Business Source License included | ||
| * in the LICENSE.TXT file and at www.mariadb.com/bsl11. | ||
| * | ||
| * Change Date: 2020-01-01 | ||
| * | ||
| * On the date above, in accordance with the Business Source License, use | ||
| * of this software will be governed by version 2 or later of the General | ||
| * Public License. | ||
| */ | ||
|
|
||
| #include "testconnections.h" | ||
|
|
||
| int main(int argc, char* argv[]) | ||
| { | ||
| TestConnections test(argc, argv); | ||
|
|
||
| for (int i = 0; i < 2; i++) | ||
| { | ||
| test.galera->stop_node(0); | ||
| test.galera->stop_node(1); | ||
| test.galera->start_node(1); | ||
| test.galera->start_node(0); | ||
| test.galera->fix_replication(); | ||
| } | ||
|
|
||
| return test.global_result; | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters