-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG#19667258: WL#6972: SERVER CRASH ON SET SESSION SESSION_TRACK_GTID…
…S='OFF' The server crashes when changing the value of session_track_gtids from 'ALL_GTIDS' or 'OWN_GTID' to 'OFF'. This was due to the fact that the memory structures were being released to early in the process. We fix this by deferring the internal memory structures cleanup until after the OK packet has been filled with the required information. Furthermore, this patch fixes the behavior regarding the GTID information that is put in the OK packet during transitions between states of session_track_gtids, i.e., when the user issues SET session_track_gtids='...'. The behavior is the following during transitions (from -> to): |-----------+-----------------------------------| | FROM | TO | |-----------+-----------+-----------+-----------| | | OFF | OWN_GTID | ALL_GTIDS | |-----------+-----------+-----------+-----------| | OFF | No GTID | No GTID | No GTID | | OWN_GTID | No GTID | No GTID | No GTID | | ALL_GTIDS | ALL_GTIDS | ALL_GTIDS | ALL_GTIDS | |-----------+-----------+-----------+-----------| This patch also includes tests for the various transitions depicted in the above table.
- Loading branch information
Luis Soares
committed
Oct 14, 2014
1 parent
439a402
commit 1e0844c
Showing
8 changed files
with
215 additions
and
23 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
mysql-test/suite/binlog/r/binlog_gtid_mix_ok_packet_all_gtids.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# ALL_GTIDS at startup: this must return GTID:1 | ||
CREATE TABLE t1 (c1 INT) Engine=InnoDB; | ||
-- Tracker : SESSION_TRACK_GTIDS | ||
-- 00000000-1111-0000-1111-000000000000:1 | ||
|
||
# ALL_GTIDS at startup: this must return GTID:1-2 | ||
DROP TABLE t1; | ||
-- Tracker : SESSION_TRACK_GTIDS | ||
-- 00000000-1111-0000-1111-000000000000:1-2 | ||
|
||
## ALL_GTIDS -> ALL_GTIDS : this must return GTID:1-2 ## | ||
SET SESSION session_track_gtids='ALL_GTIDS'; | ||
SET SESSION session_track_gtids='ALL_GTIDS'; | ||
-- Tracker : SESSION_TRACK_GTIDS | ||
-- 00000000-1111-0000-1111-000000000000:1-2 | ||
|
||
## ALL_GTIDS -> OWN_GTID: this must return GTID:1-2 ## | ||
SET SESSION session_track_gtids='ALL_GTIDS'; | ||
SET SESSION session_track_gtids='OWN_GTID'; | ||
-- Tracker : SESSION_TRACK_GTIDS | ||
-- 00000000-1111-0000-1111-000000000000:1-2 | ||
|
||
## ALL_GTIDS -> OFF : this must return GTID:1-2 ## | ||
SET SESSION session_track_gtids='ALL_GTIDS'; | ||
SET SESSION session_track_gtids='OFF'; | ||
-- Tracker : SESSION_TRACK_GTIDS | ||
-- 00000000-1111-0000-1111-000000000000:1-2 | ||
|
||
## OWN_GTID -> ALL_GTIDS : this must return '' ## | ||
SET SESSION session_track_gtids='OWN_GTID'; | ||
SET SESSION session_track_gtids='ALL_GTIDS'; | ||
## OWN_GTID -> OWN_GTID: this must return '' ## | ||
SET SESSION session_track_gtids='OWN_GTID'; | ||
SET SESSION session_track_gtids='OWN_GTID'; | ||
## OWN_GTID -> OFF : this must return '' ## | ||
SET SESSION session_track_gtids='OWN_GTID'; | ||
SET SESSION session_track_gtids='OFF'; | ||
## OFF -> ALL_GTIDS : this must return '' ## | ||
SET SESSION session_track_gtids='OFF'; | ||
SET SESSION session_track_gtids='ALL_GTIDS'; | ||
## OFF -> OWN_GTID: this must return '' ## | ||
SET SESSION session_track_gtids='OFF'; | ||
SET SESSION session_track_gtids='OWN_GTID'; | ||
## OFF -> OFF : this must return '' ## | ||
SET SESSION session_track_gtids='OFF'; | ||
SET SESSION session_track_gtids='OFF'; |
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
1 change: 1 addition & 0 deletions
1
mysql-test/suite/binlog/t/binlog_gtid_mix_ok_packet_all_gtids-master.opt
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 @@ | ||
--log-slave-updates --enforce-gtid-consistency --gtid-mode=ON --debug=+d,server_uuid_deterministic --session-track-gtids=ALL_GTIDS |
71 changes: 71 additions & 0 deletions
71
mysql-test/suite/binlog/t/binlog_gtid_mix_ok_packet_all_gtids.test
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,71 @@ | ||
--source include/have_binlog_format_mixed.inc | ||
--source include/have_gtid.inc | ||
--source include/have_debug.inc | ||
|
||
# BUG#19667258: WL#6972 - SERVER CRASH ON SET SESSION SESSION_TRACK_GTIDS='OFF' | ||
|
||
# This test file is configured to start the server with: | ||
# | ||
# --session_track_gtids='ALL_GTIDS' | ||
# | ||
# Then we are looking to assert the following: | ||
# - Verify that the following statements include | ||
# GTID data in the OK packet immediately after start | ||
# the server starts up. | ||
# - Verify that every transition includes the expected | ||
# GTID data in the OK packet. | ||
|
||
--enable_session_track_info | ||
|
||
--echo # ALL_GTIDS at startup: this must return GTID:1 | ||
CREATE TABLE t1 (c1 INT) Engine=InnoDB; | ||
|
||
--echo # ALL_GTIDS at startup: this must return GTID:1-2 | ||
DROP TABLE t1; | ||
|
||
--disable_session_track_info | ||
|
||
--let $i=3 | ||
while($i) | ||
{ | ||
if ($i==3) | ||
{ | ||
--let $from=ALL_GTIDS | ||
} | ||
|
||
if ($i==2) | ||
{ | ||
--let $from=OWN_GTID | ||
} | ||
|
||
if ($i==1) | ||
{ | ||
--let $from=OFF | ||
} | ||
|
||
--let $text= this must return '' | ||
if (`SELECT '$from' = 'ALL_GTIDS'`) | ||
{ | ||
--let $text= this must return GTID:1-2 | ||
} | ||
|
||
--echo ## $from -> ALL_GTIDS : $text ## | ||
--eval SET SESSION session_track_gtids='$from' | ||
--enable_session_track_info | ||
SET SESSION session_track_gtids='ALL_GTIDS'; | ||
--disable_session_track_info | ||
|
||
--echo ## $from -> OWN_GTID: $text ## | ||
--eval SET SESSION session_track_gtids='$from' | ||
--enable_session_track_info | ||
SET SESSION session_track_gtids='OWN_GTID'; | ||
--disable_session_track_info | ||
|
||
--echo ## $from -> OFF : $text ## | ||
--eval SET SESSION session_track_gtids='$from' | ||
--enable_session_track_info | ||
SET SESSION session_track_gtids='OFF'; | ||
--disable_session_track_info | ||
|
||
--dec $i | ||
} |
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
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
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
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