Skip to content

Expose etcd client MaxCallSendMsgSize config#28078

Merged
jbardin merged 3 commits intohashicorp:mainfrom
jasons42:configure-etcdv3-client-max-request-size
Jul 20, 2021
Merged

Expose etcd client MaxCallSendMsgSize config#28078
jbardin merged 3 commits intohashicorp:mainfrom
jasons42:configure-etcdv3-client-max-request-size

Conversation

@jasons42
Copy link
Copy Markdown
Contributor

The etcdv3 client has a default request send limit of 2.0 MiB. This change
exposes the configuration option to increase that limit enabling larger
state using the etcdv3 backend.

This also requires that the corresponding --max-request-bytes flag be
increased on the server side. The default there is 1.5 MiB.

Fixes #25745

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 12, 2021

Codecov Report

Merging #28078 (b6f8857) into main (51c7aff) will decrease coverage by 0.32%.
The diff coverage is 0.00%.

❗ Current head b6f8857 differs from pull request most recent head 525c5b5. Consider uploading reports for the commit 525c5b5 to get more accurate results

Impacted Files Coverage Δ
backend/remote-state/etcdv3/backend.go 0.00% <0.00%> (ø)
command/views/view.go 29.72% <0.00%> (-27.03%) ⬇️
states/state_deepcopy.go 63.95% <0.00%> (-15.36%) ⬇️
command/format/diagnostic.go 69.42% <0.00%> (-12.04%) ⬇️
dag/set.go 79.41% <0.00%> (-6.31%) ⬇️
command/jsonplan/plan.go 26.90% <0.00%> (-6.19%) ⬇️
internal/providercache/dir.go 67.34% <0.00%> (-6.13%) ⬇️
command/fmt.go 76.38% <0.00%> (-4.32%) ⬇️
terraform/node_resource_plan_instance.go 70.12% <0.00%> (-4.16%) ⬇️
command/refresh.go 46.22% <0.00%> (-2.29%) ⬇️
... and 31 more

@jasons42 jasons42 marked this pull request as ready for review March 15, 2021 22:00
@jbardin jbardin requested a review from bmcustodio March 17, 2021 18:43
@jasons42 jasons42 force-pushed the configure-etcdv3-client-max-request-size branch from b6f8857 to 525c5b5 Compare March 31, 2021 19:36
jasons42 added 3 commits July 20, 2021 14:04
The etcdv3 client has a default request send limit of 2.0 MiB. This change
exposes the configuration option to increase that limit enabling larger
state using the etcdv3 backend.

This also requires that the corresponding --max-request-bytes flag be
increased on the server side. The default there is 1.5 MiB.

Fixes hashicorp#25745
Fix website-link-check failing as https://coreos.com/etcd/ 301's to https://etcd.io/. Updated link to https://etcd.io/.
@jasons42 jasons42 force-pushed the configure-etcdv3-client-max-request-size branch from 525c5b5 to 5ff9b76 Compare July 20, 2021 19:06
@jasons42
Copy link
Copy Markdown
Contributor Author

@jbardin Thank you for fixing 28100!

Is it possible to get this merged as well?

Acceptance test output:

TF_ACC=1 TF_ETCDV3_ENDPOINTS=http://127.0.0.1:2379 go test -v ./internal/backend/remote-state/etcdv3
=== RUN   TestBackend_impl
--- PASS: TestBackend_impl (0.00s)
=== RUN   TestBackend
    backend_test.go:40: Cleaned up 0 keys.
    backend_test.go:62: TestBackendConfig on *etcd.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"endpoints":cty.TupleVal([]cty.Value{cty.StringVal("http://127.0.0.1:2379")}), "prefix":cty.StringVal("tf-unit/2021-07-20T14:17:14-05:00/")}}
    backend_test.go:67: TestBackendConfig on *etcd.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"endpoints":cty.TupleVal([]cty.Value{cty.StringVal("http://127.0.0.1:2379")}), "prefix":cty.StringVal("tf-unit/2021-07-20T14:17:14-05:00/")}}
    testing.go:299: TestBackend: testing state locking for *etcd.Backend
    testing.go:299: TestBackend: testing state locking for *etcd.Backend
    backend_test.go:40: Cleaned up 4 keys.
