Skip to content

Commit 96bc380

Browse files
author
Shlomi Noach
committed
test-on-replica stops replication completely
1 parent 97adbf1 commit 96bc380

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
#
33
#
4-
RELEASE_VERSION="0.9.0"
4+
RELEASE_VERSION="0.9.1"
55

66
buildpath=/tmp/gh-ost
77
target=gh-ost

go/logic/applier.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,17 @@ func (this *Applier) StopSlaveIOThread() error {
558558
return nil
559559
}
560560

561+
// StartSlaveSQLThread is applicable with --test-on-replica
562+
func (this *Applier) StopSlaveSQLThread() error {
563+
query := `stop /* gh-ost */ slave sql_thread`
564+
log.Infof("Verifying SQL thread is stopped")
565+
if _, err := sqlutils.ExecNoPrepare(this.db, query); err != nil {
566+
return err
567+
}
568+
log.Infof("SQL thread stopped")
569+
return nil
570+
}
571+
561572
// StartSlaveSQLThread is applicable with --test-on-replica
562573
func (this *Applier) StartSlaveSQLThread() error {
563574
query := `start /* gh-ost */ slave sql_thread`
@@ -573,7 +584,7 @@ func (this *Applier) StopSlaveNicely() error {
573584
if err := this.StopSlaveIOThread(); err != nil {
574585
return err
575586
}
576-
if err := this.StartSlaveSQLThread(); err != nil {
587+
if err := this.StopSlaveSQLThread(); err != nil {
577588
return err
578589
}
579590
readBinlogCoordinates, executeBinlogCoordinates, err := mysql.GetReplicationBinlogCoordinates(this.db)

0 commit comments

Comments
 (0)