grpcproxy/cache: only check compaction revision for historical revisions

Since the current revision is 0, it'll always be less than the compaction
revision. If the proxy sees a compaction, it would always reject the
current revision requests since it's less than the compaction revision.
Instead, check if the revision is historical before trying to reject on
compaction revision.

Fixes #7599
This commit is contained in:
Anthony Romano
2017-03-24 13:18:31 -07:00
parent b9cfa4cef9
commit b2a465e354

View File

@@ -111,7 +111,7 @@ func (c *cache) Get(req *pb.RangeRequest) (*pb.RangeResponse, error) {
c.mu.Lock()
defer c.mu.Unlock()
if req.Revision < c.compactedRev {
if req.Revision > 0 && req.Revision < c.compactedRev {
c.lru.Remove(key)
return nil, ErrCompacted
}