Skip to content

Commit d0631e1

Browse files
wip: do_not_merge
1 parent 4cf29a0 commit d0631e1

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ replace github.com/docker/docker => github.com/moby/moby v24.0.6+incompatible
526526

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

529-
replace storj.io/drpc => github.com/cthumuluru-crdb/drpc v0.0.0-20251118112210-c686eec55198
529+
replace storj.io/drpc => ../drpc
530530

531531
// Note: This forked dependency adds a commit that opens up some
532532
// private APIs to enable us to make some perf improvements to

pkg/cli/context.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ func setCliContextDefaults() {
210210
cliCtx.ambiguousLogDir = false
211211
cliCtx.logOverrides.reset()
212212
cliCtx.showVersionUsingOnlyBuildTag = false
213+
cliCtx.UseDRPC = true
213214
}
214215

215216
// sqlConnContext captures the connection configuration for all SQL

pkg/rpc/drpc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"context"
1010
"math"
1111
"net"
12+
"runtime/debug"
1213
"time"
1314

1415
"github.com/cockroachdb/cockroach/pkg/kv/kvpb"
@@ -79,6 +80,7 @@ type closeEntirePoolConn struct {
7980
}
8081

8182
func (c *closeEntirePoolConn) Close() error {
83+
log.Ops.Infof(context.Background(), "(chandrat) poolConn.Close() called: %s", string(debug.Stack()))
8284
_ = c.Conn.Close()
8385
return c.pool.Close()
8486
}

pkg/rpc/rpcbase/nodedialer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"storj.io/drpc"
1717
)
1818

19-
var envExperimentalDRPCEnabled = envutil.EnvOrDefaultBool("COCKROACH_EXPERIMENTAL_DRPC_ENABLED", false)
19+
var envExperimentalDRPCEnabled = envutil.EnvOrDefaultBool("COCKROACH_EXPERIMENTAL_DRPC_ENABLED", true)
2020

2121
// ExperimentalDRPCEnabled determines whether a drpc server accepting BatchRequest
2222
// is enabled. This server is experimental and completely unsuitable to production

pkg/server/init.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,8 @@ func (s *initServer) startJoinLoop(ctx context.Context, stopper *stop.Stopper) (
449449
func (s *initServer) attemptJoinTo(
450450
ctx context.Context, addr string,
451451
) (*kvpb.JoinNodeResponse, error) {
452-
var useDRPC bool = false
453452
var initClient kvpb.RPCNodeClient
454-
if !useDRPC {
453+
if !s.config.useDRPC {
455454
dialOpts, err := s.config.getGRPCDialOpts(ctx, addr, rpcbase.SystemClass)
456455
if err != nil {
457456
return nil, err
@@ -605,6 +604,9 @@ type initServerCfg struct {
605604
// getDRPCDialOpts retrieves the DRPC dial options to use to issue Join RPCs.
606605
getDRPCDialOpts func(ctx context.Context, target string, class rpcbase.ConnectionClass) ([]drpcclient.DialOption, error)
607606

607+
// useDRPC indicates whether to use DRPC as the RPC framework instead of gRPC.
608+
useDRPC bool
609+
608610
// bootstrapAddresses is a list of node addresses (populated using --join
609611
// addresses) that is used to form a connected graph/network of CRDB servers.
610612
// Once a strongly connected graph is constructed, it suffices for any node in
@@ -664,6 +666,7 @@ func newInitServerConfig(
664666
defaultZoneConfig: cfg.DefaultZoneConfig,
665667
getGRPCDialOpts: getGRPCDialOpts,
666668
getDRPCDialOpts: getDRPCDialOpts,
669+
useDRPC: cfg.UseDRPC,
667670
bootstrapAddresses: bootstrapAddresses,
668671
testingKnobs: cfg.TestingKnobs,
669672
}

0 commit comments

Comments
 (0)