Skip to content

Commit 959cc71

Browse files
author
Ibrahim Jarif
authored
Update badger to commit e7b6e76f96e8 (#5538)
Also enables storing indices in the cache.
1 parent bdc7c1d commit 959cc71

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/blevesearch/segment v0.0.0-20160915185041-762005e7a34f // indirect
1717
github.com/blevesearch/snowballstem v0.0.0-20180110192139-26b06a2c243d // indirect
1818
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd
19-
github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200522174526-6eaa5009af27
19+
github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200528205344-e7b6e76f96e8
2020
github.com/dgraph-io/dgo/v2 v2.1.1-0.20191127085444-c7a02678e8a6
2121
github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3
2222
github.com/dgrijalva/jwt-go v3.2.0+incompatible

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ github.com/d4l3k/messagediff v1.2.1/go.mod h1:Oozbb1TVXFac9FtSIxHBMnBCq2qeH/2KkE
6262
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6363
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
6464
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
65-
github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200522174526-6eaa5009af27 h1:2oSyH418QYuj2IhW5XWvSJqu5S2wT6czY2ZmPcLhgB4=
66-
github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200522174526-6eaa5009af27/go.mod h1:3KY8+bsP8wI0OEnQJAKpd4wIJW/Mm32yw2j/9FUVnIM=
65+
github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200528205344-e7b6e76f96e8 h1:TDpSSjrjipVJHEpcimd7uRYqiIeMc1LsM7p2tgEl+s8=
66+
github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200528205344-e7b6e76f96e8/go.mod h1:3KY8+bsP8wI0OEnQJAKpd4wIJW/Mm32yw2j/9FUVnIM=
6767
github.com/dgraph-io/dgo/v2 v2.1.1-0.20191127085444-c7a02678e8a6 h1:5leDFqGys055YO3TbghBhk/QdRPEwyLPdgsSJfiR20I=
6868
github.com/dgraph-io/dgo/v2 v2.1.1-0.20191127085444-c7a02678e8a6/go.mod h1:LJCkLxm5fUMcU+yb8gHFjHt7ChgNuz3YnQQ6MQkmscI=
6969
github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3 h1:MQLRM35Pp0yAyBYksjbj1nZI/w6eyRY/mWoM1sFf4kU=

worker/server_state.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,12 @@ func (s *ServerState) initStorage() {
149149
// All the writes to posting store should be synchronous. We use batched writers
150150
// for posting lists, so the cost of sync writes is amortized.
151151
x.Check(os.MkdirAll(Config.PostingDir, 0700))
152-
opt := badger.DefaultOptions(Config.PostingDir).WithValueThreshold(1 << 10 /* 1KB */).
153-
WithNumVersionsToKeep(math.MaxInt32).WithMaxCacheSize(1 << 30)
152+
opt := badger.DefaultOptions(Config.PostingDir).
153+
WithValueThreshold(1 << 10 /* 1KB */).
154+
WithNumVersionsToKeep(math.MaxInt32).
155+
WithMaxCacheSize(1 << 30).
156+
WithKeepBlockIndicesInCache(true).
157+
WithKeepBlocksInCache(true)
154158
opt = setBadgerOptions(opt)
155159

156160
// Print the options w/o exposing key.

0 commit comments

Comments
 (0)