diff --git a/codis/pkg/proxy/backend.go b/codis/pkg/proxy/backend.go index 7c76a82176..ed078409c9 100644 --- a/codis/pkg/proxy/backend.go +++ b/codis/pkg/proxy/backend.go @@ -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) { @@ -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)