Skip to content

Commit

Permalink
Remove query cache which is causing contention. (#4071)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmai authored Sep 26, 2019
1 parent d9bd76d commit 747ee5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion edgraph/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ func (s *Server) Query(ctx context.Context, req *api.Request) (resp *api.Respons
if req.StartTs == 0 {
req.StartTs = posting.Oracle().MaxAssigned()
}
queryRequest.Cache = worker.NoTxnCache
queryRequest.Cache = worker.NoCache
}
if req.StartTs == 0 {
req.StartTs = State.getTimestamp(req.ReadOnly)
Expand Down
8 changes: 4 additions & 4 deletions worker/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,8 @@ func (qs *queryState) handleUidPostings(

const (
UseTxnCache = iota
NoTxnCache
// NoCache indicates no caches should be used
NoCache
)

// processTask processes the query, accumulates and returns the result.
Expand Down Expand Up @@ -729,9 +730,8 @@ func processTask(ctx context.Context, q *pb.Query, gid uint32) (*pb.Result, erro
if q.Cache == UseTxnCache {
qs.cache = posting.Oracle().CacheAt(q.ReadTs)
}
if qs.cache == nil {
qs.cache = posting.NewLocalCache(q.ReadTs)
}
// For now, remove the query level cache. It is causing contention for queries with high
// fan-out.

out, err := qs.helpProcessTask(ctx, q, gid)
if err != nil {
Expand Down

0 comments on commit 747ee5c

Please sign in to comment.