From 23e4926ba683c012ad073fde5631d1b513e3b43b Mon Sep 17 00:00:00 2001 From: Jeffrey Xiao Date: Wed, 26 Jun 2019 16:31:09 -0400 Subject: [PATCH 1/2] roachpb: change RangeDescriptor.StickyBit to nullable Release note: None --- c-deps/libroach/protos/roachpb/metadata.pb.cc | 3 + c-deps/libroach/protos/roachpb/metadata.pb.h | 2 + pkg/kv/split_test.go | 4 +- pkg/roachpb/metadata.go | 9 + pkg/roachpb/metadata.pb.go | 251 +++++++++--------- pkg/roachpb/metadata.proto | 7 +- pkg/sql/crdb_internal.go | 4 +- pkg/sql/drop_index.go | 2 +- pkg/sql/drop_table.go | 2 +- pkg/sql/unsplit_test.go | 2 +- pkg/storage/batcheval/cmd_end_transaction.go | 2 +- pkg/storage/below_raft_protos_test.go | 4 +- pkg/storage/merge_queue.go | 2 +- pkg/storage/replica_command.go | 29 +- 14 files changed, 181 insertions(+), 142 deletions(-) diff --git a/c-deps/libroach/protos/roachpb/metadata.pb.cc b/c-deps/libroach/protos/roachpb/metadata.pb.cc index ed66189b8e32..0de88dc6bc69 100644 --- a/c-deps/libroach/protos/roachpb/metadata.pb.cc +++ b/c-deps/libroach/protos/roachpb/metadata.pb.cc @@ -1471,6 +1471,7 @@ bool RangeDescriptor::MergePartialFromCodedStream( break; } + // optional .cockroach.util.hlc.Timestamp sticky_bit = 7; case 7: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { @@ -1540,6 +1541,7 @@ void RangeDescriptor::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->generation(), output); } + // optional .cockroach.util.hlc.Timestamp sticky_bit = 7; if (cached_has_bits & 0x00000004u) { ::google::protobuf::internal::WireFormatLite::WriteMessage( 7, this->_internal_sticky_bit(), output); @@ -1579,6 +1581,7 @@ size_t RangeDescriptor::ByteSizeLong() const { this->end_key()); } + // optional .cockroach.util.hlc.Timestamp sticky_bit = 7; if (has_sticky_bit()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( diff --git a/c-deps/libroach/protos/roachpb/metadata.pb.h b/c-deps/libroach/protos/roachpb/metadata.pb.h index 436ccf97be0e..f38b83c8deff 100644 --- a/c-deps/libroach/protos/roachpb/metadata.pb.h +++ b/c-deps/libroach/protos/roachpb/metadata.pb.h @@ -762,6 +762,7 @@ class RangeDescriptor : public ::google::protobuf::MessageLite /* @@protoc_inser ::std::string* release_end_key(); void set_allocated_end_key(::std::string* end_key); + // optional .cockroach.util.hlc.Timestamp sticky_bit = 7; bool has_sticky_bit() const; void clear_sticky_bit(); static const int kStickyBitFieldNumber = 7; @@ -2719,6 +2720,7 @@ inline void RangeDescriptor::set_generation(::google::protobuf::int64 value) { // @@protoc_insertion_point(field_set:cockroach.roachpb.RangeDescriptor.generation) } +// optional .cockroach.util.hlc.Timestamp sticky_bit = 7; inline bool RangeDescriptor::has_sticky_bit() const { return (_has_bits_[0] & 0x00000004u) != 0; } diff --git a/pkg/kv/split_test.go b/pkg/kv/split_test.go index 2a393a35cba9..5380fc1e6b74 100644 --- a/pkg/kv/split_test.go +++ b/pkg/kv/split_test.go @@ -285,7 +285,7 @@ func TestRangeSplitsStickyBit(t *testing.T) { if err != nil { t.Fatal(err) } - if (desc.StickyBit == hlc.Timestamp{}) { + if (desc.GetStickyBit() == hlc.Timestamp{}) { t.Fatal("Sticky bit not set after splitting") } @@ -304,7 +304,7 @@ func TestRangeSplitsStickyBit(t *testing.T) { if err != nil { t.Fatal(err) } - if (desc.StickyBit == hlc.Timestamp{}) { + if (desc.GetStickyBit() == hlc.Timestamp{}) { t.Fatal("Sticky bit not set after splitting") } } diff --git a/pkg/roachpb/metadata.go b/pkg/roachpb/metadata.go index 5a6e410e69c4..24707aedd1b0 100644 --- a/pkg/roachpb/metadata.go +++ b/pkg/roachpb/metadata.go @@ -17,6 +17,7 @@ import ( "strconv" "strings" + "github.com/cockroachdb/cockroach/pkg/util/hlc" "github.com/cockroachdb/cockroach/pkg/util/humanizeutil" "github.com/gogo/protobuf/proto" "github.com/pkg/errors" @@ -197,6 +198,14 @@ func (r *RangeDescriptor) IncrementGeneration() { r.Generation = proto.Int64(r.GetGeneration() + 1) } +// GetStickyBit returns the sticky bit of this RangeDescriptor. +func (r RangeDescriptor) GetStickyBit() hlc.Timestamp { + if r.StickyBit == nil { + return hlc.Timestamp{} + } + return *r.StickyBit +} + // Validate performs some basic validation of the contents of a range descriptor. func (r RangeDescriptor) Validate() error { if r.NextReplicaID == 0 { diff --git a/pkg/roachpb/metadata.pb.go b/pkg/roachpb/metadata.pb.go index 2378add7eb97..1eba72656747 100644 --- a/pkg/roachpb/metadata.pb.go +++ b/pkg/roachpb/metadata.pb.go @@ -69,7 +69,7 @@ func (x *ReplicaType) UnmarshalJSON(data []byte) error { return nil } func (ReplicaType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{0} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{0} } // Attributes specifies a list of arbitrary strings describing @@ -81,7 +81,7 @@ type Attributes struct { func (m *Attributes) Reset() { *m = Attributes{} } func (*Attributes) ProtoMessage() {} func (*Attributes) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{0} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{0} } func (m *Attributes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -115,7 +115,7 @@ type ReplicationTarget struct { func (m *ReplicationTarget) Reset() { *m = ReplicationTarget{} } func (*ReplicationTarget) ProtoMessage() {} func (*ReplicationTarget) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{1} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{1} } func (m *ReplicationTarget) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -157,7 +157,7 @@ type ReplicaDescriptor struct { func (m *ReplicaDescriptor) Reset() { *m = ReplicaDescriptor{} } func (*ReplicaDescriptor) ProtoMessage() {} func (*ReplicaDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{2} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{2} } func (m *ReplicaDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -192,7 +192,7 @@ func (m *ReplicaIdent) Reset() { *m = ReplicaIdent{} } func (m *ReplicaIdent) String() string { return proto.CompactTextString(m) } func (*ReplicaIdent) ProtoMessage() {} func (*ReplicaIdent) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{3} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{3} } func (m *ReplicaIdent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -223,6 +223,8 @@ var xxx_messageInfo_ReplicaIdent proto.InternalMessageInfo // // NOTE: Care must be taken when changing the encoding of this proto // because it is used as part of conditional put operations. +// TODO(jeffreyxiao): All nullable fields in RangeDescriptor can be made +// non-nullable if #38302 is guaranteed to be on all nodes (I.E. 20.1). type RangeDescriptor struct { RangeID RangeID `protobuf:"varint,1,opt,name=range_id,json=rangeId,casttype=RangeID" json:"range_id"` // start_key is the first key which may be contained by this range. @@ -321,7 +323,8 @@ type RangeDescriptor struct { // that the unsplit operation is a different operation from the merge // operation. Unsplit only unsets sticky_bit. It is represented by a // timestamp that indicates when it expires. After the expiration time has - // passed, the split is eligible for automatic merging. + // passed, the split is eligible for automatic merging. A nil sticky bit is + // equivalent to hlc.Timestamp{}. // // The reason the sticky_bit exists is because when the merge queue is // enabled and a manual split happens, the split ranges would immediately be @@ -329,13 +332,13 @@ type RangeDescriptor struct { // attempted to execute ALTER TABLE/INDEX ... SPLIT AT ... when the merge // queue is enabled. With sticky_bit, users can manually split ranges without // diabling the merge queue. - StickyBit hlc.Timestamp `protobuf:"bytes,7,opt,name=sticky_bit,json=stickyBit" json:"sticky_bit"` + StickyBit *hlc.Timestamp `protobuf:"bytes,7,opt,name=sticky_bit,json=stickyBit" json:"sticky_bit,omitempty"` } func (m *RangeDescriptor) Reset() { *m = RangeDescriptor{} } func (*RangeDescriptor) ProtoMessage() {} func (*RangeDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{4} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{4} } func (m *RangeDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -374,7 +377,7 @@ type Percentiles struct { func (m *Percentiles) Reset() { *m = Percentiles{} } func (*Percentiles) ProtoMessage() {} func (*Percentiles) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{5} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{5} } func (m *Percentiles) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -436,7 +439,7 @@ type StoreCapacity struct { func (m *StoreCapacity) Reset() { *m = StoreCapacity{} } func (*StoreCapacity) ProtoMessage() {} func (*StoreCapacity) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{6} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{6} } func (m *StoreCapacity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -477,7 +480,7 @@ func (m *NodeDescriptor) Reset() { *m = NodeDescriptor{} } func (m *NodeDescriptor) String() string { return proto.CompactTextString(m) } func (*NodeDescriptor) ProtoMessage() {} func (*NodeDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{7} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{7} } func (m *NodeDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -513,7 +516,7 @@ func (m *LocalityAddress) Reset() { *m = LocalityAddress{} } func (m *LocalityAddress) String() string { return proto.CompactTextString(m) } func (*LocalityAddress) ProtoMessage() {} func (*LocalityAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{8} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{8} } func (m *LocalityAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -551,7 +554,7 @@ func (m *StoreDescriptor) Reset() { *m = StoreDescriptor{} } func (m *StoreDescriptor) String() string { return proto.CompactTextString(m) } func (*StoreDescriptor) ProtoMessage() {} func (*StoreDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{9} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{9} } func (m *StoreDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -588,7 +591,7 @@ func (m *StoreDeadReplicas) Reset() { *m = StoreDeadReplicas{} } func (m *StoreDeadReplicas) String() string { return proto.CompactTextString(m) } func (*StoreDeadReplicas) ProtoMessage() {} func (*StoreDeadReplicas) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{10} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{10} } func (m *StoreDeadReplicas) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -622,7 +625,7 @@ type Locality struct { func (m *Locality) Reset() { *m = Locality{} } func (*Locality) ProtoMessage() {} func (*Locality) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{11} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{11} } func (m *Locality) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -658,7 +661,7 @@ type Tier struct { func (m *Tier) Reset() { *m = Tier{} } func (*Tier) ProtoMessage() {} func (*Tier) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{12} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{12} } func (m *Tier) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -699,7 +702,7 @@ type Version struct { func (m *Version) Reset() { *m = Version{} } func (*Version) ProtoMessage() {} func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3d340bd94efebce4, []int{13} + return fileDescriptor_metadata_3ad995146fc3b33f, []int{13} } func (m *Version) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -849,7 +852,7 @@ func (this *RangeDescriptor) Equal(that interface{}) bool { } else if that1.Generation != nil { return false } - if !this.StickyBit.Equal(&that1.StickyBit) { + if !this.StickyBit.Equal(that1.StickyBit) { return false } return true @@ -1020,14 +1023,16 @@ func (m *RangeDescriptor) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintMetadata(dAtA, i, uint64(*m.Generation)) } - dAtA[i] = 0x3a - i++ - i = encodeVarintMetadata(dAtA, i, uint64(m.StickyBit.Size())) - n2, err := m.StickyBit.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.StickyBit != nil { + dAtA[i] = 0x3a + i++ + i = encodeVarintMetadata(dAtA, i, uint64(m.StickyBit.Size())) + n2, err := m.StickyBit.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 } - i += n2 return i, nil } @@ -1471,8 +1476,9 @@ func NewPopulatedRangeDescriptor(r randyMetadata, easy bool) *RangeDescriptor { } this.Generation = &v5 } - v6 := hlc.NewPopulatedTimestamp(r, easy) - this.StickyBit = *v6 + if r.Intn(10) != 0 { + this.StickyBit = hlc.NewPopulatedTimestamp(r, easy) + } if !easy && r.Intn(10) != 0 { } return this @@ -1497,9 +1503,9 @@ func randUTF8RuneMetadata(r randyMetadata) rune { return rune(ru + 61) } func randStringMetadata(r randyMetadata) string { - v7 := r.Intn(100) - tmps := make([]rune, v7) - for i := 0; i < v7; i++ { + v6 := r.Intn(100) + tmps := make([]rune, v6) + for i := 0; i < v6; i++ { tmps[i] = randUTF8RuneMetadata(r) } return string(tmps) @@ -1521,11 +1527,11 @@ func randFieldMetadata(dAtA []byte, r randyMetadata, fieldNumber int, wire int) switch wire { case 0: dAtA = encodeVarintPopulateMetadata(dAtA, uint64(key)) - v8 := r.Int63() + v7 := r.Int63() if r.Intn(2) == 0 { - v8 *= -1 + v7 *= -1 } - dAtA = encodeVarintPopulateMetadata(dAtA, uint64(v8)) + dAtA = encodeVarintPopulateMetadata(dAtA, uint64(v7)) case 1: dAtA = encodeVarintPopulateMetadata(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) @@ -1626,8 +1632,10 @@ func (m *RangeDescriptor) Size() (n int) { if m.Generation != nil { n += 1 + sovMetadata(uint64(*m.Generation)) } - l = m.StickyBit.Size() - n += 1 + l + sovMetadata(uint64(l)) + if m.StickyBit != nil { + l = m.StickyBit.Size() + n += 1 + l + sovMetadata(uint64(l)) + } return n } @@ -2391,6 +2399,9 @@ func (m *RangeDescriptor) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.StickyBit == nil { + m.StickyBit = &hlc.Timestamp{} + } if err := m.StickyBit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3835,89 +3846,89 @@ var ( ErrIntOverflowMetadata = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("roachpb/metadata.proto", fileDescriptor_metadata_3d340bd94efebce4) } - -var fileDescriptor_metadata_3d340bd94efebce4 = []byte{ - // 1288 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xf7, 0xc6, 0x76, 0x6c, 0xbf, 0x24, 0x4d, 0x3c, 0xfa, 0x7e, 0xcb, 0xca, 0x88, 0x75, 0xba, - 0x50, 0xa9, 0x2d, 0x28, 0x49, 0x83, 0xa2, 0xd2, 0xa0, 0x02, 0x71, 0x1b, 0xa4, 0xd0, 0x1f, 0x44, - 0x9b, 0x50, 0x24, 0x2e, 0xab, 0xc9, 0xee, 0xe0, 0x2c, 0xdd, 0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x1d, 0x1c, 0x26, 0x61, 0x66, 0xf5, 0xad, 0x97, 0x87, 0x34, 0xca, 0xb7, 0x0e, - 0xcc, 0x48, 0xdd, 0x9f, 0xab, 0x30, 0x8f, 0xae, 0x4b, 0x25, 0x39, 0x65, 0x40, 0xe7, 0xa1, 0x95, - 0x0b, 0xca, 0x85, 0x7f, 0x8f, 0x0d, 0x31, 0xa4, 0xd9, 0x5e, 0xf3, 0xf9, 0x51, 0xb7, 0xe6, 0xdd, - 0x64, 0x43, 0xaf, 0x89, 0xa6, 0x9b, 0x6c, 0x48, 0xce, 0x41, 0x83, 0x25, 0x21, 0x92, 0xaa, 0x27, - 0x48, 0xd3, 0x2c, 0x09, 0x25, 0xe5, 0x73, 0x68, 0x47, 0x89, 0x60, 0x3c, 0xa1, 0xb1, 0xaf, 0x03, - 0xcd, 0xed, 0xda, 0x62, 0xf5, 0x15, 0x0f, 0xb9, 0x60, 0x9c, 0x68, 0x42, 0x4e, 0x3e, 0x81, 0xf9, - 0x84, 0x3d, 0x10, 0x7e, 0xa9, 0x0f, 0xea, 0xd8, 0x07, 0xae, 0x3e, 0xe0, 0xdc, 0x1d, 0xf6, 0x40, - 0xbc, 0xa4, 0x17, 0xe6, 0x92, 0x92, 0x2d, 0x24, 0x0e, 0x40, 0x9f, 0x25, 0x8c, 0xe3, 0xb5, 0xb2, - 0xa7, 0x65, 0x9e, 0xbc, 0x12, 0x42, 0x7a, 0x00, 0xb9, 0x88, 0x82, 0x7b, 0x43, 0x7f, 0x2f, 0x12, - 0x76, 0x03, 0x4b, 0xf4, 0x46, 0x29, 0x7a, 0x39, 0x08, 0x96, 0xf6, 0xe3, 0x60, 0x69, 0xd7, 0x0c, - 0x02, 0x1d, 0x76, 0x4b, 0xc9, 0x7a, 0x91, 0x38, 0xd1, 0x39, 0x8f, 0x2c, 0x98, 0xd9, 0x66, 0x3c, - 0x60, 0x89, 0x88, 0x62, 0x96, 0x93, 0xb3, 0x50, 0xcd, 0x2e, 0xaf, 0x60, 0x89, 0x2c, 0xad, 0x95, - 0x00, 0xe2, 0xab, 0x6b, 0x58, 0x82, 0x11, 0xbe, 0xba, 0x86, 0xf8, 0xda, 0x0a, 0x66, 0x7d, 0x84, - 0xaf, 0x29, 0xfe, 0x95, 0x35, 0x6c, 0xec, 0x11, 0x7e, 0x45, 0xf1, 0xaf, 0xae, 0x60, 0x86, 0x46, - 0xf8, 0xd5, 0x15, 0x62, 0x43, 0x2d, 0xbb, 0x4d, 0x1f, 0xe0, 0x99, 0x8d, 0x01, 0x11, 0x3d, 0x72, - 0x9e, 0x57, 0x61, 0x0e, 0x6f, 0xdf, 0x75, 0x9a, 0xd1, 0x20, 0x12, 0x43, 0xb2, 0x08, 0xcd, 0x40, - 0x7f, 0xeb, 0x8e, 0x52, 0xaa, 0x02, 0x25, 0x2e, 0xb4, 0xe8, 0x21, 0x8d, 0x62, 0xba, 0x17, 0x33, - 0x8c, 0xdc, 0x50, 0x46, 0x30, 0x39, 0x0f, 0x33, 0xaa, 0x2f, 0x83, 0x74, 0x90, 0x08, 0x7d, 0x83, - 0x15, 0x0b, 0xd0, 0x70, 0x5d, 0xe2, 0x92, 0x16, 0x33, 0x9a, 0x1b, 0x5a, 0xad, 0x4c, 0x43, 0x83, - 0xa2, 0xad, 0x40, 0xfb, 0x3e, 0x8f, 0x04, 0xcb, 0xfd, 0x8c, 0x71, 0x3f, 0x67, 0x41, 0x9a, 0x84, - 0x63, 0x67, 0x9d, 0x57, 0xe6, 0x6d, 0xc6, 0x77, 0xd0, 0x48, 0xb6, 0xa1, 0xbd, 0x37, 0x34, 0x02, - 0x73, 0xf7, 0xa6, 0xb1, 0xb0, 0x93, 0xc6, 0x41, 0xa9, 0x54, 0xc6, 0x23, 0xca, 0xb7, 0x19, 0xd7, - 0x5d, 0x44, 0x3c, 0x20, 0xa5, 0x18, 0x8c, 0xcb, 0xc6, 0x2b, 0xb8, 0x5c, 0x28, 0x82, 0x34, 0x3e, - 0x6d, 0xa8, 0x0d, 0x72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0xd0, 0xaf, 0x52, 0xee, 0x1f, 0xd2, 0x58, 0xe7, 0x63, 0x4e, 0xe7, 0xa3, 0x7e, 0x5b, 0x1a, 0xbc, - 0x26, 0xda, 0xef, 0xd2, 0x18, 0xb9, 0x51, 0xa2, 0xb9, 0x53, 0x27, 0xb8, 0xd2, 0xe0, 0x35, 0xd1, - 0x2e, 0xb9, 0x1d, 0xa8, 0x67, 0x54, 0x04, 0xfb, 0x63, 0xfb, 0x49, 0x41, 0x72, 0x0f, 0x0e, 0x92, - 0x5c, 0xe0, 0x92, 0x2b, 0xef, 0xa5, 0x02, 0x55, 0x71, 0x5e, 0x3a, 0x0f, 0x33, 0xa5, 0xc7, 0x24, - 0x69, 0x41, 0xfd, 0xee, 0xa7, 0xbb, 0x9b, 0xde, 0x42, 0x85, 0xcc, 0x40, 0xe3, 0xd6, 0xe6, 0x86, - 0x77, 0x67, 0xd3, 0x5b, 0xb0, 0x7a, 0x17, 0x1f, 0xff, 0xe6, 0x54, 0x1e, 0x1f, 0x3b, 0xd6, 0x93, - 0x63, 0xc7, 0x7a, 0x7a, 0xec, 0x58, 0xbf, 0x1e, 0x3b, 0xd6, 0x0f, 0xcf, 0x9c, 0xca, 0x93, 0x67, - 0x4e, 0xe5, 0xe9, 0x33, 0xa7, 0xf2, 0x45, 0x43, 0xe7, 0xf4, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x0e, 0x4b, 0x3e, 0x51, 0xbf, 0x0c, 0x00, 0x00, +func init() { proto.RegisterFile("roachpb/metadata.proto", fileDescriptor_metadata_3ad995146fc3b33f) } + +var fileDescriptor_metadata_3ad995146fc3b33f = []byte{ + // 1284 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0xc6, 0x76, 0x6c, 0xbf, 0x24, 0x4d, 0x3c, 0x82, 0xb2, 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7, 0x92, + 0x7c, 0x37, 0x58, 0xa5, 0x4b, 0x21, 0x01, 0xd2, 0x81, 0xfa, 0x21, 0x8d, 0x07, 0x6a, 0x7f, 0x18, + 0x8b, 0x82, 0xb4, 0x87, 0x07, 0x16, 0x34, 0xcc, 0x05, 0xbb, 0x00, 0xad, 0x03, 0xfa, 0x75, 0xca, + 0xfd, 0x43, 0x1a, 0xeb, 0x7c, 0xcc, 0xe9, 0x7c, 0xd4, 0x6f, 0x4a, 0x83, 0xd7, 0x44, 0xfb, 0x6d, + 0x1a, 0x23, 0x37, 0x4a, 0x34, 0x77, 0xea, 0x04, 0x57, 0x1a, 0xbc, 0x26, 0xda, 0x25, 0xb7, 0x03, + 0xf5, 0x8c, 0x8a, 0x60, 0x7f, 0x6c, 0x3f, 0x29, 0x48, 0xee, 0xc1, 0x41, 0x92, 0x0b, 0x5c, 0x72, + 0xe5, 0xbd, 0x54, 0xa0, 0x2a, 0xce, 0x0b, 0x67, 0x61, 0xa6, 0xf4, 0x8c, 0x24, 0x2d, 0xa8, 0xdf, + 0xfe, 0x6c, 0x77, 0xd3, 0x5b, 0xa8, 0x90, 0x19, 0x68, 0xdc, 0xd8, 0xdc, 0xf0, 0x6e, 0x6d, 0x7a, + 0x0b, 0x56, 0xef, 0xfc, 0xc3, 0xdf, 0x9d, 0xca, 0xc3, 0x63, 0xc7, 0x7a, 0x74, 0xec, 0x58, 0x8f, + 0x8f, 0x1d, 0xeb, 0xb7, 0x63, 0xc7, 0xfa, 0xf1, 0x89, 0x53, 0x79, 0xf4, 0xc4, 0xa9, 0x3c, 0x7e, + 0xe2, 0x54, 0xbe, 0x6c, 0xe8, 0x9c, 0xfe, 0x15, 0x00, 0x00, 0xff, 0xff, 0x12, 0x45, 0xa8, 0xc7, + 0xb9, 0x0c, 0x00, 0x00, } diff --git a/pkg/roachpb/metadata.proto b/pkg/roachpb/metadata.proto index 2cda10f119d9..b7170ffa0f4e 100644 --- a/pkg/roachpb/metadata.proto +++ b/pkg/roachpb/metadata.proto @@ -86,6 +86,8 @@ message ReplicaIdent { // // NOTE: Care must be taken when changing the encoding of this proto // because it is used as part of conditional put operations. +// TODO(jeffreyxiao): All nullable fields in RangeDescriptor can be made +// non-nullable if #38302 is guaranteed to be on all nodes (I.E. 20.1). message RangeDescriptor { option (gogoproto.goproto_stringer) = false; option (gogoproto.equal) = true; @@ -193,7 +195,8 @@ message RangeDescriptor { // that the unsplit operation is a different operation from the merge // operation. Unsplit only unsets sticky_bit. It is represented by a // timestamp that indicates when it expires. After the expiration time has - // passed, the split is eligible for automatic merging. + // passed, the split is eligible for automatic merging. A nil sticky bit is + // equivalent to hlc.Timestamp{}. // // The reason the sticky_bit exists is because when the merge queue is // enabled and a manual split happens, the split ranges would immediately be @@ -201,7 +204,7 @@ message RangeDescriptor { // attempted to execute ALTER TABLE/INDEX ... SPLIT AT ... when the merge // queue is enabled. With sticky_bit, users can manually split ranges without // diabling the merge queue. - optional util.hlc.Timestamp sticky_bit = 7 [(gogoproto.nullable) = false]; + optional util.hlc.Timestamp sticky_bit = 7; } // Percentiles contains a handful of hard-coded percentiles meant to summarize diff --git a/pkg/sql/crdb_internal.go b/pkg/sql/crdb_internal.go index 29cf3bf98fc8..23ef138112cf 100644 --- a/pkg/sql/crdb_internal.go +++ b/pkg/sql/crdb_internal.go @@ -1795,8 +1795,8 @@ CREATE TABLE crdb_internal.ranges_no_leases ( } splitEnforcedUntil := tree.DNull - if (desc.StickyBit != hlc.Timestamp{}) { - splitEnforcedUntil = tree.TimestampToInexactDTimestamp(desc.StickyBit) + if (desc.GetStickyBit() != hlc.Timestamp{}) { + splitEnforcedUntil = tree.TimestampToInexactDTimestamp(*desc.StickyBit) } return tree.Datums{ diff --git a/pkg/sql/drop_index.go b/pkg/sql/drop_index.go index dd66301ffcf8..c5831cd2de2e 100644 --- a/pkg/sql/drop_index.go +++ b/pkg/sql/drop_index.go @@ -240,7 +240,7 @@ func (p *planner) dropIndexByName( // We have to explicitly check that the range descriptor's start key // lies within the span of the index since ScanMetaKVs returns all // intersecting spans. - if (desc.StickyBit != hlc.Timestamp{}) && span.Key.Compare(desc.StartKey.AsRawKey()) <= 0 { + if (desc.GetStickyBit() != hlc.Timestamp{}) && span.Key.Compare(desc.StartKey.AsRawKey()) <= 0 { // Swallow "key is not the start of a range" errors because it would // mean that the sticky bit was removed and merged concurrently. DROP // INDEX should not fail because of this. diff --git a/pkg/sql/drop_table.go b/pkg/sql/drop_table.go index 2f07d505058c..80c663e493f5 100644 --- a/pkg/sql/drop_table.go +++ b/pkg/sql/drop_table.go @@ -364,7 +364,7 @@ func (p *planner) initiateDropTable( if err := r.ValueProto(&desc); err != nil { return err } - if (desc.StickyBit != hlc.Timestamp{}) { + if (desc.GetStickyBit() != hlc.Timestamp{}) { // Swallow "key is not the start of a range" errors because it would mean // that the sticky bit was removed and merged concurrently. DROP TABLE // should not fail because of this. diff --git a/pkg/sql/unsplit_test.go b/pkg/sql/unsplit_test.go index df2a6c3810bf..c227b6c5183f 100644 --- a/pkg/sql/unsplit_test.go +++ b/pkg/sql/unsplit_test.go @@ -144,7 +144,7 @@ func TestUnsplitAt(t *testing.T) { if err != nil { t.Fatal(err) } - if (rng.StickyBit != hlc.Timestamp{}) { + if (rng.GetStickyBit() != hlc.Timestamp{}) { t.Fatalf("%s: expected range sticky bit to be hlc.MinTimestamp, got %s", tt.in, pretty) } } diff --git a/pkg/storage/batcheval/cmd_end_transaction.go b/pkg/storage/batcheval/cmd_end_transaction.go index 8c058d26ccb5..113ca47ef750 100644 --- a/pkg/storage/batcheval/cmd_end_transaction.go +++ b/pkg/storage/batcheval/cmd_end_transaction.go @@ -639,7 +639,7 @@ func RunCommitTrigger( } if sbt := ct.GetStickyBitTrigger(); sbt != nil { newDesc := *rec.Desc() - newDesc.StickyBit = sbt.StickyBit + newDesc.StickyBit = &sbt.StickyBit var res result.Result res.Replicated.State = &storagepb.ReplicaState{ Desc: &newDesc, diff --git a/pkg/storage/below_raft_protos_test.go b/pkg/storage/below_raft_protos_test.go index 62f16bd9bce4..bb4dd9a27cc7 100644 --- a/pkg/storage/below_raft_protos_test.go +++ b/pkg/storage/below_raft_protos_test.go @@ -95,8 +95,8 @@ var belowRaftGoldenProtos = map[reflect.Type]fixture{ populatedConstructor: func(r *rand.Rand) protoutil.Message { return roachpb.NewPopulatedRangeDescriptor(r, false) }, - emptySum: 13619898788881670775, - populatedSum: 2862604306108965308, + emptySum: 5524024218313206949, + populatedSum: 2157207031485627353, }, reflect.TypeOf(&storagepb.Liveness{}): { populatedConstructor: func(r *rand.Rand) protoutil.Message { diff --git a/pkg/storage/merge_queue.go b/pkg/storage/merge_queue.go index b9b78bb6dae4..33ec326b5bbf 100644 --- a/pkg/storage/merge_queue.go +++ b/pkg/storage/merge_queue.go @@ -289,7 +289,7 @@ func (mq *mergeQueue) process( // Range was manually split and not expired, so skip merging. now := mq.store.Clock().Now() - if now.Less(rhsDesc.StickyBit) { + if now.Less(rhsDesc.GetStickyBit()) { log.VEventf(ctx, 2, "skipping merge: ranges were manually split and sticky bit was not expired") // TODO(jeffreyxiao): Consider returning a purgatory error to avoid // repeatedly processing ranges that cannot be merged. diff --git a/pkg/storage/replica_command.go b/pkg/storage/replica_command.go index 5f8a660d2ece..88f06b2044ab 100644 --- a/pkg/storage/replica_command.go +++ b/pkg/storage/replica_command.go @@ -187,9 +187,9 @@ func (r *Replica) adminSplitWithDescriptor( log.Event(ctx, "range already split") // Even if the range is already split, we should still update the sticky // bit if it has a later expiration time. - if desc.StickyBit.Less(args.ExpirationTime) { + if desc.GetStickyBit().Less(args.ExpirationTime) { newDesc := *desc - newDesc.StickyBit = args.ExpirationTime + newDesc.StickyBit = &args.ExpirationTime err := r.store.DB().Txn(ctx, func(ctx context.Context, txn *client.Txn) error { dbDescValue, err := conditionalGetDescValueFromDB(ctx, txn, desc) if err != nil { @@ -237,8 +237,17 @@ func (r *Replica) adminSplitWithDescriptor( return reply, errors.Errorf("unable to allocate right hand side range descriptor: %s", err) } - // Set the range descriptor's sticky bit. - rightDesc.StickyBit = args.ExpirationTime + // TODO(jeffreyxiao): Remove this check in 20.1. + // Note that the client API for splitting has expiration time as + // non-nullable, but the internal representation of a sticky bit is nullable + // for backwards compatibility. If expiration time is the zero timestamp, we + // must be sure not to set the sticky bit to the zero timestamp because the + // byte representation of setting the stickyBit to nil is different than + // setting it to hlc.Timestamp{}. This check ensures that CPuts would not + // fail on older versions. + if (args.ExpirationTime != hlc.Timestamp{}) { + rightDesc.StickyBit = &args.ExpirationTime + } // Init updated version of existing range descriptor. leftDesc := *desc @@ -374,10 +383,12 @@ func (r *Replica) adminUnsplitWithDescriptor( return reply, errors.Errorf("key %s is not the start of a range", args.Header().Key) } - // If the range's sticky bit is already hlc.Timestamp{}, we treat the - // unsplit command as a no-op and return success instead of throwing an - // error. - if (desc.StickyBit == hlc.Timestamp{}) { + // If the range's sticky bit is already hlc.Timestamp{}, we treat the unsplit + // command as a no-op and return success instead of throwing an error. On + // mixed version clusters that don't support StickyBit, all range descriptor + // sticky bits are guaranteed to be nil, so we can skip checking the cluster + // version. + if (desc.GetStickyBit() == hlc.Timestamp{}) { return reply, nil } @@ -389,7 +400,7 @@ func (r *Replica) adminUnsplitWithDescriptor( b := txn.NewBatch() newDesc := *desc - newDesc.StickyBit = hlc.Timestamp{} + newDesc.StickyBit = &hlc.Timestamp{} descKey := keys.RangeDescriptorKey(newDesc.StartKey) if err := updateRangeDescriptor(b, descKey, dbDescValue, &newDesc); err != nil { return err From 76f5f1cee7a450aae22d1f9772a76709858cb6ac Mon Sep 17 00:00:00 2001 From: Jeffrey Xiao Date: Wed, 26 Jun 2019 18:23:43 -0400 Subject: [PATCH 2/2] roachpb: change ReplicaDescriptor.Type to nullable Release note: None --- c-deps/libroach/protos/roachpb/metadata.pb.cc | 3 + c-deps/libroach/protos/roachpb/metadata.pb.h | 2 + pkg/roachpb/metadata.go | 10 +- pkg/roachpb/metadata.pb.go | 271 ++++++++++-------- pkg/roachpb/metadata.proto | 7 +- pkg/roachpb/metadata_replicas.go | 8 +- pkg/roachpb/metadata_replicas_test.go | 27 +- pkg/storage/below_raft_protos_test.go | 2 +- pkg/storage/replica_test.go | 2 +- pkg/storage/stats_test.go | 2 +- 10 files changed, 188 insertions(+), 146 deletions(-) diff --git a/c-deps/libroach/protos/roachpb/metadata.pb.cc b/c-deps/libroach/protos/roachpb/metadata.pb.cc index 0de88dc6bc69..0768c0f4fcaf 100644 --- a/c-deps/libroach/protos/roachpb/metadata.pb.cc +++ b/c-deps/libroach/protos/roachpb/metadata.pb.cc @@ -878,6 +878,7 @@ bool ReplicaDescriptor::MergePartialFromCodedStream( break; } + // optional .cockroach.roachpb.ReplicaType type = 4; case 4: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { @@ -937,6 +938,7 @@ void ReplicaDescriptor::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->replica_id(), output); } + // optional .cockroach.roachpb.ReplicaType type = 4; if (cached_has_bits & 0x00000008u) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 4, this->type(), output); @@ -972,6 +974,7 @@ size_t ReplicaDescriptor::ByteSizeLong() const { this->replica_id()); } + // optional .cockroach.roachpb.ReplicaType type = 4; if (has_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); diff --git a/c-deps/libroach/protos/roachpb/metadata.pb.h b/c-deps/libroach/protos/roachpb/metadata.pb.h index f38b83c8deff..ee47daab75e2 100644 --- a/c-deps/libroach/protos/roachpb/metadata.pb.h +++ b/c-deps/libroach/protos/roachpb/metadata.pb.h @@ -478,6 +478,7 @@ class ReplicaDescriptor : public ::google::protobuf::MessageLite /* @@protoc_ins ::google::protobuf::int32 replica_id() const; void set_replica_id(::google::protobuf::int32 value); + // optional .cockroach.roachpb.ReplicaType type = 4; bool has_type() const; void clear_type(); static const int kTypeFieldNumber = 4; @@ -2379,6 +2380,7 @@ inline void ReplicaDescriptor::set_replica_id(::google::protobuf::int32 value) { // @@protoc_insertion_point(field_set:cockroach.roachpb.ReplicaDescriptor.replica_id) } +// optional .cockroach.roachpb.ReplicaType type = 4; inline bool ReplicaDescriptor::has_type() const { return (_has_bits_[0] & 0x00000008u) != 0; } diff --git a/pkg/roachpb/metadata.go b/pkg/roachpb/metadata.go index 24707aedd1b0..d7219876e491 100644 --- a/pkg/roachpb/metadata.go +++ b/pkg/roachpb/metadata.go @@ -266,7 +266,7 @@ func (r ReplicaDescriptor) String() string { } else { fmt.Fprintf(&buf, "%d", r.ReplicaID) } - if r.Type == ReplicaType_LEARNER { + if r.GetType() == ReplicaType_LEARNER { buf.WriteString("LEARNER") } return buf.String() @@ -286,6 +286,14 @@ func (r ReplicaDescriptor) Validate() error { return nil } +// GetType returns the type of this ReplicaDescriptor. +func (r ReplicaDescriptor) GetType() ReplicaType { + if r.Type == nil { + return ReplicaType_VOTER + } + return *r.Type +} + // PercentilesFromData derives percentiles from a slice of data points. // Sorts the input data if it isn't already sorted. func PercentilesFromData(data []float64) Percentiles { diff --git a/pkg/roachpb/metadata.pb.go b/pkg/roachpb/metadata.pb.go index 1eba72656747..1bab483d0869 100644 --- a/pkg/roachpb/metadata.pb.go +++ b/pkg/roachpb/metadata.pb.go @@ -69,7 +69,7 @@ func (x *ReplicaType) UnmarshalJSON(data []byte) error { return nil } func (ReplicaType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{0} + return fileDescriptor_metadata_3aeaf2848604e965, []int{0} } // Attributes specifies a list of arbitrary strings describing @@ -81,7 +81,7 @@ type Attributes struct { func (m *Attributes) Reset() { *m = Attributes{} } func (*Attributes) ProtoMessage() {} func (*Attributes) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{0} + return fileDescriptor_metadata_3aeaf2848604e965, []int{0} } func (m *Attributes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -115,7 +115,7 @@ type ReplicationTarget struct { func (m *ReplicationTarget) Reset() { *m = ReplicationTarget{} } func (*ReplicationTarget) ProtoMessage() {} func (*ReplicationTarget) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{1} + return fileDescriptor_metadata_3aeaf2848604e965, []int{1} } func (m *ReplicationTarget) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -143,6 +143,8 @@ var xxx_messageInfo_ReplicationTarget proto.InternalMessageInfo // ReplicaDescriptor describes a replica location by node ID // (corresponds to a host:port via lookup on gossip network) and store // ID (identifies the device). +// TODO(jeffreyxiao): All nullable fields in ReplicaDescriptor can be made +// non-nullable if #38302 is guaranteed to be on all nodes (I.E. 20.1). type ReplicaDescriptor struct { NodeID NodeID `protobuf:"varint,1,opt,name=node_id,json=nodeId,casttype=NodeID" json:"node_id"` StoreID StoreID `protobuf:"varint,2,opt,name=store_id,json=storeId,casttype=StoreID" json:"store_id"` @@ -150,14 +152,15 @@ type ReplicaDescriptor struct { // a store and then re-added to the same store, the new instance will have a // higher replica_id. ReplicaID ReplicaID `protobuf:"varint,3,opt,name=replica_id,json=replicaId,casttype=ReplicaID" json:"replica_id"` - // Type indicates which raft activities a replica participates in. - Type ReplicaType `protobuf:"varint,4,opt,name=type,enum=cockroach.roachpb.ReplicaType" json:"type"` + // Type indicates which raft activities a replica participates in. A nil type + // is equivalent to VOTER. + Type *ReplicaType `protobuf:"varint,4,opt,name=type,enum=cockroach.roachpb.ReplicaType" json:"type,omitempty"` } func (m *ReplicaDescriptor) Reset() { *m = ReplicaDescriptor{} } func (*ReplicaDescriptor) ProtoMessage() {} func (*ReplicaDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{2} + return fileDescriptor_metadata_3aeaf2848604e965, []int{2} } func (m *ReplicaDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -192,7 +195,7 @@ func (m *ReplicaIdent) Reset() { *m = ReplicaIdent{} } func (m *ReplicaIdent) String() string { return proto.CompactTextString(m) } func (*ReplicaIdent) ProtoMessage() {} func (*ReplicaIdent) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{3} + return fileDescriptor_metadata_3aeaf2848604e965, []int{3} } func (m *ReplicaIdent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -338,7 +341,7 @@ type RangeDescriptor struct { func (m *RangeDescriptor) Reset() { *m = RangeDescriptor{} } func (*RangeDescriptor) ProtoMessage() {} func (*RangeDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{4} + return fileDescriptor_metadata_3aeaf2848604e965, []int{4} } func (m *RangeDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -377,7 +380,7 @@ type Percentiles struct { func (m *Percentiles) Reset() { *m = Percentiles{} } func (*Percentiles) ProtoMessage() {} func (*Percentiles) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{5} + return fileDescriptor_metadata_3aeaf2848604e965, []int{5} } func (m *Percentiles) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -439,7 +442,7 @@ type StoreCapacity struct { func (m *StoreCapacity) Reset() { *m = StoreCapacity{} } func (*StoreCapacity) ProtoMessage() {} func (*StoreCapacity) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{6} + return fileDescriptor_metadata_3aeaf2848604e965, []int{6} } func (m *StoreCapacity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -480,7 +483,7 @@ func (m *NodeDescriptor) Reset() { *m = NodeDescriptor{} } func (m *NodeDescriptor) String() string { return proto.CompactTextString(m) } func (*NodeDescriptor) ProtoMessage() {} func (*NodeDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{7} + return fileDescriptor_metadata_3aeaf2848604e965, []int{7} } func (m *NodeDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -516,7 +519,7 @@ func (m *LocalityAddress) Reset() { *m = LocalityAddress{} } func (m *LocalityAddress) String() string { return proto.CompactTextString(m) } func (*LocalityAddress) ProtoMessage() {} func (*LocalityAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{8} + return fileDescriptor_metadata_3aeaf2848604e965, []int{8} } func (m *LocalityAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -554,7 +557,7 @@ func (m *StoreDescriptor) Reset() { *m = StoreDescriptor{} } func (m *StoreDescriptor) String() string { return proto.CompactTextString(m) } func (*StoreDescriptor) ProtoMessage() {} func (*StoreDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{9} + return fileDescriptor_metadata_3aeaf2848604e965, []int{9} } func (m *StoreDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -591,7 +594,7 @@ func (m *StoreDeadReplicas) Reset() { *m = StoreDeadReplicas{} } func (m *StoreDeadReplicas) String() string { return proto.CompactTextString(m) } func (*StoreDeadReplicas) ProtoMessage() {} func (*StoreDeadReplicas) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{10} + return fileDescriptor_metadata_3aeaf2848604e965, []int{10} } func (m *StoreDeadReplicas) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -625,7 +628,7 @@ type Locality struct { func (m *Locality) Reset() { *m = Locality{} } func (*Locality) ProtoMessage() {} func (*Locality) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{11} + return fileDescriptor_metadata_3aeaf2848604e965, []int{11} } func (m *Locality) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -661,7 +664,7 @@ type Tier struct { func (m *Tier) Reset() { *m = Tier{} } func (*Tier) ProtoMessage() {} func (*Tier) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{12} + return fileDescriptor_metadata_3aeaf2848604e965, []int{12} } func (m *Tier) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -702,7 +705,7 @@ type Version struct { func (m *Version) Reset() { *m = Version{} } func (*Version) ProtoMessage() {} func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_3ad995146fc3b33f, []int{13} + return fileDescriptor_metadata_3aeaf2848604e965, []int{13} } func (m *Version) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -799,7 +802,13 @@ func (this *ReplicaDescriptor) Equal(that interface{}) bool { if this.ReplicaID != that1.ReplicaID { return false } - if this.Type != that1.Type { + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { return false } return true @@ -938,9 +947,11 @@ func (m *ReplicaDescriptor) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x18 i++ i = encodeVarintMetadata(dAtA, i, uint64(m.ReplicaID)) - dAtA[i] = 0x20 - i++ - i = encodeVarintMetadata(dAtA, i, uint64(m.Type)) + if m.Type != nil { + dAtA[i] = 0x20 + i++ + i = encodeVarintMetadata(dAtA, i, uint64(*m.Type)) + } return i, nil } @@ -1431,7 +1442,10 @@ func NewPopulatedReplicaDescriptor(r randyMetadata, easy bool) *ReplicaDescripto if r.Intn(2) == 0 { this.ReplicaID *= -1 } - this.Type = ReplicaType([]int32{0, 1}[r.Intn(2)]) + if r.Intn(10) != 0 { + v1 := ReplicaType([]int32{0, 1}[r.Intn(2)]) + this.Type = &v1 + } if !easy && r.Intn(10) != 0 { } return this @@ -1444,25 +1458,25 @@ func NewPopulatedRangeDescriptor(r randyMetadata, easy bool) *RangeDescriptor { this.RangeID *= -1 } if r.Intn(10) != 0 { - v1 := r.Intn(100) - this.StartKey = make(RKey, v1) - for i := 0; i < v1; i++ { + v2 := r.Intn(100) + this.StartKey = make(RKey, v2) + for i := 0; i < v2; i++ { this.StartKey[i] = byte(r.Intn(256)) } } if r.Intn(10) != 0 { - v2 := r.Intn(100) - this.EndKey = make(RKey, v2) - for i := 0; i < v2; i++ { + v3 := r.Intn(100) + this.EndKey = make(RKey, v3) + for i := 0; i < v3; i++ { this.EndKey[i] = byte(r.Intn(256)) } } if r.Intn(10) != 0 { - v3 := r.Intn(5) - this.InternalReplicas = make([]ReplicaDescriptor, v3) - for i := 0; i < v3; i++ { - v4 := NewPopulatedReplicaDescriptor(r, easy) - this.InternalReplicas[i] = *v4 + v4 := r.Intn(5) + this.InternalReplicas = make([]ReplicaDescriptor, v4) + for i := 0; i < v4; i++ { + v5 := NewPopulatedReplicaDescriptor(r, easy) + this.InternalReplicas[i] = *v5 } } this.NextReplicaID = ReplicaID(r.Int31()) @@ -1470,11 +1484,11 @@ func NewPopulatedRangeDescriptor(r randyMetadata, easy bool) *RangeDescriptor { this.NextReplicaID *= -1 } if r.Intn(10) != 0 { - v5 := int64(r.Int63()) + v6 := int64(r.Int63()) if r.Intn(2) == 0 { - v5 *= -1 + v6 *= -1 } - this.Generation = &v5 + this.Generation = &v6 } if r.Intn(10) != 0 { this.StickyBit = hlc.NewPopulatedTimestamp(r, easy) @@ -1503,9 +1517,9 @@ func randUTF8RuneMetadata(r randyMetadata) rune { return rune(ru + 61) } func randStringMetadata(r randyMetadata) string { - v6 := r.Intn(100) - tmps := make([]rune, v6) - for i := 0; i < v6; i++ { + v7 := r.Intn(100) + tmps := make([]rune, v7) + for i := 0; i < v7; i++ { tmps[i] = randUTF8RuneMetadata(r) } return string(tmps) @@ -1527,11 +1541,11 @@ func randFieldMetadata(dAtA []byte, r randyMetadata, fieldNumber int, wire int) switch wire { case 0: dAtA = encodeVarintPopulateMetadata(dAtA, uint64(key)) - v7 := r.Int63() + v8 := r.Int63() if r.Intn(2) == 0 { - v7 *= -1 + v8 *= -1 } - dAtA = encodeVarintPopulateMetadata(dAtA, uint64(v7)) + dAtA = encodeVarintPopulateMetadata(dAtA, uint64(v8)) case 1: dAtA = encodeVarintPopulateMetadata(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) @@ -1591,7 +1605,9 @@ func (m *ReplicaDescriptor) Size() (n int) { n += 1 + sovMetadata(uint64(m.NodeID)) n += 1 + sovMetadata(uint64(m.StoreID)) n += 1 + sovMetadata(uint64(m.ReplicaID)) - n += 1 + sovMetadata(uint64(m.Type)) + if m.Type != nil { + n += 1 + sovMetadata(uint64(*m.Type)) + } return n } @@ -2058,7 +2074,7 @@ func (m *ReplicaDescriptor) Unmarshal(dAtA []byte) error { if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } - m.Type = 0 + var v ReplicaType for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetadata @@ -2068,11 +2084,12 @@ func (m *ReplicaDescriptor) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Type |= (ReplicaType(b) & 0x7F) << shift + v |= (ReplicaType(b) & 0x7F) << shift if b < 0x80 { break } } + m.Type = &v default: iNdEx = preIndex skippy, err := skipMetadata(dAtA[iNdEx:]) @@ -3846,89 +3863,89 @@ var ( ErrIntOverflowMetadata = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("roachpb/metadata.proto", fileDescriptor_metadata_3ad995146fc3b33f) } +func init() { proto.RegisterFile("roachpb/metadata.proto", fileDescriptor_metadata_3aeaf2848604e965) } -var fileDescriptor_metadata_3ad995146fc3b33f = []byte{ - // 1284 bytes of a gzipped FileDescriptorProto +var fileDescriptor_metadata_3aeaf2848604e965 = []byte{ + // 1283 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0x45, 0x14, 0xf6, 0xc6, 0x76, 0x6c, 0xbf, 0x24, 0x4d, 0x3c, 0x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9, 0x69, 0xa8, 0x66, 0x17, 0x57, 0xb0, 0x38, 0x96, 0x3e, 0xac, 0x04, 0x10, 0x5f, 0x5d, 0xc3, + 0xe4, 0x8f, 0xf0, 0xd5, 0x35, 0xc4, 0xd7, 0x56, 0x30, 0xdf, 0x23, 0x7c, 0x4d, 0xf1, 0x2f, 0xad, + 0x61, 0x33, 0x8f, 0xf0, 0x4b, 0x8a, 0x7f, 0x79, 0x05, 0x73, 0x33, 0xc2, 0x2f, 0xaf, 0x10, 0x1b, + 0x6a, 0xd9, 0x4d, 0x7a, 0x0f, 0x4f, 0x6b, 0x0c, 0x88, 0xe8, 0x31, 0xf3, 0xb4, 0x0a, 0x73, 0x78, + 0xe3, 0xae, 0xd2, 0x8c, 0x06, 0x91, 0x18, 0x92, 0x45, 0x68, 0x06, 0xfa, 0x5b, 0xf7, 0x92, 0x52, + 0x15, 0x28, 0x71, 0xa1, 0x45, 0x0f, 0x69, 0x14, 0xd3, 0xbd, 0x98, 0x61, 0xe4, 0x86, 0x32, 0x82, + 0xc9, 0x59, 0x98, 0x51, 0x1d, 0x19, 0xa4, 0x83, 0x44, 0xe8, 0x5b, 0xab, 0x58, 0x80, 0x86, 0xab, + 0x12, 0x97, 0xb4, 0x98, 0xd1, 0xdc, 0xd0, 0x6a, 0x65, 0x1a, 0x1a, 0x14, 0x6d, 0x05, 0xda, 0x77, + 0x79, 0x24, 0x58, 0xee, 0x67, 0x8c, 0xfb, 0x39, 0x0b, 0xd2, 0x24, 0x1c, 0x3b, 0xeb, 0xbc, 0x32, + 0x6f, 0x33, 0xbe, 0x83, 0x46, 0xb2, 0x0d, 0xed, 0xbd, 0xa1, 0x11, 0x98, 0x5b, 0x37, 0x8d, 0x25, + 0x9d, 0x34, 0x02, 0x4a, 0xa5, 0x32, 0x1e, 0x51, 0xbe, 0xcd, 0xb8, 0xee, 0x1f, 0xe2, 0x01, 0x29, + 0xc5, 0x60, 0x5c, 0x36, 0x5e, 0xc0, 0xe5, 0x42, 0x11, 0xa4, 0xf1, 0x69, 0x43, 0x6d, 0x90, 0xb3, + 0xd0, 0x6e, 0x96, 0x92, 0x88, 0x08, 0x39, 0x0f, 0x73, 0x71, 0xda, 0x8f, 0x02, 0x1a, 0xfb, 0x18, + 0x88, 0xdd, 0x2a, 0x51, 0x66, 0xb5, 0xa9, 0x27, 0x2d, 0x64, 0x15, 0xc8, 0xd7, 0x03, 0xc6, 0xa3, + 0xf1, 0xec, 0x40, 0x29, 0x3b, 0x0b, 0xda, 0x5e, 0xa4, 0x47, 0x17, 0xff, 0xb8, 0x0a, 0xa7, 0xe4, + 0x8c, 0xfe, 0x6f, 0x63, 0xfd, 0x03, 0x68, 0xc8, 0x45, 0xc9, 0xf2, 0x5c, 0x8f, 0x35, 0xe7, 0xe4, + 0x9d, 0xf9, 0xac, 0x58, 0xa9, 0x1b, 0x61, 0x58, 0x0c, 0x34, 0x2d, 0x22, 0x97, 0xcd, 0x72, 0xac, + 0x3e, 0x73, 0xe3, 0x4c, 0x2e, 0x47, 0xab, 0x54, 0x8b, 0x95, 0x82, 0x5c, 0x81, 0x66, 0x9c, 0x06, + 0x34, 0x96, 0xbd, 0x5a, 0x43, 0xf5, 0xeb, 0x13, 0xd4, 0x37, 0x34, 0xc5, 0x34, 0xb2, 0x91, 0x90, + 0x8f, 0x61, 0x6e, 0x87, 0xf1, 0x43, 0xc6, 0x6f, 0x33, 0x9e, 0xcb, 0x99, 0x50, 0x47, 0x1f, 0x9d, + 0x09, 0x3e, 0x34, 0x43, 0xbb, 0x18, 0x97, 0x91, 0x33, 0xd0, 0xda, 0x1b, 0x44, 0x71, 0xe8, 0x0b, + 0xda, 0xc7, 0x26, 0x6b, 0x99, 0xbf, 0x42, 0x78, 0x97, 0xf6, 0xc9, 0x9b, 0x72, 0xb6, 0x50, 0x2e, + 0xe4, 0xab, 0x42, 0xcd, 0x96, 0xe2, 0xd2, 0x68, 0x7c, 0x43, 0x90, 0x1d, 0x58, 0x30, 0xb1, 0xf9, + 0x26,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x98, 0x0b, 0x76, 0x01, 0x5a, 0x07, 0xf4, 0xab, 0x94, 0xfb, + 0x87, 0x34, 0xd6, 0xf9, 0x98, 0xd3, 0xf9, 0xa8, 0xdf, 0x94, 0x06, 0xaf, 0x89, 0xf6, 0xdb, 0x34, + 0x46, 0x6e, 0x94, 0x68, 0xee, 0xd4, 0x09, 0xae, 0x34, 0x78, 0x4d, 0xb4, 0x4b, 0x6e, 0x07, 0xea, + 0x19, 0x15, 0xc1, 0xfe, 0xd8, 0x7e, 0x52, 0x90, 0xdc, 0x83, 0x83, 0x24, 0x17, 0xb8, 0xe4, 0xca, + 0x7b, 0xa9, 0x40, 0x55, 0x9c, 0x17, 0xce, 0xc2, 0x4c, 0xe9, 0x01, 0x49, 0x5a, 0x50, 0xbf, 0xfd, + 0xe9, 0xee, 0xa6, 0xb7, 0x50, 0x21, 0x33, 0xd0, 0xb8, 0xb1, 0xb9, 0xe1, 0xdd, 0xda, 0xf4, 0x16, + 0xac, 0xde, 0xf9, 0x87, 0xbf, 0x39, 0x95, 0x87, 0xc7, 0x8e, 0xf5, 0xe8, 0xd8, 0xb1, 0x1e, 0x1f, + 0x3b, 0xd6, 0xaf, 0xc7, 0x8e, 0xf5, 0xc3, 0x13, 0xa7, 0xf2, 0xe8, 0x89, 0x53, 0x79, 0xfc, 0xc4, + 0xa9, 0x7c, 0xd1, 0xd0, 0x39, 0xfd, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x5b, 0xbc, 0x07, 0xb3, + 0x0c, 0x00, 0x00, } diff --git a/pkg/roachpb/metadata.proto b/pkg/roachpb/metadata.proto index b7170ffa0f4e..dfaf0a088125 100644 --- a/pkg/roachpb/metadata.proto +++ b/pkg/roachpb/metadata.proto @@ -53,6 +53,8 @@ enum ReplicaType { // ReplicaDescriptor describes a replica location by node ID // (corresponds to a host:port via lookup on gossip network) and store // ID (identifies the device). +// TODO(jeffreyxiao): All nullable fields in ReplicaDescriptor can be made +// non-nullable if #38302 is guaranteed to be on all nodes (I.E. 20.1). message ReplicaDescriptor { option (gogoproto.goproto_stringer) = false; option (gogoproto.equal) = true; @@ -69,8 +71,9 @@ message ReplicaDescriptor { optional int32 replica_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "ReplicaID", (gogoproto.casttype) = "ReplicaID"]; - // Type indicates which raft activities a replica participates in. - optional ReplicaType type = 4 [(gogoproto.nullable) = false]; + // Type indicates which raft activities a replica participates in. A nil type + // is equivalent to VOTER. + optional ReplicaType type = 4; } // ReplicaIdent uniquely identifies a specific replica. diff --git a/pkg/roachpb/metadata_replicas.go b/pkg/roachpb/metadata_replicas.go index 97f376b7b236..1430e12fc8b1 100644 --- a/pkg/roachpb/metadata_replicas.go +++ b/pkg/roachpb/metadata_replicas.go @@ -46,7 +46,7 @@ func (d ReplicaDescriptors) All() []ReplicaDescriptor { func (d ReplicaDescriptors) Voters() []ReplicaDescriptor { // Note that the wrapped replicas are sorted first by type. for i := range d.wrapped { - if d.wrapped[i].Type == ReplicaType_LEARNER { + if d.wrapped[i].GetType() == ReplicaType_LEARNER { return d.wrapped[:i] } } @@ -57,7 +57,7 @@ func (d ReplicaDescriptors) Voters() []ReplicaDescriptor { func (d ReplicaDescriptors) Learners() []ReplicaDescriptor { // Note that the wrapped replicas are sorted first by type. for i := range d.wrapped { - if d.wrapped[i].Type == ReplicaType_LEARNER { + if d.wrapped[i].GetType() == ReplicaType_LEARNER { return d.wrapped[i:] } } @@ -122,8 +122,8 @@ type byTypeThenReplicaID []ReplicaDescriptor func (x byTypeThenReplicaID) Len() int { return len(x) } func (x byTypeThenReplicaID) Swap(i, j int) { x[i], x[j] = x[j], x[i] } func (x byTypeThenReplicaID) Less(i, j int) bool { - if x[i].Type == x[j].Type { + if x[i].GetType() == x[j].GetType() { return x[i].ReplicaID < x[j].ReplicaID } - return x[i].Type < x[j].Type + return x[i].GetType() < x[j].GetType() } diff --git a/pkg/roachpb/metadata_replicas_test.go b/pkg/roachpb/metadata_replicas_test.go index a75537db4e50..60f96e9b06a6 100644 --- a/pkg/roachpb/metadata_replicas_test.go +++ b/pkg/roachpb/metadata_replicas_test.go @@ -16,21 +16,30 @@ import ( "github.com/stretchr/testify/assert" ) +func newReplicaType(t ReplicaType) *ReplicaType { + return &t +} + func TestVotersLearnersAll(t *testing.T) { + voter := newReplicaType(ReplicaType_VOTER) + learner := newReplicaType(ReplicaType_LEARNER) tests := [][]ReplicaDescriptor{ {}, - {{Type: ReplicaType_VOTER}}, - {{Type: ReplicaType_LEARNER}}, - {{Type: ReplicaType_VOTER}, {Type: ReplicaType_LEARNER}, {Type: ReplicaType_VOTER}}, - {{Type: ReplicaType_LEARNER}, {Type: ReplicaType_VOTER}, {Type: ReplicaType_LEARNER}}, + {{Type: voter}}, + {{Type: nil}}, + {{Type: learner}}, + {{Type: voter}, {Type: learner}, {Type: voter}}, + {{Type: nil}, {Type: learner}, {Type: nil}}, + {{Type: learner}, {Type: voter}, {Type: learner}}, + {{Type: learner}, {Type: nil}, {Type: learner}}, } for i, test := range tests { r := MakeReplicaDescriptors(test) for _, voter := range r.Voters() { - assert.Equal(t, ReplicaType_VOTER, voter.Type, "testcase %d", i) + assert.Equal(t, ReplicaType_VOTER, voter.GetType(), "testcase %d", i) } for _, learner := range r.Learners() { - assert.Equal(t, ReplicaType_LEARNER, learner.Type, "testcase %d", i) + assert.Equal(t, ReplicaType_LEARNER, learner.GetType(), "testcase %d", i) } assert.Equal(t, len(test), len(r.All()), "testcase %d", i) } @@ -62,7 +71,7 @@ func TestReplicaDescriptorsRemove(t *testing.T) { {NodeID: 1, StoreID: 1}, {NodeID: 2, StoreID: 2}, {NodeID: 3, StoreID: 3}, - {NodeID: 4, StoreID: 4, Type: ReplicaType_LEARNER}, + {NodeID: 4, StoreID: 4, Type: newReplicaType(ReplicaType_LEARNER)}, }, remove: ReplicationTarget{NodeID: 2, StoreID: 2}, expected: true, @@ -81,10 +90,10 @@ func TestReplicaDescriptorsRemove(t *testing.T) { assert.Equal(t, lenBefore, len(r.All()), "testcase %d", i) } for _, voter := range r.Voters() { - assert.Equal(t, ReplicaType_VOTER, voter.Type, "testcase %d", i) + assert.Equal(t, ReplicaType_VOTER, voter.GetType(), "testcase %d", i) } for _, learner := range r.Learners() { - assert.Equal(t, ReplicaType_LEARNER, learner.Type, "testcase %d", i) + assert.Equal(t, ReplicaType_LEARNER, learner.GetType(), "testcase %d", i) } } } diff --git a/pkg/storage/below_raft_protos_test.go b/pkg/storage/below_raft_protos_test.go index bb4dd9a27cc7..8f45f87ad0a3 100644 --- a/pkg/storage/below_raft_protos_test.go +++ b/pkg/storage/below_raft_protos_test.go @@ -96,7 +96,7 @@ var belowRaftGoldenProtos = map[reflect.Type]fixture{ return roachpb.NewPopulatedRangeDescriptor(r, false) }, emptySum: 5524024218313206949, - populatedSum: 2157207031485627353, + populatedSum: 1236094298358011270, }, reflect.TypeOf(&storagepb.Liveness{}): { populatedConstructor: func(r *rand.Rand) protoutil.Message { diff --git a/pkg/storage/replica_test.go b/pkg/storage/replica_test.go index abedb4a6391c..f653dad2a554 100644 --- a/pkg/storage/replica_test.go +++ b/pkg/storage/replica_test.go @@ -6401,7 +6401,7 @@ func TestProposalOverhead(t *testing.T) { // changes. Try to make this number go down and not up. It slightly // undercounts because our proposal filter is called before // maxLeaseIndex is filled in. - const expectedOverhead = 52 + const expectedOverhead = 50 if v := atomic.LoadUint32(&overhead); expectedOverhead != v { t.Fatalf("expected overhead of %d, but found %d", expectedOverhead, v) } diff --git a/pkg/storage/stats_test.go b/pkg/storage/stats_test.go index def364025148..e074d57d6ad2 100644 --- a/pkg/storage/stats_test.go +++ b/pkg/storage/stats_test.go @@ -27,7 +27,7 @@ import ( // writeInitialState(). func initialStats() enginepb.MVCCStats { return enginepb.MVCCStats{ - SysBytes: 100, + SysBytes: 98, SysCount: 3, } }