Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10890,10 +10890,10 @@ def go_deps():
name = "io_storj_drpc",
build_file_proto_mode = "disable_global",
importpath = "storj.io/drpc",
sha256 = "98b44a51f82873f93f77da80230212ab40f35044e8d38645cb1392ae03462f0b",
strip_prefix = "github.com/cockroachdb/[email protected]20250924114114-78d4e121902a",
sha256 = "c3861ad4fc0e814d1a9648176f96f4f7fecc385a1a88b439c7205007aa2f36ae",
strip_prefix = "github.com/cthumuluru-crdb/[email protected]20251118112210-c686eec55198",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/drpc/com_github_cockroachdb_drpc-v0.0.0-20250924114114-78d4e121902a.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cthumuluru-crdb/drpc/com_github_cthumuluru_crdb_drpc-v0.0.0-20251118112210-c686eec55198.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 @@ -344,7 +344,6 @@ DISTDIR_FILES = {
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/crlfmt/com_github_cockroachdb_crlfmt-v0.0.0-20221214225007-b2fc5c302548.zip": "fedc01bdd6d964da0425d5eaac8efadc951e78e13f102292cc0774197f09ab63",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/crlib/com_github_cockroachdb_crlib-v0.0.0-20251024155502-a2e0a212ef05.zip": "a9a4b8810d52a2d18dddbbc359d060f5db854e328b4d75f12b7c5081ac25b2a2",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/datadriven/com_github_cockroachdb_datadriven-v1.0.3-0.20251006155849-f84f9e519edd.zip": "a7ffcef0b264d9c28c36b2f9b737ff739542f472d7614938ae507e2da269f6c2",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/drpc/com_github_cockroachdb_drpc-v0.0.0-20250924114114-78d4e121902a.zip": "98b44a51f82873f93f77da80230212ab40f35044e8d38645cb1392ae03462f0b",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/errors/com_github_cockroachdb_errors-v1.12.1-0.20251010171200-64801262cd6f.zip": "4df66cc44791d4290071696abf179dc6df7b94b4cb5d29a20f39c6bf522c60ee",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/go-test-teamcity/com_github_cockroachdb_go_test_teamcity-v0.0.0-20191211140407-cff980ad0a55.zip": "bac30148e525b79d004da84d16453ddd2d5cd20528e9187f1d7dac708335674b",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/gogoproto/com_github_cockroachdb_gogoproto-v1.3.3-0.20241216150617-2358cdb156a1.zip": "bf052c9a7f9e23fb3ec7e9f3b7201cfc264c18ed6da0d662952d276dbc339003",
Expand Down Expand Up @@ -396,6 +395,7 @@ DISTDIR_FILES = {
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cpuguy83/go-md2man/v2/com_github_cpuguy83_go_md2man_v2-v2.0.2.zip": "70a7e609809cf2a92c5535104db5eb82d75c54bfcfed2d224e87dd2fd9729f62",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/creack/pty/com_github_creack_pty-v1.1.11.zip": "d6594fd4844c242a5c7d6e9b25516182460cffa820e47e8ffb8eea625991986c",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/crossdock/crossdock-go/com_github_crossdock_crossdock_go-v0.0.0-20160816171116-049aabb0122b.zip": "f8a2ed6cd39e4f3e8108b8987f72bf6746276ada6fd3fcc62015bdbdd097f1a3",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cthumuluru-crdb/drpc/com_github_cthumuluru_crdb_drpc-v0.0.0-20251118112210-c686eec55198.zip": "c3861ad4fc0e814d1a9648176f96f4f7fecc385a1a88b439c7205007aa2f36ae",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cyberdelia/templates/com_github_cyberdelia_templates-v0.0.0-20141128023046-ca7fffd4298c.zip": "a0ed6b8037d36222f63128f6064ed5b0e461fa9798c3592440a08875154d6c72",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cyphar/filepath-securejoin/com_github_cyphar_filepath_securejoin-v0.2.3.zip": "1e38690899f84b347ddc67cb8c6395812aea795e735b2208d680163278a3e3ba",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/d2g/dhcp4/com_github_d2g_dhcp4-v0.0.0-20170904100407-a1d1b6c41b1c.zip": "15df9468cf548a626e1319e92d550432512c4319cf555bf278ea9215de3504e3",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ replace github.com/docker/docker => github.com/moby/moby v24.0.6+incompatible

replace github.com/gogo/protobuf => github.com/cockroachdb/gogoproto v1.3.3-0.20241216150617-2358cdb156a1

replace storj.io/drpc => github.com/cockroachdb/drpc v0.0.0-20250924114114-78d4e121902a
replace storj.io/drpc => github.com/cthumuluru-crdb/drpc v0.0.0-20251118112210-c686eec55198

// Note: This forked dependency adds a commit that opens up some
// private APIs to enable us to make some perf improvements to
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,6 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z
github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU=
github.com/cockroachdb/datadriven v1.0.3-0.20251006155849-f84f9e519edd h1:vpWCe7VvdQbQ/9wGtlH3i+Oj+9OggKci3lsASL1ydvg=
github.com/cockroachdb/datadriven v1.0.3-0.20251006155849-f84f9e519edd/go.mod h1:jsaKMvD3RBCATk1/jbUZM8C9idWBJME9+VRZ5+Liq1g=
github.com/cockroachdb/drpc v0.0.0-20250924114114-78d4e121902a h1:zXCfk52Hpu2IoejmDm4Bkxmb5Nh9vxwaYOCiqA6f3YA=
github.com/cockroachdb/drpc v0.0.0-20250924114114-78d4e121902a/go.mod h1:Ag2/Yfl22WZ8ywFUasRQ2brdltpX5QvY63jnYTZ3N5U=
github.com/cockroachdb/errors v1.12.1-0.20251010171200-64801262cd6f h1:lUmJxzb2/ukuRIvKTaNkvuj5LwlX4u/KxnI3zmx1SSw=
github.com/cockroachdb/errors v1.12.1-0.20251010171200-64801262cd6f/go.mod h1:SvzfYNNBshAVbZ8wzNc/UPK3w1vf0dKDUP41ucAIf7g=
github.com/cockroachdb/go-test-teamcity v0.0.0-20191211140407-cff980ad0a55 h1:YqzBA7tf8Gv8Oz0BbBsPenqkyjiohS7EUIwi7p1QJCU=
Expand Down Expand Up @@ -713,6 +711,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/crossdock/crossdock-go v0.0.0-20160816171116-049aabb0122b/go.mod h1:v9FBN7gdVTpiD/+LZ7Po0UKvROyT87uLVxTHVky/dlQ=
github.com/cthumuluru-crdb/drpc v0.0.0-20251118112210-c686eec55198 h1:w0whIZa/Koi059vXP9NemhrxVoBK/KBYpLJXozaNHlc=
github.com/cthumuluru-crdb/drpc v0.0.0-20251118112210-c686eec55198/go.mod h1:Ag2/Yfl22WZ8ywFUasRQ2brdltpX5QvY63jnYTZ3N5U=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4=
github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
Expand Down
3 changes: 3 additions & 0 deletions pkg/base/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ type Config struct {
// RPCHearbeatTimeout is the timeout for Ping requests.
RPCHeartbeatTimeout time.Duration

// UseDRPC indicates whether to use DRPC as the RPC framework instead of gRPC.
UseDRPC bool

// ApplicationInternalRPCPortMin/PortMax define the range of TCP ports
// used to start the internal RPC service for application-level
// servers. This service is used for node-to-node RPC traffic and to
Expand Down
8 changes: 8 additions & 0 deletions pkg/cli/cliflags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,14 @@ information.
`,
}

UseNewRPC = FlagInfo{
Name: "use-new-rpc",
Description: `
Use the new RPC framework for internode communication instead of gRPC. This is
a preview feature and is intended for non-production use only.
`,
}

LocalityAdvertiseAddr = FlagInfo{
Name: "locality-advertise-addr",
Description: `
Expand Down
1 change: 1 addition & 0 deletions pkg/cli/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ func setCliContextDefaults() {
cliCtx.ambiguousLogDir = false
cliCtx.logOverrides.reset()
cliCtx.showVersionUsingOnlyBuildTag = false
cliCtx.UseDRPC = true
}

// sqlConnContext captures the connection configuration for all SQL
Expand Down
3 changes: 3 additions & 0 deletions pkg/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,9 @@ func init() {

cliflagcfg.BoolFlag(f, &serverCfg.AcceptProxyProtocolHeaders, cliflags.AcceptProxyProtocolHeaders)

cliflagcfg.BoolFlag(f, &baseCfg.UseDRPC, cliflags.UseNewRPC)
_ = f.MarkHidden(cliflags.UseNewRPC.Name)

// Certificates directory. Use a server-specific flag and value to ignore environment
// variables, but share the same default.
cliflagcfg.StringFlag(f, &startCtx.serverSSLCertsDir, cliflags.ServerCertsDir)
Expand Down
34 changes: 34 additions & 0 deletions pkg/cli/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1889,3 +1889,37 @@ func TestWALFailoverWrapperRoundtrip(t *testing.T) {
return buf.String()
})
}

func TestUseNewRPC(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)

// Avoid leaking configuration changes after the test ends.
defer initCLIDefaults()

testCases := []struct {
args []string
expectedVal bool
}{
{[]string{}, false}, // Default value
{[]string{"--use-new-rpc"}, true}, // Flag enabled
{[]string{"--use-new-rpc=true"}, true}, // Flag explicitly enabled
{[]string{"--use-new-rpc=false"}, false}, // Flag explicitly disabled
}

for _, tc := range testCases {
t.Run(fmt.Sprintf("%v", tc.args), func(t *testing.T) {
// Reset to defaults before each test
initCLIDefaults()

f := startCmd.Flags()
if err := f.Parse(tc.args); err != nil {
t.Fatal(err)
}

if baseCfg.UseDRPC != tc.expectedVal {
t.Errorf("expected UseDRPC=%v, but got %v", tc.expectedVal, baseCfg.UseDRPC)
}
})
}
}
2 changes: 0 additions & 2 deletions pkg/rpc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,13 @@ go_library(
"@io_opentelemetry_go_otel//attribute",
"@io_storj_drpc//:drpc",
"@io_storj_drpc//drpcclient",
"@io_storj_drpc//drpcconn",
"@io_storj_drpc//drpcctx",
"@io_storj_drpc//drpcmanager",
"@io_storj_drpc//drpcmetadata",
"@io_storj_drpc//drpcmigrate",
"@io_storj_drpc//drpcmux",
"@io_storj_drpc//drpcpool",
"@io_storj_drpc//drpcserver",
"@io_storj_drpc//drpcstream",
"@io_storj_drpc//drpcwire",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//backoff",
Expand Down
15 changes: 15 additions & 0 deletions pkg/rpc/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ type ContextOptions struct {

// Locality stores the locality of this node.
Locality roachpb.Locality

// UseDRPC indicates if DRPC must be used for internode communication.
UseDRPC bool
}

// DefaultContextOptions are mostly used in tests.
Expand Down Expand Up @@ -458,6 +461,7 @@ func ServerContextOptionsFromBaseConfig(cfg *base.Config) ContextOptions {
AdvertiseAddrH: &cfg.AdvertiseAddrH,
SQLAdvertiseAddrH: &cfg.SQLAdvertiseAddrH,
DisableTLSForHTTP: cfg.DisableTLSForHTTP,
UseDRPC: cfg.UseDRPC,
}
}

Expand Down Expand Up @@ -1432,6 +1436,17 @@ func (rpcCtx *Context) GRPCDialOptions(
return rpcCtx.grpcDialOptionsInternal(ctx, target, class, transport, onNetworkDial)
}

// DRPCDialOptions is same as GRPCDialOptions but for drpc connections.
func (rpcCtx *Context) DRPCDialOptions(
ctx context.Context, target string, class rpcbase.ConnectionClass,
) ([]drpcclient.DialOption, error) {
transport := tcpTransport
if rpcCtx.ContextOptions.AdvertiseAddr == target && rpcCtx.canLoopbackDial() {
transport = loopbackTransport
}
return rpcCtx.drpcDialOptionsInternal(ctx, target, class, transport)
}

// grpcDialOptions produces dial options suitable for connecting to the given target and class.
func (rpcCtx *Context) grpcDialOptionsInternal(
ctx context.Context,
Expand Down
Loading
Loading