Skip to content

Commit

Permalink
Update badger to commit cddf7c03451c (#5216)
Browse files Browse the repository at this point in the history
This PR updates badger to latest version
dgraph-io/badger@cddf7c03451c .

This PR also changes the following things.
1. Removes the second argument from `watermark.Init()` function. The
second parameter was removed Init() function by commit
dgraph-io/badger@09dd2e1
2. go.mod and go.sum updates
3. Change `pb.KV` in `pb.proto` to use `badgerpb2.KV` instead of
`badgerpb2.KV`. The protobuf package was renamed from `pb` to
`badgr.pb2` dgraph-io/badger@cddf7c0. 

NOTE - I've updated badger using `go get -u ... ` command. All the
changes in go.mod file except badger are a side effect of badger update.

Following new commits are being added from badger
```
git log 91c31ebe8c22...cddf7c03451c --oneline
```
```
cddf7c0 Proto: Rename dgraph.badger.v2.pb to badgerpb2 (#1314)
fd693e4 Support entry version in Write batch (#1310)
f9332eb Disable go 1.11 builds on travis (#1306)
09dd2e1 Replace EventLog with Logger (#1203)
4f6763c Add leveled logging (#1249)
30eeec2 Update issue template (#1295)
8097259 Proto: make badger/v2 compatible with v1 (#1293)
2e708d9 Fail fast if cgo is disabled and compression is ZSTD (#1284)
6e032c0 Fix race condition in DoesNotHave (#1287)
fa94030 Fix Sequence generates duplicate values (#1281)
69f35b3 Add go_package in .proto (#1282)
5f48d42 Disable eventlogging by default (#1285)
4b539b9 Update Project Status in readme.md (#1274)
```
  • Loading branch information
Ibrahim Jarif authored Apr 22, 2020
1 parent 32266db commit 7b37ddb
Show file tree
Hide file tree
Showing 8 changed files with 358 additions and 320 deletions.
2 changes: 1 addition & 1 deletion conn/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func NewNode(rc *pb.RaftContext, store *raftwal.DiskStorage) *Node {
peers: make(map[uint64]string),
requestCh: make(chan linReadReq, 100),
}
n.Applied.Init(nil, true)
n.Applied.Init(nil)
// This should match up to the Applied index set above.
n.Applied.SetDoneUntil(n.Cfg.Applied)
glog.Infof("Setting raft.Config to: %+v\n", n.Cfg)
Expand Down
2 changes: 1 addition & 1 deletion dgraph/cmd/zero/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (o *Oracle) Init() {
o.keyCommit = make(map[string]uint64)
o.subscribers = make(map[int]chan pb.OracleDelta)
o.updates = make(chan *pb.OracleDelta, 100000) // Keeping 1 second worth of updates.
o.doneUntil.Init(nil, true)
o.doneUntil.Init(nil)
go o.sendDeltasToSubscribers()
}

Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ require (
github.com/99designs/gqlgen v0.11.0
github.com/DataDog/datadog-go v0.0.0-20190425163447-40bafcb5f6c1 // indirect
github.com/DataDog/opencensus-go-exporter-datadog v0.0.0-20190503082300-0f32ad59ab08
github.com/DataDog/zstd v1.4.4 // indirect
github.com/DataDog/zstd v1.4.5 // indirect
github.com/OneOfOne/xxhash v1.2.5 // indirect
github.com/beorn7/perks v1.0.0 // indirect
github.com/blevesearch/bleve v0.0.0-20181114232033-e1f5e6cdcd76
github.com/blevesearch/go-porterstemmer v1.0.2 // indirect
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.20200316175624-91c31ebe8c22
github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200421062606-cddf7c03451c
github.com/dgraph-io/dgo/v200 v200.0.0-20200401175452-e463f9234453
github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3
github.com/dgraph-io/ristretto v0.0.2
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/dgryski/go-farm v0.0.0-20191112170834-c2139c5d712b
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13
github.com/dgryski/go-groupvarint v0.0.0-20190318181831-5ce5df8ca4e1
github.com/dustin/go-humanize v1.0.0
github.com/getsentry/sentry-go v0.6.0
Expand All @@ -29,7 +29,7 @@ require (
github.com/gogo/protobuf v1.3.1
github.com/golang/geo v0.0.0-20170810003146-31fb0106dc4a
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/protobuf v1.3.5
github.com/golang/protobuf v1.4.0
github.com/golang/snappy v0.0.1
github.com/google/codesearch v1.0.0
github.com/google/go-cmp v0.4.0
Expand All @@ -40,7 +40,7 @@ require (
github.com/mitchellh/panicwrap v1.0.0
github.com/paulmach/go.geojson v0.0.0-20170327170536-40612a87147b
github.com/philhofer/fwd v1.0.0 // indirect
github.com/pkg/errors v0.8.1
github.com/pkg/errors v0.9.1
github.com/pkg/profile v1.2.1
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect
Expand All @@ -58,9 +58,9 @@ require (
go.etcd.io/etcd v0.0.0-20190228193606-a943ad0ee4c9
go.opencensus.io v0.21.0
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/sys v0.0.0-20200116001909-b77594299b42
golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f
golang.org/x/text v0.3.2
google.golang.org/genproto v0.0.0-20190516172635-bb713bdc0e52 // indirect
google.golang.org/grpc v1.23.0
Expand Down
62 changes: 50 additions & 12 deletions go.sum

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion posting/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,6 @@ func (r *rebuilder) Run(ctx context.Context) error {
WithNumVersionsToKeep(math.MaxInt32).
WithLogger(&x.ToGlog{}).
WithCompression(options.None).
WithEventLogging(false).
WithLogRotatesToFlush(10).
WithEncryptionKey(enc.ReadEncryptionKeyFile(x.WorkerConfig.BadgerKeyFile))
tmpDB, err := badger.OpenManaged(dbOpts)
Expand Down
26 changes: 13 additions & 13 deletions protos/pb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -281,20 +281,20 @@ message RestoreRequest {
}

message Proposal {
Mutations mutations = 2;
repeated KV kv = 4;
MembershipState state = 5;
string clean_predicate = 6; // Delete the predicate which was moved to other group.
string key = 7;
OracleDelta delta = 8;
Snapshot snapshot = 9; // Used to tell the group when to take snapshot.
uint64 index = 10; // Used to store Raft index, in raft.Ready.
uint64 expected_checksum = 11; // Block an operation until membership reaches this checksum.
RestoreRequest restore = 12;
Mutations mutations = 2;
repeated badgerpb2.KV kv = 4;
MembershipState state = 5;
string clean_predicate = 6; // Delete the predicate which was moved to other group.
string key = 7;
OracleDelta delta = 8;
Snapshot snapshot = 9; // Used to tell the group when to take snapshot.
uint64 index = 10; // Used to store Raft index, in raft.Ready.
uint64 expected_checksum = 11; // Block an operation until membership reaches this checksum.
RestoreRequest restore = 12;
}

message KVS {
repeated pb.KV kv = 1;
repeated badgerpb2.KV kv = 1;
// done used to indicate if the stream of KVS is over.
bool done = 2;
}
Expand Down Expand Up @@ -534,15 +534,15 @@ service Worker {
rpc Export (ExportRequest) returns (Status) {}
rpc ReceivePredicate(stream KVS) returns (api.Payload) {}
rpc MovePredicate(MovePredicatePayload) returns (api.Payload) {}
rpc Subscribe(SubscriptionRequest) returns (stream pb.KVList) {}
rpc Subscribe(SubscriptionRequest) returns (stream badgerpb2.KVList) {}
}

message SubscriptionRequest {
repeated bytes prefixes = 1;
}

message SubscriptionResponse {
pb.KVList kvs = 1;
badgerpb2.KVList kvs = 1;
}

message Num {
Expand Down
Loading

0 comments on commit 7b37ddb

Please sign in to comment.