Skip to content

Commit

Permalink
Ensure that DB is properly initialized when performing stale queries
Browse files Browse the repository at this point in the history
  • Loading branch information
pierresouchay committed Aug 21, 2018
1 parent 4d658f3 commit fb1d3ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions agent/consul/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ func (s *Server) forward(method string, info structs.RPCInfo, args interface{},
return true, err
}

// Check if we can allow a stale read
if info.IsRead() && info.AllowStaleRead() {
// Check if we can allow a stale read, ensure our local DB is initialized
if info.IsRead() && info.AllowStaleRead() && s.raft.LastIndex() > 2 {
return false, nil
}

Expand Down

0 comments on commit fb1d3ec

Please sign in to comment.