Skip to content

Commit

Permalink
storage: fix inability to update liveness in mixed version clusters
Browse files Browse the repository at this point in the history
The encoding of `storage.Liveness` changed in cockroachdb#18910 which caused node
liveness updates to fail in mixed version clusters due to failed
conditional puts. Because the encoding changed, continued attempts to
update the liveness would never succeed. Changed `Liveness.expiration`
to use the `LegacyTimestamp` type.

Audited the code and the only protos that are used as the expected value
in conditional put operations are `storage.Liveness` and
`roachpb.RangeDescriptor`. Extended TestBelowRaftProtos to verify the
encoding of these protos does not change unexpectedly.

Consistency checks were failing in mixed version clusters because of an
explicit call to marshal an `hlc.Timestamp` in `Replica.sha512`.

Fixes cockroachdb#18940
  • Loading branch information
petermattis committed Oct 2, 2017
1 parent 8831391 commit 9d2b17e
Show file tree
Hide file tree
Showing 44 changed files with 1,966 additions and 1,360 deletions.
2 changes: 1 addition & 1 deletion build/protobuf.mk
Expand Up @@ -58,7 +58,7 @@ UI_JS := $(UI_ROOT)/src/js/protos.js
UI_TS := $(UI_ROOT)/src/js/protos.d.ts
UI_SOURCES := $(UI_JS) $(UI_TS)

CPP_PROTOS := $(filter %/roachpb/metadata.proto %/roachpb/data.proto %/roachpb/internal.proto %/engine/enginepb/mvcc.proto %/engine/enginepb/rocksdb.proto %/hlc/timestamp.proto %/unresolved_addr.proto,$(GO_PROTOS))
CPP_PROTOS := $(filter %/roachpb/metadata.proto %/roachpb/data.proto %/roachpb/internal.proto %/engine/enginepb/mvcc.proto %/engine/enginepb/rocksdb.proto %/hlc/legacy_timestamp.proto %/hlc/timestamp.proto %/unresolved_addr.proto,$(GO_PROTOS))
CPP_HEADERS := $(subst ./,$(NATIVE_ROOT)/,$(CPP_PROTOS:%.proto=%.pb.h))
CPP_SOURCES := $(subst ./,$(NATIVE_ROOT)/,$(CPP_PROTOS:%.proto=%.pb.cc))

Expand Down
1 change: 1 addition & 0 deletions c-deps/libroach/CMakeLists.txt
Expand Up @@ -29,6 +29,7 @@ add_library(roach
protos/cockroach/pkg/roachpb/metadata.pb.cc
protos/cockroach/pkg/storage/engine/enginepb/mvcc.pb.cc
protos/cockroach/pkg/storage/engine/enginepb/rocksdb.pb.cc
protos/cockroach/pkg/util/hlc/legacy_timestamp.pb.cc
protos/cockroach/pkg/util/hlc/timestamp.pb.cc
protos/cockroach/pkg/util/unresolved_addr.pb.cc
)
Expand Down
3 changes: 0 additions & 3 deletions c-deps/libroach/protos/cockroach/pkg/roachpb/data.pb.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9d2b17e

Please sign in to comment.