Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions codis/pkg/proxy/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,9 @@ func (bc *BackendConn) run() {
}

var (
errRespMasterDown = []byte("MASTERDOWN")
errRespLoading = []byte("LOADING")
errRespMasterDown = []byte("MASTERDOWN")
errRespLoading = []byte("LOADING")
errRespSlotMigrateClosed = []byte("ERR please open slotmigrate and reload slot")
)

func (bc *BackendConn) loopReader(tasks <-chan *Request, c *redis.Conn, round int) (err error) {
Expand Down Expand Up @@ -300,6 +301,11 @@ func (bc *BackendConn) loopReader(tasks <-chan *Request, c *redis.Conn, round in
log.Warnf("backend conn [%p] to %s, db-%d state = DataStale, caused by 'LOADING'",
bc, bc.addr, bc.database)
}
case bytes.HasPrefix(resp.Value, errRespSlotMigrateClosed):
if bc.state.CompareAndSwap(stateConnected, stateDataStale) {
log.Warnf("backend conn [%p] to %s, db-%d state = DataStale, caused by 'slotmigrate disabled'",
bc, bc.addr, bc.database)
}
}
}
bc.setResponse(r, resp, nil)
Expand Down
Loading