未验证 提交 3b9dd3bd 编写于 作者: R Rahul Gurnani 提交者: GitHub

chore: Update Badger to release/v3.2011 and Ristretto to latest master (DGRAPH-2630) (#6853)

* Update Badger to release/v3.2011

* Update badger options

* Run go mod tidy

* Update Ristretto

* Update badger

* free up allocators from allocatorPool

* Fix Trie tests
Co-authored-by: NNamanJain8 <jnaman806@gmail.com>
Co-authored-by: NAhsan Barkati <ahsanbarkati@gmail.com>
上级 c714c312
......@@ -99,6 +99,8 @@ func main() {
// Run the program.
cmd.Execute()
// Free up allocators from alloctors from allocatorPool.
z.Done()
ticker.Stop()
fmt.Printf("Allocated Bytes at program end: %s\n", humanize.Bytes(uint64(z.NumAllocBytes())))
......
......@@ -18,12 +18,12 @@ 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.20201023122926-2b71a94d1f03
github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201106140743-6c074551f8f5
github.com/dgraph-io/dgo/v200 v200.0.0-20200805103119-a3544c464dd6
github.com/dgraph-io/gqlgen v0.13.2
github.com/dgraph-io/gqlparser/v2 v2.1.1
github.com/dgraph-io/graphql-transport-ws v0.0.0-20200916064635-48589439591b
github.com/dgraph-io/ristretto v0.0.4-0.20201028045312-0eff948d52ac
github.com/dgraph-io/ristretto v0.0.4-0.20201105000107-750f5be31aad
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13
......
......@@ -80,8 +80,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.20201023122926-2b71a94d1f03 h1:8LV0DyKZuYz2eEgMFa/xDpdsocGXb+TS3QRA/YR4TTw=
github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201023122926-2b71a94d1f03/go.mod h1:n/u2cnSaDlwS/fTbAjpr793z2mKHDU1N5N27QCyLea4=
github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201106140743-6c074551f8f5 h1:8m4WAJ/Z1gvTzDVg8EmEy2NJgCCBQFMrvB1PWQjS/RU=
github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20201106140743-6c074551f8f5/go.mod h1:AyKZ2teZKQkxJ6+u2Sl/gFKqV30G0kiAixdw8slZAdY=
github.com/dgraph-io/dgo/v200 v200.0.0-20200805103119-a3544c464dd6 h1:toHzMCdCUgYsjM0cW9+wafnKFXfp1HizIJUyzihN+vk=
github.com/dgraph-io/dgo/v200 v200.0.0-20200805103119-a3544c464dd6/go.mod h1:rHa+h3kI4M8ASOirxyIyNeXBfHFgeskVUum2OrDMN3U=
github.com/dgraph-io/gqlgen v0.13.2 h1:TNhndk+eHKj5qE7BenKKSYdSIdOGhLqxR1rCiMso9KM=
......@@ -90,10 +90,8 @@ github.com/dgraph-io/gqlparser/v2 v2.1.1 h1:OBGI6VR+WcegjDB3JdNPMpKpEtITHWzgmiCX
github.com/dgraph-io/gqlparser/v2 v2.1.1/go.mod h1:MYS4jppjyx8b9tuUtjV7jU1UFZK6P9fvO8TsIsQtRKU=
github.com/dgraph-io/graphql-transport-ws v0.0.0-20200916064635-48589439591b h1:PDEhlwHpkEQ5WBfOOKZCNZTXFDGyCEWTYDhxGQbyIpk=
github.com/dgraph-io/graphql-transport-ws v0.0.0-20200916064635-48589439591b/go.mod h1:7z3c/5w0sMYYZF5bHsrh8IH4fKwG5O5Y70cPH1ZLLRQ=
github.com/dgraph-io/ristretto v0.0.4-0.20201022105248-f32a01612740 h1:TzbxnxH3PoFUWx5024RX1+uqLnUVbfdHANjrHMb5Xnc=
github.com/dgraph-io/ristretto v0.0.4-0.20201022105248-f32a01612740/go.mod h1:bDI4cDaalvYSji3vBVDKrn9ouDZrwN974u8ZO/AhYXs=
github.com/dgraph-io/ristretto v0.0.4-0.20201028045312-0eff948d52ac h1:vQVQkNho3qVZrVueqoefGZLZgl2imLY2xMbf8LGpr+s=
github.com/dgraph-io/ristretto v0.0.4-0.20201028045312-0eff948d52ac/go.mod h1:bDI4cDaalvYSji3vBVDKrn9ouDZrwN974u8ZO/AhYXs=
github.com/dgraph-io/ristretto v0.0.4-0.20201105000107-750f5be31aad h1:BN2A+lqBwLx57/l1MUv3iKLIY8XddNkZg2zZN/BFM1I=
github.com/dgraph-io/ristretto v0.0.4-0.20201105000107-750f5be31aad/go.mod h1:bDI4cDaalvYSji3vBVDKrn9ouDZrwN974u8ZO/AhYXs=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 h1:CaO/zOnF8VvUfEbhRatPcwKVWamvbYd8tQGRWacE9kU=
......
......@@ -574,8 +574,7 @@ func (r *rebuilder) Run(ctx context.Context) error {
WithSyncWrites(false).
WithNumVersionsToKeep(math.MaxInt32).
WithLogger(&x.ToGlog{}).
WithCompression(options.None).
WithLogRotatesToFlush(10)
WithCompression(options.None)
// Set cache if we have encryption.
if len(x.WorkerConfig.EncryptionKey) > 0 {
......
......@@ -249,7 +249,7 @@ func (enc *encoder) setScalarVal(fj fastJsonNode, sv []byte) error {
// Also increase curSize.
enc.curSize += uint64(len(sv))
if size := enc.alloc.Size() + enc.curSize; size > maxEncodedSize {
if size := uint64(enc.alloc.Size()) + enc.curSize; size > maxEncodedSize {
return fmt.Errorf("estimated response size: %d is bigger than threshold: %d",
size, maxEncodedSize)
}
......
......@@ -1346,7 +1346,7 @@ func (n *node) calculateTabletSizes() {
glog.V(3).Info("Skipping table not owned by one predicate")
}
previousLeft = left.Attr
previousSize = int64(tinfo.EstimatedSz)
previousSize = int64(tinfo.OnDiskSize)
}
// The last table has not been counted. Assign it to the predicate at the left of the table.
updateSize(previousLeft, previousSize)
......
......@@ -36,9 +36,11 @@ type Trie struct {
func NewTrie() *Trie {
buf, err := z.NewBufferWith(32<<20, math.MaxUint32, z.UseMmap)
x.Check(err)
ro := buf.AllocateOffset(nodeSz)
// Add additional 8 bytes at the start, because offset=0 is used for checking non-existing node.
// Therefore we can't keep root at 0 offset.
ro := buf.AllocateOffset(nodeSz + 8)
return &Trie{
root: uint32(ro),
root: uint32(ro + 8),
buf: buf,
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册