Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
132331: raft: move StateType from raft into raftpb r=arulajmani a=arulajmani

We'll need this to avoid a circular dependency when we use StateType in the FortificationTracker.

Epic: none

Release note: None

132337: go.mod: bump Pebble to 999b65aeb052 r=aadityasondhi a=itsbilal

Changes:

 * [`999b65ae`](cockroachdb/pebble@999b65ae) db: grab version ref before delete-only compaction
 * [`6d160732`](cockroachdb/pebble@6d160732) sstable: remove block transforms
 * [`9fec6763`](cockroachdb/pebble@9fec6763) clblk: rename more "reader"s to "decoder"s
 * [`7e4728b5`](cockroachdb/pebble@7e4728b5) colblk: implement transforms for IndexIter
 * [`bdffe815`](cockroachdb/pebble@bdffe815) lint: stop test when go vet fails (take two)

Fixes cockroachdb#132289.

Release note: none.
Epic: none.

Co-authored-by: Arul Ajmani <[email protected]>
Co-authored-by: Bilal Akhtar <[email protected]>
  • Loading branch information
3 people committed Oct 10, 2024
3 parents a69a2f3 + 0286472 + 2d7a421 commit 0eeda76
Show file tree
Hide file tree
Showing 47 changed files with 522 additions and 515 deletions.
6 changes: 3 additions & 3 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1848,10 +1848,10 @@ def go_deps():
patches = [
"@com_github_cockroachdb_cockroach//build/patches:com_github_cockroachdb_pebble.patch",
],
sha256 = "351c91780d5286492dcacf4650c8bb6f22b4025d7b8746398fd59e8cc1c2ce19",
strip_prefix = "github.com/cockroachdb/[email protected]20241009161816-27acbe1d595c",
sha256 = "5eb8f4505cad0dc2c6d03e1cc70481f37ffdeaa6dc8d9ab95f1d3d6a4f9043ae",
strip_prefix = "github.com/cockroachdb/[email protected]20241010181228-999b65aeb052",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20241009161816-27acbe1d595c.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20241010181228-999b65aeb052.zip",
],
)
go_repository(
Expand Down
2 changes: 1 addition & 1 deletion build/bazelutil/distdir_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ DISTDIR_FILES = {
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/gostdlib/com_github_cockroachdb_gostdlib-v1.19.0.zip": "c4d516bcfe8c07b6fc09b8a9a07a95065b36c2855627cb3514e40c98f872b69e",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/logtags/com_github_cockroachdb_logtags-v0.0.0-20230118201751-21c54148d20b.zip": "ca7776f47e5fecb4c495490a679036bfc29d95bd7625290cfdb9abb0baf97476",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/metamorphic/com_github_cockroachdb_metamorphic-v0.0.0-20231108215700-4ba948b56895.zip": "28c8cf42192951b69378cf537be5a9a43f2aeb35542908cc4fe5f689505853ea",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20241009161816-27acbe1d595c.zip": "351c91780d5286492dcacf4650c8bb6f22b4025d7b8746398fd59e8cc1c2ce19",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20241010181228-999b65aeb052.zip": "5eb8f4505cad0dc2c6d03e1cc70481f37ffdeaa6dc8d9ab95f1d3d6a4f9043ae",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/redact/com_github_cockroachdb_redact-v1.1.5.zip": "11b30528eb0dafc8bc1a5ba39d81277c257cbe6946a7564402f588357c164560",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/returncheck/com_github_cockroachdb_returncheck-v0.0.0-20200612231554-92cdbca611dd.zip": "ce92ba4352deec995b1f2eecf16eba7f5d51f5aa245a1c362dfe24c83d31f82b",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/stress/com_github_cockroachdb_stress-v0.0.0-20220803192808-1806698b1b7b.zip": "3fda531795c600daf25532a4f98be2a1335cd1e5e182c72789bca79f5f69fcc1",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ require (
github.com/cockroachdb/go-test-teamcity v0.0.0-20191211140407-cff980ad0a55
github.com/cockroachdb/gostdlib v1.19.0
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b
github.com/cockroachdb/pebble v0.0.0-20241009161816-27acbe1d595c
github.com/cockroachdb/pebble v0.0.0-20241010181228-999b65aeb052
github.com/cockroachdb/redact v1.1.5
github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd
github.com/cockroachdb/stress v0.0.0-20220803192808-1806698b1b7b
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZe
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs=
github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA=
github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA=
github.com/cockroachdb/pebble v0.0.0-20241009161816-27acbe1d595c h1:edD1NGhLbe8DVAJMoENuqwvGqzldA8RBHpj+xOC7ZSc=
github.com/cockroachdb/pebble v0.0.0-20241009161816-27acbe1d595c/go.mod h1:LaF8D6p4Ko4EWprBmrcDs7FrmZYgDExF7dJyPvbq3Y4=
github.com/cockroachdb/pebble v0.0.0-20241010181228-999b65aeb052 h1:10h2ebkMyhkEjAC18p1kg5YHa8DHJy3vzhxDBgcINuY=
github.com/cockroachdb/pebble v0.0.0-20241010181228-999b65aeb052/go.mod h1:LaF8D6p4Ko4EWprBmrcDs7FrmZYgDExF7dJyPvbq3Y4=
github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30=
github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvclient/kvcoord/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ go_test(
"//pkg/kv/kvserver/tscache",
"//pkg/kv/kvserver/txnwait",
"//pkg/multitenant/tenantcapabilities/tenantcapabilitiesauthorizer",
"//pkg/raft",
"//pkg/raft/raftpb",
"//pkg/roachpb",
"//pkg/rpc",
"//pkg/rpc/nodedialer",
Expand Down
4 changes: 2 additions & 2 deletions pkg/kv/kvclient/kvcoord/dist_sender_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/closedts"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/isolation"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvserverbase"
"github.com/cockroachdb/cockroach/pkg/raft"
"github.com/cockroachdb/cockroach/pkg/raft/raftpb"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/rpc"
"github.com/cockroachdb/cockroach/pkg/rpc/nodedialer"
Expand Down Expand Up @@ -4771,7 +4771,7 @@ func TestPartialPartition(t *testing.T) {
store, err := sl.GetStores().(*kvserver.Stores).GetStore(sl.GetFirstStoreID())
require.NoError(t, err)
status := store.LookupReplica(roachpb.RKey(scratchKey)).RaftStatus()
if status == nil || status.RaftState != raft.StateLeader {
if status == nil || status.RaftState != raftpb.StateLeader {
return errors.Newf("Leader leaseholder split %v", status)
}
return nil
Expand Down
8 changes: 4 additions & 4 deletions pkg/kv/kvserver/allocator/allocatorimpl/allocator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ func (r *mockRepl) RaftStatus() *raft.Status {
raftStatus := &raft.Status{
Progress: make(map[raftpb.PeerID]tracker.Progress),
}
raftStatus.RaftState = raft.StateLeader
raftStatus.RaftState = raftpb.StateLeader
for i := int32(1); i <= r.replicationFactor; i++ {
state := tracker.StateReplicate
if _, ok := r.replsInNeedOfSnapshot[roachpb.ReplicaID(i)]; ok {
Expand Down Expand Up @@ -8290,7 +8290,7 @@ func TestFilterBehindReplicas(t *testing.T) {
Progress: make(map[raftpb.PeerID]tracker.Progress),
}
status.Lead = c.leader
status.RaftState = raft.StateLeader
status.RaftState = raftpb.StateLeader
status.Commit = c.commit
var replicas []roachpb.ReplicaDescriptor
for j, v := range c.progress {
Expand Down Expand Up @@ -8363,7 +8363,7 @@ func TestFilterUnremovableReplicas(t *testing.T) {
// Use an invalid replica ID for the leader. TestFilterBehindReplicas covers
// valid replica IDs.
status.Lead = 99
status.RaftState = raft.StateLeader
status.RaftState = raftpb.StateLeader
status.Commit = c.commit
var replicas []roachpb.ReplicaDescriptor
for j, v := range c.progress {
Expand Down Expand Up @@ -8421,7 +8421,7 @@ func TestSimulateFilterUnremovableReplicas(t *testing.T) {
// Use an invalid replica ID for the leader. TestFilterBehindReplicas covers
// valid replica IDs.
status.Lead = 99
status.RaftState = raft.StateLeader
status.RaftState = raftpb.StateLeader
status.Commit = c.commit
var replicas []roachpb.ReplicaDescriptor
for j, v := range c.progress {
Expand Down
3 changes: 2 additions & 1 deletion pkg/kv/kvserver/allocator/plan/replicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvflowcontrol/rac2"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvserverpb"
"github.com/cockroachdb/cockroach/pkg/raft"
"github.com/cockroachdb/cockroach/pkg/raft/raftpb"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
"github.com/cockroachdb/cockroach/pkg/util/log"
Expand Down Expand Up @@ -534,7 +535,7 @@ func (rp ReplicaPlanner) findRemoveVoter(
lastReplAdded = 0
}
raftStatus := repl.RaftStatus()
if raftStatus == nil || raftStatus.RaftState != raft.StateLeader {
if raftStatus == nil || raftStatus.RaftState != raftpb.StateLeader {
// If requested, assume all replicas are up-to-date.
if rp.knobs.AllowVoterRemovalWhenNotLeader {
candidates = allocatorimpl.FilterUnremovableReplicasWithoutRaftStatus(
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/allocator_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func TestAllocatorRebalanceTarget(t *testing.T) {
Progress: make(map[raftpb.PeerID]tracker.Progress),
}
status.Lead = 1
status.RaftState = raft.StateLeader
status.RaftState = raftpb.StateLeader
status.Commit = 10
for _, replica := range replicas {
status.Progress[raftpb.PeerID(replica.ReplicaID)] = tracker.Progress{
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/asim/state/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ func (s *state) RaftStatus(rangeID RangeID, storeID StoreID) *raft.Status {
// TODO(kvoli): The raft leader will always be the current leaseholder
// here. This should change to enable testing this scenario.
status.Lead = raftpb.PeerID(leader.ReplicaID())
status.RaftState = raft.StateLeader
status.RaftState = raftpb.StateLeader
status.Commit = 2
// TODO(kvoli): A replica is never behind on their raft log, this should
// change to enable testing this scenario where replicas fall behind. e.g.
Expand Down
3 changes: 1 addition & 2 deletions pkg/kv/kvserver/client_lease_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvserverpb"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/liveness"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/liveness/livenesspb"
"github.com/cockroachdb/cockroach/pkg/raft"
"github.com/cockroachdb/cockroach/pkg/raft/raftpb"
"github.com/cockroachdb/cockroach/pkg/raft/tracker"
"github.com/cockroachdb/cockroach/pkg/roachpb"
Expand Down Expand Up @@ -431,7 +430,7 @@ func TestTransferLeaseDuringJointConfigWithDeadIncomingVoter(t *testing.T) {
require.NoError(t, repl0.RaftReportUnreachable(4))
// Check the Raft progress.
s := repl0.RaftStatus()
require.Equal(t, raft.StateLeader, s.RaftState)
require.Equal(t, raftpb.StateLeader, s.RaftState)
p := s.Progress
require.Len(t, p, 4)
require.Contains(t, p, raftpb.PeerID(4))
Expand Down
Loading

0 comments on commit 0eeda76

Please sign in to comment.