Skip to content

Commit

Permalink
Merge pull request #894 from kakao/rm_buffer_pool_flags
Browse files Browse the repository at this point in the history
feat: remove gRPC buffer pool flags
  • Loading branch information
ijsong authored Oct 23, 2024
2 parents 8996f0a + 2f8c095 commit 685587a
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 37 deletions.
2 changes: 0 additions & 2 deletions cmd/varlogadm/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ func newStartCommand() *cli.Command {
flagSNWatcherReportDeadline.DurationFlag(false, snwatcher.DefaultReportDeadline),

flags.GRPCServerReadBufferSize,
flags.GRPCServerRecvBufferPool,
flags.GRPCServerWriteBufferSize,
flags.GRPCServerSharedWriteBuffer,
flags.GRPCServerMaxRecvMsgSize,
flags.GRPCServerInitialConnWindowSize,
flags.GRPCServerInitialWindowSize,
flags.GRPCClientReadBufferSize,
flags.GRPCClientRecvBufferPool,
flags.GRPCClientWriteBufferSize,
flags.GRPCClientSharedWriteBuffer,
flags.GRPCClientInitialConnWindowSize,
Expand Down
2 changes: 0 additions & 2 deletions cmd/varlogadm/testdata/varlogadm.ct
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,12 @@ OPTIONS:
--grpc-client-initial-conn-window-size value Set the gRPC client's initial window size for a connection. If not set, the default value of 64KiB defined by gRPC will be used. [$GRPC_CLIENT_INITIAL_CONN_WINDOW_SIZE]
--grpc-client-initial-window-size value Set the gRPC client's initial window size for a stream. If not set, the default value of 64KiB defined by gRPC will be used. [$GRPC_CLIENT_INITIAL_WINDOW_SIZE]
--grpc-client-read-buffer-size value Set the gRPC client's read buffer size for a single read syscall. If not set, the default value of 32KiB defined by gRPC will be used. [$GRPC_CLIENT_READ_BUFFER_SIZE]
--grpc-client-recv-buffer-pool Use the gRPC client's shared buffer pool for parsing incoming messages. If not set, the buffer pool will not be used. (default: false) [$GRPC_CLIENT_RECV_BUFFER_POOL]
--grpc-client-shared-write-buffer Enable sharing gRPC client's transport write buffer across connections. If not set, each connection will allocate its own write buffer. (default: false) [$GRPC_CLIENT_SHARED_WRITE_BUFFER]
--grpc-client-write-buffer-size value Set the gRPC client's write buffer size for a single write syscall. If not set, the default value of 32KiB defined by gRPC will be used. [$GRPC_CLIENT_WRITE_BUFFER_SIZE]
--grpc-server-initial-conn-window-size value Set the gRPC server's initial window size for a connection. If not set, the default value of 64KiB defined by gRPC will be used. [$GRPC_SERVER_INITIAL_CONN_WINDOW_SIZE]
--grpc-server-initial-window-size value Set the gRPC server's initial window size for a stream. If not set, the default value of 64KiB defined by gRPC will be used. [$GRPC_SERVER_INITIAL_WINDOW_SIZE]
--grpc-server-max-recv-msg-size value Set the maximum message size in bytes that the gRPC server can receive. If not set, the default value of 4MiB defined by gRPC will be used. [$GRPC_SERVER_MAX_RECV_MSG_SIZE]
--grpc-server-read-buffer-size value Set the gRPC server's read buffer size for a single read syscall. If not set, the default value of 32KiB defined by gRPC will be used. [$GRPC_SERVER_READ_BUFFER_SIZE]
--grpc-server-recv-buffer-pool Use the gRPC server's shared buffer pool for parsing incoming messages. If not set, the buffer pool will not be used. (default: false) [$GRPC_SERVER_RECV_BUFFER_POOL]
--grpc-server-shared-write-buffer Enable sharing gRPC server's transport write buffer across connections. If not set, each connection will allocate its own write buffer. (default: false) [$GRPC_SERVER_SHARED_WRITE_BUFFER]
--grpc-server-write-buffer-size value Set the gRPC server's write buffer size for a single write syscall. If not set, the default value of 32KiB defined by gRPC will be used. [$GRPC_SERVER_WRITE_BUFFER_SIZE]

Expand Down
2 changes: 0 additions & 2 deletions cmd/varlogmr/metadata_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,12 @@ func initCLI() *cli.App {
flagRaftDir.StringFlag(false, metarepos.DefaultRaftDir),
flagPeers.StringSliceFlag(false, nil),
flags.GRPCServerReadBufferSize,
flags.GRPCServerRecvBufferPool,
flags.GRPCServerWriteBufferSize,
flags.GRPCServerSharedWriteBuffer,
flags.GRPCServerMaxRecvMsgSize,
flags.GRPCServerInitialConnWindowSize,
flags.GRPCServerInitialWindowSize,
flags.GRPCClientReadBufferSize,
flags.GRPCClientRecvBufferPool,
flags.GRPCClientWriteBufferSize,
flags.GRPCClientSharedWriteBuffer,
flags.GRPCClientInitialConnWindowSize,
Expand Down
2 changes: 0 additions & 2 deletions cmd/varlogsn/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ func newStartCommand() *cli.Command {
flagVolumes.StringSliceFlag(true, nil),

flags.GRPCServerReadBufferSize,
flags.GRPCServerRecvBufferPool,
flags.GRPCServerWriteBufferSize,
flags.GRPCServerSharedWriteBuffer,
flags.GRPCServerMaxRecvMsgSize,
flags.GRPCServerInitialConnWindowSize,
flags.GRPCServerInitialWindowSize,
flags.GRPCClientReadBufferSize,
flags.GRPCClientRecvBufferPool,
flags.GRPCClientWriteBufferSize,
flags.GRPCClientSharedWriteBuffer,
flags.GRPCClientInitialConnWindowSize,
Expand Down
2 changes: 0 additions & 2 deletions cmd/varlogsn/testdata/varlogsn.ct
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,12 @@ OPTIONS:
--grpc-client-initial-conn-window-size value Set the gRPC client's initial window size for a connection. If not set, the default value of 64KiB defined by gRPC will be used. [$GRPC_CLIENT_INITIAL_CONN_WINDOW_SIZE]
--grpc-client-initial-window-size value Set the gRPC client's initial window size for a stream. If not set, the default value of 64KiB defined by gRPC will be used. [$GRPC_CLIENT_INITIAL_WINDOW_SIZE]
--grpc-client-read-buffer-size value Set the gRPC client's read buffer size for a single read syscall. If not set, the default value of 32KiB defined by gRPC will be used. [$GRPC_CLIENT_READ_BUFFER_SIZE]
--grpc-client-recv-buffer-pool Use the gRPC client's shared buffer pool for parsing incoming messages. If not set, the buffer pool will not be used. (default: false) [$GRPC_CLIENT_RECV_BUFFER_POOL]
--grpc-client-shared-write-buffer Enable sharing gRPC client's transport write buffer across connections. If not set, each connection will allocate its own write buffer. (default: false) [$GRPC_CLIENT_SHARED_WRITE_BUFFER]
--grpc-client-write-buffer-size value Set the gRPC client's write buffer size for a single write syscall. If not set, the default value of 32KiB defined by gRPC will be used. [$GRPC_CLIENT_WRITE_BUFFER_SIZE]
--grpc-server-initial-conn-window-size value Set the gRPC server's initial window size for a connection. If not set, the default value of 64KiB defined by gRPC will be used. [$GRPC_SERVER_INITIAL_CONN_WINDOW_SIZE]
--grpc-server-initial-window-size value Set the gRPC server's initial window size for a stream. If not set, the default value of 64KiB defined by gRPC will be used. [$GRPC_SERVER_INITIAL_WINDOW_SIZE]
--grpc-server-max-recv-msg-size value Set the maximum message size in bytes that the gRPC server can receive. If not set, the default value of 4MiB defined by gRPC will be used. [$GRPC_SERVER_MAX_RECV_MSG_SIZE]
--grpc-server-read-buffer-size value Set the gRPC server's read buffer size for a single read syscall. If not set, the default value of 32KiB defined by gRPC will be used. [$GRPC_SERVER_READ_BUFFER_SIZE]
--grpc-server-recv-buffer-pool Use the gRPC server's shared buffer pool for parsing incoming messages. If not set, the buffer pool will not be used. (default: false) [$GRPC_SERVER_RECV_BUFFER_POOL]
--grpc-server-shared-write-buffer Enable sharing gRPC server's transport write buffer across connections. If not set, each connection will allocate its own write buffer. (default: false) [$GRPC_SERVER_SHARED_WRITE_BUFFER]
--grpc-server-write-buffer-size value Set the gRPC server's write buffer size for a single write syscall. If not set, the default value of 32KiB defined by gRPC will be used. [$GRPC_SERVER_WRITE_BUFFER_SIZE]

Expand Down
27 changes: 0 additions & 27 deletions internal/flags/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/urfave/cli/v2"
"google.golang.org/grpc"
"google.golang.org/grpc/experimental"

"github.com/kakao/varlog/pkg/util/units"
)
Expand All @@ -33,16 +32,6 @@ var (
return nil
},
}
// GRPCServerRecvBufferPool is a flag to use the gRPC server's shared buffer pool for parsing incoming messages.
//
// See:
// - https://pkg.go.dev/google.golang.org/grpc@v1.64.0/experimental#RecvBufferPool
GRPCServerRecvBufferPool = &cli.BoolFlag{
Name: "grpc-server-recv-buffer-pool",
Category: CategoryGRPC,
EnvVars: []string{"GRPC_SERVER_RECV_BUFFER_POOL"},
Usage: "Use the gRPC server's shared buffer pool for parsing incoming messages. If not set, the buffer pool will not be used.",
}
// GRPCServerWriteBufferSize is a flag to set the gRPC server's write
// buffer size for a single write syscall.
//
Expand Down Expand Up @@ -136,16 +125,6 @@ var (
return nil
},
}
// GRPCClientRecvBufferPool is a flag to use the gRPC client's shared buffer pool for parsing incoming messages.
//
// See:
// - https://pkg.go.dev/google.golang.org/grpc/experimental#WithRecvBufferPool
GRPCClientRecvBufferPool = &cli.BoolFlag{
Name: "grpc-client-recv-buffer-pool",
Category: CategoryGRPC,
EnvVars: []string{"GRPC_CLIENT_RECV_BUFFER_POOL"},
Usage: "Use the gRPC client's shared buffer pool for parsing incoming messages. If not set, the buffer pool will not be used.",
}
// GRPCClientWriteBufferSize is a flag to set the gRPC client's write
// buffer size for a single write syscall.
//
Expand Down Expand Up @@ -216,9 +195,6 @@ func ParseGRPCServerOptionFlags(c *cli.Context) (opts []grpc.ServerOption, _ err
}
opts = append(opts, grpc.ReadBufferSize(int(readBufferSize)))
}
if c.IsSet(GRPCServerRecvBufferPool.Name) {
opts = append(opts, experimental.RecvBufferPool(grpc.NewSharedBufferPool()))
}
if c.IsSet(GRPCServerWriteBufferSize.Name) {
writeBufferSize, err := units.FromByteSizeString(c.String(GRPCServerWriteBufferSize.Name))
if err != nil {
Expand Down Expand Up @@ -259,9 +235,6 @@ func ParseGRPCDialOptionFlags(c *cli.Context) (opts []grpc.DialOption, err error
}
opts = append(opts, grpc.WithReadBufferSize(int(readBufferSize)))
}
if c.IsSet(GRPCClientRecvBufferPool.Name) {
opts = append(opts, experimental.WithRecvBufferPool(grpc.NewSharedBufferPool()))
}
if c.IsSet(GRPCClientWriteBufferSize.Name) {
writeBufferSize, err := units.FromByteSizeString(c.String(GRPCClientWriteBufferSize.Name))
if err != nil {
Expand Down

0 comments on commit 685587a

Please sign in to comment.