Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Issue 2400303002: Add LwwRegister CRDT (Closed)

Created:
4 years, 2 months ago by steimel
Modified:
4 years, 2 months ago
Reviewers:
scf, Kevin M, CJ
CC:
chromium-reviews, cbentzel+watch_chromium.org, anandc+watch-blimp_chromium.org, maniscalco+watch-blimp_chromium.org, sriramsr+watch-blimp_chromium.org, bgoldman+watch-blimp_chromium.org, steimel+watch-blimp_chromium.org, gcasto+watch-blimp_chromium.org, shaktisahu+watch-blimp_chromium.org, nyquist+watch-blimp_chromium.org, perumaal+watch-blimp_chromium.org, marcinjb+watch-blimp_chromium.org, jessicag+watch-blimp_chromium.org, kmarshall+watch-blimp_chromium.org, lethalantidote+watch-blimp_chromium.org, dtrainor+watch-blimp_chromium.org, scf+watch-blimp_chromium.org, khushalsagar+watch-blimp_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add LwwRegister CRDT BUG=650466 Committed: https://crrev.com/cc4584d7c74a937b617180bc69a5816b49f004b3 Cr-Commit-Position: refs/heads/master@{#426549}

Patch Set 1 #

Patch Set 2 : Add LwwRegister and tests to build #

Total comments: 43

Patch Set 3 : Update from VectorClock to VersionVector. Refactor unit tests. Code review comments. #

Patch Set 4 : Update LwwRegister to use Coded(In/Out)putStream. LwwRegisterSerializer -> SyncablePrimitiveSeriali… #

Total comments: 35

Patch Set 5 : Refactor Serializer to use overloaded methods and add unit tests. Refactor LwwRegister to not be te… #

Total comments: 27

Patch Set 6 : Refactor SyncablePrimitiveSerializer tests and other code review feedback. #

Total comments: 18

Patch Set 7 : Combine Bias and RunningAs enums, plus other code review feedback. #

Total comments: 25

Patch Set 8 : Rebase with Syncable interface changes + code review feedback #

Total comments: 10

Patch Set 9 : SyncablePrimitiveSerializer->CodedValueSerializer #

Total comments: 2

Patch Set 10 : Add comment on max string length constant #

Unified diffs Side-by-side diffs Delta from patch set Stats (+536 lines, -4 lines) Patch
M blimp/helium/BUILD.gn View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -0 lines 0 comments Download
A blimp/helium/coded_value_serializer.h View 1 2 3 4 5 6 7 8 1 chunk +51 lines, -0 lines 0 comments Download
A blimp/helium/coded_value_serializer.cc View 1 2 3 4 5 6 7 8 9 1 chunk +83 lines, -0 lines 0 comments Download
A blimp/helium/coded_value_serializer_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +118 lines, -0 lines 0 comments Download
A blimp/helium/lww_register.h View 1 2 3 4 5 6 7 8 1 chunk +120 lines, -0 lines 0 comments Download
A blimp/helium/lww_register_unittest.cc View 1 2 3 4 5 6 7 1 chunk +151 lines, -0 lines 0 comments Download
A + blimp/helium/syncable_common.h View 1 2 3 4 5 6 7 1 chunk +7 lines, -4 lines 0 comments Download

Messages

