Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release/v1.0: Remove query cache which is causing contention. #4071

Merged
merged 1 commit into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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