Skip to content

Commit

Permalink
kvserver: [dnm] hack rac2 enabled
Browse files Browse the repository at this point in the history
DNM, hack in changes required to enable rac2 for testing in prior
commits.

Part of: #130187
Release note: None
  • Loading branch information
kvoli committed Sep 17, 2024
1 parent 1542741 commit 45cd855
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/kv/kvserver/kvadmission/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ go_library(
"//pkg/kv/kvpb",
"//pkg/kv/kvserver/kvflowcontrol",
"//pkg/kv/kvserver/kvflowcontrol/kvflowcontrolpb",
"//pkg/kv/kvserver/kvflowcontrol/rac2",
"//pkg/kv/kvserver/kvflowcontrol/replica_rac2",
"//pkg/kv/kvserver/raftlog",
"//pkg/raft/raftpb",
Expand Down
3 changes: 2 additions & 1 deletion pkg/kv/kvserver/kvadmission/kvadmission.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/kv/kvpb"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvflowcontrol"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvflowcontrol/kvflowcontrolpb"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvflowcontrol/rac2"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvflowcontrol/replica_rac2"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/raftlog"
"github.com/cockroachdb/cockroach/pkg/raft/raftpb"
Expand Down Expand Up @@ -356,7 +357,7 @@ func (n *controllerImpl) AdmitKVWork(
// TODO(sumeerbhola,kvoli): The priority needs to be converted to a
// raftpb.Priority when v2 encoding is enabled. e.g.,
// rac2.AdmissionToRaftPriority().
AdmissionPriority: int32(admissionInfo.Priority),
AdmissionPriority: int32(rac2.AdmissionToRaftPriority(admissionInfo.Priority)),
AdmissionCreateTime: admissionInfo.CreateTime,
AdmissionOriginNode: n.nodeID.Get(),
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/kv/kvserver/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -2531,7 +2531,9 @@ func racV2EnabledWhenLeaderLevel(
ctx context.Context, st *cluster.Settings,
) replica_rac2.EnabledWhenLeaderLevel {
// TODO(sumeer): implement fully, once all the dependencies are implemented.
return replica_rac2.NotEnabledWhenLeader
// TODO(kvoli): Should this be a cluster setting, or are we ratcheting it up
// via cluster version.
return replica_rac2.EnabledWhenLeaderV2Encoding
}

// maybeEnqueueProblemRange will enqueue the replica for processing into the
Expand Down

0 comments on commit 45cd855

Please sign in to comment.