1
0
Fork 0

Update store.go

master
Philip O'Toole 1 year ago committed by GitHub
parent cce81d2714
commit 2f8d4e95e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -965,6 +965,10 @@ func (s *Store) Request(eqr *command.ExecuteQueryRequest) ([]*command.ExecuteQue
}
if !s.RequiresLeader(eqr) {
if eqr.Level == command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_NONE && eqr.Freshness > 0 &&
time.Since(s.raft.LastContact()).Nanoseconds() > eqr.Freshness {
return nil, ErrStaleRead
}
if eqr.Request.Transaction {
// Transaction requested during query, but not going through consensus. This means
// we need to block any database serialization during the query.

Loading…
Cancel
Save