From 3b5a9b738f714516967b4e29e872b9946abf87ec Mon Sep 17 00:00:00 2001 From: Joaquin Menchaca Date: Tue, 9 Jun 2020 16:11:42 -0700 Subject: [PATCH 1/2] release/v20.03: Update badger 06/09/2020 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c1a060a5806..30be0fcb7cd 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/blevesearch/segment v0.0.0-20160915185041-762005e7a34f // indirect github.com/blevesearch/snowballstem v0.0.0-20180110192139-26b06a2c243d // indirect github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd - github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200528205344-e7b6e76f96e8 + github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200609141616-14386ac9b764 github.com/dgraph-io/dgo/v2 v2.2.1-0.20200319183917-53c7d5bc32a7 github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3 github.com/dgrijalva/jwt-go v3.2.0+incompatible diff --git a/go.sum b/go.sum index 9a9ff698513..faa9385b707 100644 --- a/go.sum +++ b/go.sum @@ -76,8 +76,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgraph-io/badger v1.6.0 h1:DshxFxZWXUcO0xX476VJC07Xsr6ZCBVRHKZ93Oh7Evo= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200528205344-e7b6e76f96e8 h1:TDpSSjrjipVJHEpcimd7uRYqiIeMc1LsM7p2tgEl+s8= -github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200528205344-e7b6e76f96e8/go.mod h1:3KY8+bsP8wI0OEnQJAKpd4wIJW/Mm32yw2j/9FUVnIM= +github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200609141616-14386ac9b764 h1:cWmYs+E7F/w4KWIkVrV3VLUJkqolRa7y5G2LLMPQVQs= +github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200609141616-14386ac9b764/go.mod h1:3KY8+bsP8wI0OEnQJAKpd4wIJW/Mm32yw2j/9FUVnIM= github.com/dgraph-io/dgo/v2 v2.2.1-0.20200319183917-53c7d5bc32a7 h1:9oFXHEReyRIB291rbdGwRk1PYegGO2XBtZ8muXPKqPA= github.com/dgraph-io/dgo/v2 v2.2.1-0.20200319183917-53c7d5bc32a7/go.mod h1:LJCkLxm5fUMcU+yb8gHFjHt7ChgNuz3YnQQ6MQkmscI= github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3 h1:MQLRM35Pp0yAyBYksjbj1nZI/w6eyRY/mWoM1sFf4kU= From d7fa3d2527b429266a62d5d34186fcb139c5d83b Mon Sep 17 00:00:00 2001 From: Ibrahim Jarif Date: Mon, 15 Jun 2020 15:50:04 +0530 Subject: [PATCH 2/2] Disable badger's conflict detection --- worker/server_state.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/worker/server_state.go b/worker/server_state.go index 324dec6ca53..a2c4d8e2d0c 100644 --- a/worker/server_state.go +++ b/worker/server_state.go @@ -66,12 +66,20 @@ func InitServerState() { } func setBadgerOptions(opt badger.Options) badger.Options { - opt = opt.WithSyncWrites(false).WithTruncate(true).WithLogger(&x.ToGlog{}). + opt = opt.WithSyncWrites(false). + WithTruncate(true). + WithLogger(&x.ToGlog{}). WithEncryptionKey(enc.ReadEncryptionKeyFile(Config.BadgerKeyFile)) // Do not load bloom filters on DB open. opt.LoadBloomsOnOpen = false + // Disable conflict detection in badger. Alpha runs in managed mode and + // perform its own conflict detection so we don't need badger's conflict + // detection. Using badger's conflict detection uses memory which can be + // saved by disabling it. + opt.DetectConflicts = false + glog.Infof("Setting Badger Compression Level: %d", Config.BadgerCompressionLevel) // Default value of badgerCompressionLevel is 3 so compression will always // be enabled, unless it is explicitly disabled by setting the value to 0.