2
0

Add tests for replication slot drop, and go fmt

This commit is contained in:
Kris Wehner
2017-01-26 18:24:21 -08:00
parent b2f416c07d
commit 41d9c0f338
2 changed files with 38 additions and 19 deletions
+14 -7
View File
@@ -8,10 +8,10 @@ import (
)
const (
copyBothResponse = 'W'
walData = 'w'
senderKeepalive = 'k'
standbyStatusUpdate = 'r'
copyBothResponse = 'W'
walData = 'w'
senderKeepalive = 'k'
standbyStatusUpdate = 'r'
initialReplicationResponseTimeout = 5 * time.Second
)
@@ -157,7 +157,7 @@ func ReplicationConnect(config ConnConfig) (r *ReplicationConn, err error) {
}
config.RuntimeParams["replication"] = "database"
c,err := Connect(config)
c, err := Connect(config)
if err != nil {
return
}
@@ -208,6 +208,13 @@ func (rc *ReplicationConn) Close() error {
return rc.c.Close()
}
func (rc *ReplicationConn) IsAlive() bool {
return rc.c.IsAlive()
}
func (rc *ReplicationConn) CauseOfDeath() error {
return rc.c.CauseOfDeath()
}
func (rc *ReplicationConn) readReplicationMessage() (r *ReplicationMessage, err error) {
var t byte
@@ -257,12 +264,12 @@ func (rc *ReplicationConn) readReplicationMessage() (r *ReplicationMessage, err
return &ReplicationMessage{ServerHeartbeat: h}, nil
default:
if rc.c.shouldLog(LogLevelError) {
rc.c.log(LogLevelError,"Unexpected data playload message type %v", t)
rc.c.log(LogLevelError, "Unexpected data playload message type %v", t)
}
}
default:
if rc.c.shouldLog(LogLevelError) {
rc.c.log(LogLevelError,"Unexpected replication message type %v", t)
rc.c.log(LogLevelError, "Unexpected replication message type %v", t)
}
}
return