fix(subscriptions): fix subscription to use the kv with the max version#7349
fix(subscriptions): fix subscription to use the kv with the max version#7349NamanJain8 merged 5 commits intomasterfrom
Conversation
pawanrawal
left a comment
There was a problem hiding this comment.
Reviewed 4 of 4 files at r3.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @jarifibrahim, @manishrjain, @NamanJain8, and @vvbalaji-dgraph)
x/x.go, line 1219 at r3 (raw file):
// Iterate over kvs to get the KV with the latest version. It is not necessary that the last // KV contain the latest value. var maxKv badgerpb.KV
Why not define it like
var maxKv *badgerpb.KV
and then below you can do
maxKv = kv
...
return maxKv
NamanJain8
left a comment
There was a problem hiding this comment.
Reviewable status: 3 of 4 files reviewed, 4 unresolved discussions (waiting on @jarifibrahim, @manishrjain, @pawanrawal, and @vvbalaji-dgraph)
dgraph/cmd/alpha/run.go, line 815 at r1 (raw file):
Previously, NamanJain8 (Naman Jain) wrote…
I don't think there will be any benefit in comparing the key, unless we suspect that badger might have sent the key which does not match the subscribed prefixes.
Done.
x/x.go, line 1219 at r3 (raw file):
Previously, pawanrawal (Pawan Rawal) wrote…
Why not define it like
var maxKv *badgerpb.KVand then below you can do
maxKv = kv...
return maxKv
Thanks. Done.
…on (#7349) Issue: The last KV from the list received from subscription need not be the latest update. This is because of the KVs written at the top due to value log rewrites or due to rollups. We were using the last KV from the updates received via subscription. Fix: Iterate over the KVs to get the KV with the latest version. (cherry picked from commit 4a2bc36)
…on (#7349) (#7355) Issue: The last KV from the list received from subscription need not be the latest update. This is because of the KVs written at the top due to value log rewrites or due to rollups. We were using the last KV from the updates received via subscription. Fix: Iterate over the KVs to get the KV with the latest version. (cherry picked from commit 4a2bc36)
Issue:
The last KV from the list received from subscription need not be the latest update. This is because of the KVs written at the top due to value log rewrites or due to rollups.
We were using the last KV from the updates received via subscription.
Fix:
Iterate over the KVs to get the KV with the latest version.
This change is