Total messages: 38 (5 generated)
CJ
https://codereview.chromium.org/2400303002/diff/20001/blimp/net/helium/lww_register.h File blimp/net/helium/lww_register.h (right): https://codereview.chromium.org/2400303002/diff/20001/blimp/net/helium/lww_register.h#newcode25 blimp/net/helium/lww_register.h:25: explicit LwwRegister(VectorClockGenerator* clock_gen, RunningAs running_as); Is there a particular ...
4 years, 2 months ago (2016-10-07 22:07:54 UTC) #2
steimel
PTAL. Still need to refactor tests, but other than that it's functional https://codereview.chromium.org/2400303002/diff/20001/blimp/net/helium/lww_register.h File blimp/net/helium/lww_register.h ...
4 years, 2 months ago (2016-10-07 22:53:39 UTC) #4
scf
https://codereview.chromium.org/2400303002/diff/20001/blimp/common/proto/helium.proto File blimp/common/proto/helium.proto (right): https://codereview.chromium.org/2400303002/diff/20001/blimp/common/proto/helium.proto#newcode30 blimp/common/proto/helium.proto:30: int32 integer_value = 1; rename to something that convey ...
4 years, 2 months ago (2016-10-10 19:45:47 UTC) #5
CJ
https://codereview.chromium.org/2400303002/diff/20001/blimp/net/helium/lww_register.h File blimp/net/helium/lww_register.h (right): https://codereview.chromium.org/2400303002/diff/20001/blimp/net/helium/lww_register.h#newcode18 blimp/net/helium/lww_register.h:18: enum class RunningAs { RunningAsClient, RunningAsEngine }; Could simplify ...
4 years, 2 months ago (2016-10-10 20:25:56 UTC) #6
Kevin M
Heads up: the change to using byte output streams instead of proto messages will undoubtedly ...
4 years, 2 months ago (2016-10-10 20:50:22 UTC) #7
steimel
https://codereview.chromium.org/2400303002/diff/20001/blimp/common/proto/helium.proto File blimp/common/proto/helium.proto (right): https://codereview.chromium.org/2400303002/diff/20001/blimp/common/proto/helium.proto#newcode30 blimp/common/proto/helium.proto:30: int32 integer_value = 1; On 2016/10/10 19:45:46, scf wrote: ...
4 years, 2 months ago (2016-10-11 16:39:17 UTC) #8
CJ
https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/syncable_primitive_serializer.h File blimp/net/helium/syncable_primitive_serializer.h (right): https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/syncable_primitive_serializer.h#newcode33 blimp/net/helium/syncable_primitive_serializer.h:33: void SyncablePrimitiveSerializer<int32_t>::SerializeSyncablePrimitive( Pretty sure we could simplify these function ...
4 years, 2 months ago (2016-10-12 22:32:45 UTC) #9
scf
https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/syncable_primitive_serializer.h File blimp/net/helium/syncable_primitive_serializer.h (right): https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/syncable_primitive_serializer.h#newcode44 blimp/net/helium/syncable_primitive_serializer.h:44: .ReadVarint32((uint32_t*)&value); add check? https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/syncable_primitive_serializer.h#newcode61 blimp/net/helium/syncable_primitive_serializer.h:61: coded_input_stream.ReadVarint32(&length); add check
4 years, 2 months ago (2016-10-12 23:05:12 UTC) #10
Kevin M
https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/bias.h File blimp/net/helium/bias.h (right): https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/bias.h#newcode5 blimp/net/helium/bias.h:5: #ifndef BLIMP_NET_HELIUM_BIAS_H We'll need a home for RunningAs, too. ...
4 years, 2 months ago (2016-10-13 22:03:37 UTC) #11
Kevin M
https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/lww_register.h File blimp/net/helium/lww_register.h (right): https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/lww_register.h#newcode110 blimp/net/helium/lww_register.h:110: bool LwwRegister<RegisterType, bias>::LocalWinsConflict() const { Can we just precompute ...
4 years, 2 months ago (2016-10-13 22:49:55 UTC) #12
Kevin M
https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/syncable_primitive_serializer.h File blimp/net/helium/syncable_primitive_serializer.h (right): https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/syncable_primitive_serializer.h#newcode1 blimp/net/helium/syncable_primitive_serializer.h:1: // Copyright 2016 The Chromium Authors. All rights reserved. ...
4 years, 2 months ago (2016-10-14 17:12:35 UTC) #13
Kevin M
OK, you can rebase on master now - the Coded*Stream CL has landed.
4 years, 2 months ago (2016-10-17 20:32:46 UTC) #14
steimel
PTAL https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/bias.h File blimp/net/helium/bias.h (right): https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/bias.h#newcode5 blimp/net/helium/bias.h:5: #ifndef BLIMP_NET_HELIUM_BIAS_H On 2016/10/13 22:03:36, Kevin M wrote: ...
4 years, 2 months ago (2016-10-17 21:46:00 UTC) #15
scf
just a couple of nits but lgtm overall https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/bias.h File blimp/net/helium/bias.h (right): https://codereview.chromium.org/2400303002/diff/60001/blimp/net/helium/bias.h#newcode5 blimp/net/helium/bias.h:5: #ifndef ...
4 years, 2 months ago (2016-10-17 22:09:52 UTC) #16
Kevin M
https://codereview.chromium.org/2400303002/diff/80001/blimp/net/helium/lww_register.h File blimp/net/helium/lww_register.h (right): https://codereview.chromium.org/2400303002/diff/80001/blimp/net/helium/lww_register.h#newcode32 blimp/net/helium/lww_register.h:32: const RegisterType& value() const; Hmm. This should probably use ...
4 years, 2 months ago (2016-10-17 22:19:46 UTC) #17
steimel
PTAL https://codereview.chromium.org/2400303002/diff/80001/blimp/net/helium/lww_register.h File blimp/net/helium/lww_register.h (right): https://codereview.chromium.org/2400303002/diff/80001/blimp/net/helium/lww_register.h#newcode32 blimp/net/helium/lww_register.h:32: const RegisterType& value() const; On 2016/10/17 22:19:45, Kevin ...
4 years, 2 months ago (2016-10-18 23:53:20 UTC) #18
Kevin M
https://codereview.chromium.org/2400303002/diff/100001/blimp/helium/lww_register.h File blimp/helium/lww_register.h (right): https://codereview.chromium.org/2400303002/diff/100001/blimp/helium/lww_register.h#newcode51 blimp/helium/lww_register.h:51: bool value_set_; Suggestion: you can use an inline initializer ...
4 years, 2 months ago (2016-10-19 00:27:08 UTC) #19
steimel
PTAL https://codereview.chromium.org/2400303002/diff/100001/blimp/helium/lww_register.h File blimp/helium/lww_register.h (right): https://codereview.chromium.org/2400303002/diff/100001/blimp/helium/lww_register.h#newcode51 blimp/helium/lww_register.h:51: bool value_set_; On 2016/10/19 00:27:08, Kevin M wrote: ...
4 years, 2 months ago (2016-10-19 16:40:50 UTC) #20
steimel
https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/lww_register.h File blimp/helium/lww_register.h (right): https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/lww_register.h#newcode26 blimp/helium/lww_register.h:26: LwwRegister(VersionVectorGenerator* version_gen, Peer bias, Peer running_as); Since I end ...
4 years, 2 months ago (2016-10-19 16:42:49 UTC) #21
scf
https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/lww_register_unittest.cc File blimp/helium/lww_register_unittest.cc (right): https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/lww_register_unittest.cc#newcode62 blimp/helium/lww_register_unittest.cc:62: from_lww_register->CreateChangesetToCurrent(from.Invert(), &output_stream); do you need to invert here? i ...
4 years, 2 months ago (2016-10-19 17:23:03 UTC) #22
steimel
https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/lww_register_unittest.cc File blimp/helium/lww_register_unittest.cc (right): https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/lww_register_unittest.cc#newcode62 blimp/helium/lww_register_unittest.cc:62: from_lww_register->CreateChangesetToCurrent(from.Invert(), &output_stream); On 2016/10/19 17:23:03, scf wrote: > do ...
4 years, 2 months ago (2016-10-19 17:37:54 UTC) #23
Kevin M
Very close, would just like to see the serialization tests get beefed up a bit. ...
4 years, 2 months ago (2016-10-19 17:49:11 UTC) #24
scf
https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/syncable_primitive_serializer.cc File blimp/helium/syncable_primitive_serializer.cc (right): https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/syncable_primitive_serializer.cc#newcode48 blimp/helium/syncable_primitive_serializer.cc:48: if (input_stream->ReadVarint32(&length) && length < kMaxStringLength) { On 2016/10/19 ...
4 years, 2 months ago (2016-10-19 18:08:26 UTC) #25
Kevin M
https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/syncable_common.h File blimp/helium/syncable_common.h (right): https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/syncable_common.h#newcode11 blimp/helium/syncable_common.h:11: enum class Peer { Client, Engine }; CLIENT, ENGINE
4 years, 2 months ago (2016-10-19 21:46:56 UTC) #26
CJ
https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/lww_register.h File blimp/helium/lww_register.h (right): https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/lww_register.h#newcode45 blimp/helium/lww_register.h:45: VersionVectorGenerator* version_gen_; Does the LWW_Register take ownership over the ...
4 years, 2 months ago (2016-10-20 00:20:16 UTC) #27
steimel
PTAL https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/lww_register.h File blimp/helium/lww_register.h (right): https://codereview.chromium.org/2400303002/diff/120001/blimp/helium/lww_register.h#newcode26 blimp/helium/lww_register.h:26: LwwRegister(VersionVectorGenerator* version_gen, Peer bias, Peer running_as); On 2016/10/19 ...
4 years, 2 months ago (2016-10-20 00:30:07 UTC) #28
Kevin M
lgtm https://codereview.chromium.org/2400303002/diff/140001/blimp/helium/syncable_primitive_serializer.cc File blimp/helium/syncable_primitive_serializer.cc (right): https://codereview.chromium.org/2400303002/diff/140001/blimp/helium/syncable_primitive_serializer.cc#newcode42 blimp/helium/syncable_primitive_serializer.cc:42: DCHECK(value.length() < kMaxStringLength); DCHECK_LT https://codereview.chromium.org/2400303002/diff/140001/blimp/helium/syncable_primitive_serializer.cc#newcode57 blimp/helium/syncable_primitive_serializer.cc:57: // ------ ...
4 years, 2 months ago (2016-10-20 00:38:25 UTC) #29
steimel
PTAL https://codereview.chromium.org/2400303002/diff/140001/blimp/helium/syncable_primitive_serializer.cc File blimp/helium/syncable_primitive_serializer.cc (right): https://codereview.chromium.org/2400303002/diff/140001/blimp/helium/syncable_primitive_serializer.cc#newcode42 blimp/helium/syncable_primitive_serializer.cc:42: DCHECK(value.length() < kMaxStringLength); On 2016/10/20 00:38:24, Kevin M ...
4 years, 2 months ago (2016-10-20 00:57:38 UTC) #30
Kevin M
lgtm https://codereview.chromium.org/2400303002/diff/160001/blimp/helium/coded_value_serializer.cc File blimp/helium/coded_value_serializer.cc (right): https://codereview.chromium.org/2400303002/diff/160001/blimp/helium/coded_value_serializer.cc#newcode18 blimp/helium/coded_value_serializer.cc:18: constexpr uint32_t kMaxStringLength = (10 << 20); // ...
4 years, 2 months ago (2016-10-20 17:11:23 UTC) #31
steimel
https://codereview.chromium.org/2400303002/diff/160001/blimp/helium/coded_value_serializer.cc File blimp/helium/coded_value_serializer.cc (right): https://codereview.chromium.org/2400303002/diff/160001/blimp/helium/coded_value_serializer.cc#newcode18 blimp/helium/coded_value_serializer.cc:18: constexpr uint32_t kMaxStringLength = (10 << 20); // 10MB ...
4 years, 2 months ago (2016-10-20 17:20:41 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2400303002/180001
4 years, 2 months ago (2016-10-20 17:21:19 UTC) #35
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 2 months ago (2016-10-20 18:56:36 UTC) #36
commit-bot: I haz the power
4 years, 2 months ago (2016-10-21 13:20:53 UTC) #38
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/cc4584d7c74a937b617180bc69a5816b49f004b3
Cr-Commit-Position: refs/heads/master@{#426549}

Powered by Google App Engine
This is Rietveld 408576698