Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make etcd param MaxCallSendMsgSize configurable #12666

Merged
merged 6 commits into from Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/12666.txt
@@ -0,0 +1,4 @@

```release-note:improvement
storage/etcd: Make etcd parameter MaxCallSendMsgSize configurable
```
9 changes: 9 additions & 0 deletions physical/etcd/etcd3.go
Expand Up @@ -119,6 +119,15 @@ func newEtcd3Backend(conf map[string]string, logger log.Logger) (physical.Backen
cfg.MaxCallRecvMsgSize = int(val)
}

if maxCall, ok := conf["max_call_size"]; ok {
// grpc converts this to uint32 internally, so parse as that to avoid passing invalid values
val, err := strconv.ParseUint(maxCall, 10, 32)
if err != nil {
return nil, fmt.Errorf("value of 'max_call_size' (%v) could not be understood: %w", maxCall, err)
}
cfg.MaxCallSendMsgSize = int(val)
}

etcd, err := clientv3.New(cfg)
if err != nil {
return nil, err
Expand Down
8 changes: 8 additions & 0 deletions website/content/docs/configuration/storage/etcd.mdx
Expand Up @@ -84,6 +84,14 @@ storage "etcd" {
- `lock_timeout` `(string: "15s")` – Specifies lock timeout for master
Vault instance. Set bigger value if you don't need faster recovery.

- `max_receive_size` `(int32: math.MaxInt32)` – Specifies the client-side response receive limit.
antcs marked this conversation as resolved.
Show resolved Hide resolved
Make sure that "MaxCallRecvMsgSize" >= server-side default send/recv limit.
antcs marked this conversation as resolved.
Show resolved Hide resolved
("--max-request-bytes" flag to etcd or "embed.Config.MaxRequestBytes").

- `max_call_size` `(int32: 2 * 1024 * 1024)` – Specifies the client-side request send limit in bytes.
antcs marked this conversation as resolved.
Show resolved Hide resolved
Make sure that "MaxCallSendMsgSize" < server-side default send/recv limit.
antcs marked this conversation as resolved.
Show resolved Hide resolved
("--max-request-bytes" flag to etcd or "embed.Config.MaxRequestBytes").

## `etcd` Examples

### DNS Discovery of cluster members
Expand Down