Merge pull request #98 from github/drop-unix-socket-file
supporting --initially-drop-socket-file
This commit is contained in:
commit
4bd2179d40
2
build.sh
2
build.sh
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
RELEASE_VERSION="1.0.2"
|
RELEASE_VERSION="1.0.3"
|
||||||
|
|
||||||
buildpath=/tmp/gh-ost
|
buildpath=/tmp/gh-ost
|
||||||
target=gh-ost
|
target=gh-ost
|
||||||
|
@ -72,6 +72,7 @@ type MigrationContext struct {
|
|||||||
CutOverLockTimeoutSeconds int64
|
CutOverLockTimeoutSeconds int64
|
||||||
PanicFlagFile string
|
PanicFlagFile string
|
||||||
|
|
||||||
|
DropServeSocket bool
|
||||||
ServeSocketFile string
|
ServeSocketFile string
|
||||||
ServeTCPPort int64
|
ServeTCPPort int64
|
||||||
|
|
||||||
|
@ -83,6 +83,7 @@ func main() {
|
|||||||
flag.StringVar(&migrationContext.PostponeCutOverFlagFile, "postpone-cut-over-flag-file", "", "while this file exists, migration will postpone the final stage of swapping tables, and will keep on syncing the ghost table. Cut-over/swapping would be ready to perform the moment the file is deleted.")
|
flag.StringVar(&migrationContext.PostponeCutOverFlagFile, "postpone-cut-over-flag-file", "", "while this file exists, migration will postpone the final stage of swapping tables, and will keep on syncing the ghost table. Cut-over/swapping would be ready to perform the moment the file is deleted.")
|
||||||
flag.StringVar(&migrationContext.PanicFlagFile, "panic-flag-file", "", "when this file is created, gh-ost will immediately terminate, without cleanup")
|
flag.StringVar(&migrationContext.PanicFlagFile, "panic-flag-file", "", "when this file is created, gh-ost will immediately terminate, without cleanup")
|
||||||
|
|
||||||
|
flag.BoolVar(&migrationContext.DropServeSocket, "initially-drop-socket-file", false, "Should gh-ost forcibly delete an existing socket file. Be careful: this might drop the socket file of a running migration!")
|
||||||
flag.StringVar(&migrationContext.ServeSocketFile, "serve-socket-file", "", "Unix socket file to serve on. Default: auto-determined and advertised upon startup")
|
flag.StringVar(&migrationContext.ServeSocketFile, "serve-socket-file", "", "Unix socket file to serve on. Default: auto-determined and advertised upon startup")
|
||||||
flag.Int64Var(&migrationContext.ServeTCPPort, "serve-tcp-port", 0, "TCP port to serve on. Default: disabled")
|
flag.Int64Var(&migrationContext.ServeTCPPort, "serve-tcp-port", 0, "TCP port to serve on. Default: disabled")
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ func (this *Server) BindSocketFile() (err error) {
|
|||||||
if this.migrationContext.ServeSocketFile == "" {
|
if this.migrationContext.ServeSocketFile == "" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if base.FileExists(this.migrationContext.ServeSocketFile) {
|
if this.migrationContext.DropServeSocket && base.FileExists(this.migrationContext.ServeSocketFile) {
|
||||||
os.Remove(this.migrationContext.ServeSocketFile)
|
os.Remove(this.migrationContext.ServeSocketFile)
|
||||||
}
|
}
|
||||||
this.unixListener, err = net.Listen("unix", this.migrationContext.ServeSocketFile)
|
this.unixListener, err = net.Listen("unix", this.migrationContext.ServeSocketFile)
|
||||||
|
Loading…
Reference in New Issue
Block a user