grpc: Increase message limits #470

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-node:fix/grpc_message_size into master 2023-06-30 13:52:05 +00:00

View file

@ -17,11 +17,13 @@ import (
"google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials"
) )
const maxRecvMsgSize = 256 << 20
func initGRPC(c *cfg) { func initGRPC(c *cfg) {
var successCount int var successCount int
grpcconfig.IterateEndpoints(c.appCfg, func(sc *grpcconfig.Config) { grpcconfig.IterateEndpoints(c.appCfg, func(sc *grpcconfig.Config) {
serverOpts := []grpc.ServerOption{ serverOpts := []grpc.ServerOption{
grpc.MaxSendMsgSize(maxMsgSize), grpc.MaxRecvMsgSize(maxRecvMsgSize),

Why not to move it in config file?

Why not to move it in config file?

If we transfer this parameter to the configuration file, then we can get a situation where different nodes have different values set. This will lead to problems with requests.

If we transfer this parameter to the configuration file, then we can get a situation where different nodes have different values set. This will lead to problems with requests.

We will face this error (if it will be) anyway because it is impossible to upgrade all nodes at once, rolling upgrade is a usual case for us.

We will face this error (if it will be) anyway because it is impossible to upgrade all nodes at once, rolling upgrade is a usual case for us.

Well, you are right.
We can prevent invalid configuration, but we can't prevent rolling upgrade.

Well, you are right. We can prevent invalid configuration, but we can't prevent rolling upgrade.

We have increased message size, so no problems should appear when talking old -> new node.
For new -> old we still use default chunkSize.

We have _increased_ message size, so no problems should appear when talking `old -> new` node. For `new -> old` we still use default `chunkSize`.
grpc.ChainUnaryInterceptor( grpc.ChainUnaryInterceptor(
metrics.NewUnaryServerInterceptor(), metrics.NewUnaryServerInterceptor(),
tracing.NewUnaryServerInterceptor(), tracing.NewUnaryServerInterceptor(),