Skip to content

Commit

Permalink
fix migration bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzhe1991 committed Jul 3, 2015
1 parent f162249 commit 89322a3
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions pkg/proxy/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,17 @@ func (s *Server) checkAndDoTopoChange(seq int) bool {
}

s.createTaskRunners()

if act.Type == models.ACTION_TYPE_SLOT_MIGRATE {
for e := s.bufferedReq.Front(); e != nil; {
next := e.Next()
blockedReq := e.Value.(*PipelineRequest)
if s.slots[blockedReq.slotIdx].slotInfo.State.Status != models.SLOT_STATUS_PRE_MIGRATE {
s.dispatch(blockedReq)
s.bufferedReq.Remove(e)
}
e = next
}
}
return true
}

Expand Down Expand Up @@ -539,15 +549,6 @@ func (s *Server) handleTopoEvent() {
s.bufferedReq.PushBack(r)
continue
}
for e := s.bufferedReq.Front(); e != nil; {
next := e.Next()
blockedReq := e.Value.(*PipelineRequest)
if s.slots[blockedReq.slotIdx].slotInfo.State.Status != models.SLOT_STATUS_PRE_MIGRATE {
s.dispatch(r)
s.bufferedReq.Remove(e)
}
e = next
}
s.dispatch(r)
case e := <-s.evtbus:
switch e.(type) {
Expand Down

0 comments on commit 89322a3

Please sign in to comment.