--- PASS: TestBackend (7.81s)
=== RUN   TestBackend_lockDisabled
    backend_test.go:40: Cleaned up 0 keys.
    backend_test.go:85: TestBackendConfig on *etcd.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"endpoints":cty.TupleVal([]cty.Value{cty.StringVal("http://127.0.0.1:2379")}), "lock":cty.False, "prefix":cty.StringVal("tf-unit/2021-07-20T14:17:22-05:00/")}}
    backend_test.go:91: TestBackendConfig on *etcd.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"endpoints":cty.TupleVal([]cty.Value{cty.StringVal("http://127.0.0.1:2379")}), "lock":cty.False, "prefix":cty.StringVal("tf-unit/2021-07-20T14:17:22-05:00//different")}}
    testing.go:299: TestBackend: testing state locking for *etcd.Backend
    testing.go:299: TestBackend: *etcd.Backend: empty string returned for lock, assuming disabled
    backend_test.go:40: Cleaned up 2 keys.
--- PASS: TestBackend_lockDisabled (0.20s)
=== RUN   TestRemoteClient_impl
--- PASS: TestRemoteClient_impl (0.00s)
=== RUN   TestRemoteClient
    backend_test.go:40: Cleaned up 0 keys.
    client_test.go:25: TestBackendConfig on *etcd.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"endpoints":cty.TupleVal([]cty.Value{cty.StringVal("http://127.0.0.1:2379")}), "prefix":cty.StringVal("tf-unit/2021-07-20T14:17:22-05:00/")}}
    backend_test.go:40: Cleaned up 0 keys.
--- PASS: TestRemoteClient (0.32s)
=== RUN   TestEtcdv3_stateLock
    backend_test.go:40: Cleaned up 0 keys.
    client_test.go:47: TestBackendConfig on *etcd.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"endpoints":cty.TupleVal([]cty.Value{cty.StringVal("http://127.0.0.1:2379")}), "prefix":cty.StringVal("tf-unit/2021-07-20T14:17:23-05:00/")}}
    client_test.go:55: TestBackendConfig on *etcd.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"endpoints":cty.TupleVal([]cty.Value{cty.StringVal("http://127.0.0.1:2379")}), "prefix":cty.StringVal("tf-unit/2021-07-20T14:17:23-05:00/")}}
    backend_test.go:40: Cleaned up 1 keys.
--- PASS: TestEtcdv3_stateLock (2.39s)
=== RUN   TestEtcdv3_destroyLock
    backend_test.go:40: Cleaned up 0 keys.
    client_test.go:73: TestBackendConfig on *etcd.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"endpoints":cty.TupleVal([]cty.Value{cty.StringVal("http://127.0.0.1:2379")}), "prefix":cty.StringVal("tf-unit/2021-07-20T14:17:25-05:00/")}}
    backend_test.go:40: Cleaned up 1 keys.
--- PASS: TestEtcdv3_destroyLock (0.25s)
PASS
ok  	github.com/hashicorp/terraform/internal/backend/remote-state/etcdv3	11.331s

@jbardin jbardin removed the request for review from bmcustodio July 20, 2021 19:27
@jbardin
Copy link
Copy Markdown
Member

jbardin commented Jul 20, 2021

LGTM, thanks!

@jbardin jbardin merged commit 570b70b into hashicorp:main Jul 20, 2021
@jasons42
Copy link
Copy Markdown
Contributor Author

@jbardin Thank you! Do you have a rough estimate of when this might make it into a release? I understand if you can't provide that.

@jbardin
Copy link
Copy Markdown
Member

jbardin commented Jul 20, 2021

Hi @jasons42, Since this is a fairly minor change (and I want to get the applicable backend PRs out of the way since there is no maintainer), I'm going to try and get this in an upcoming patch release.

@github-actions
Copy link
Copy Markdown
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Etcdv3 backend. Send message larger than max.

2 participants