-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add the simple strategy to cluster settings #49414
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
Changes from all commits
5974a13
1ff6d8a
0126003
c140e6f
d64c97c
a8d1844
25ebe5f
0557075
edefed3
7a2804c
1a55a1e
1b245d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,212 @@ | ||
| --- | ||
| "Add transient remote cluster in simple mode with invalid sniff settings": | ||
| - do: | ||
| cluster.get_settings: | ||
| include_defaults: true | ||
|
|
||
| - set: { defaults.cluster.remote.my_remote_cluster.seeds.0: remote_ip } | ||
|
|
||
| - do: | ||
| catch: bad_request | ||
| cluster.put_settings: | ||
| flat_settings: true | ||
| body: | ||
| transient: | ||
| cluster.remote.test_remote_cluster.mode: "simple" | ||
| cluster.remote.test_remote_cluster.sniff.node_connections: "5" | ||
| cluster.remote.test_remote_cluster.simple.addresses: $remote_ip | ||
|
|
||
| - match: { status: 400 } | ||
| - match: { error.root_cause.0.type: "illegal_argument_exception" } | ||
| - match: { error.root_cause.0.reason: "Setting \"cluster.remote.test_remote_cluster.sniff.node_connections\" cannot be | ||
| used with the configured \"cluster.remote.test_remote_cluster.mode\" [required=SNIFF, configured=SIMPLE]" } | ||
|
|
||
| - do: | ||
| catch: bad_request | ||
| cluster.put_settings: | ||
| flat_settings: true | ||
| body: | ||
| transient: | ||
| cluster.remote.test_remote_cluster.mode: "simple" | ||
| cluster.remote.test_remote_cluster.sniff.seeds: $remote_ip | ||
| cluster.remote.test_remote_cluster.simple.addresses: $remote_ip | ||
|
|
||
| - match: { status: 400 } | ||
| - match: { error.root_cause.0.type: "illegal_argument_exception" } | ||
| - match: { error.root_cause.0.reason: "Setting \"cluster.remote.test_remote_cluster.sniff.seeds\" cannot be | ||
| used with the configured \"cluster.remote.test_remote_cluster.mode\" [required=SNIFF, configured=SIMPLE]" } | ||
|
|
||
| --- | ||
| "Add transient remote cluster in sniff mode with invalid simple settings": | ||
| - do: | ||
| cluster.get_settings: | ||
| include_defaults: true | ||
|
|
||
| - set: { defaults.cluster.remote.my_remote_cluster.seeds.0: remote_ip } | ||
|
|
||
| - do: | ||
| catch: bad_request | ||
| cluster.put_settings: | ||
| flat_settings: true | ||
| body: | ||
| transient: | ||
| cluster.remote.test_remote_cluster.simple.socket_connections: "20" | ||
| cluster.remote.test_remote_cluster.sniff.seeds: $remote_ip | ||
|
|
||
| - match: { status: 400 } | ||
| - match: { error.root_cause.0.type: "illegal_argument_exception" } | ||
| - match: { error.root_cause.0.reason: "Setting \"cluster.remote.test_remote_cluster.simple.socket_connections\" cannot be | ||
| used with the configured \"cluster.remote.test_remote_cluster.mode\" [required=SIMPLE, configured=SNIFF]" } | ||
|
|
||
| - do: | ||
| catch: bad_request | ||
| cluster.put_settings: | ||
| flat_settings: true | ||
| body: | ||
| transient: | ||
| cluster.remote.test_remote_cluster.simple.addresses: $remote_ip | ||
| cluster.remote.test_remote_cluster.sniff.seeds: $remote_ip | ||
|
|
||
| - match: { status: 400 } | ||
| - match: { error.root_cause.0.type: "illegal_argument_exception" } | ||
| - match: { error.root_cause.0.reason: "Setting \"cluster.remote.test_remote_cluster.simple.addresses\" cannot be | ||
| used with the configured \"cluster.remote.test_remote_cluster.mode\" [required=SIMPLE, configured=SNIFF]" } | ||
|
|
||
| --- | ||
| "Add transient remote cluster using simple connection mode using valid settings": | ||
| - do: | ||
| cluster.get_settings: | ||
| include_defaults: true | ||
|
|
||
| - set: { defaults.cluster.remote.my_remote_cluster.seeds.0: remote_ip } | ||
|
|
||
| - do: | ||
| cluster.put_settings: | ||
| flat_settings: true | ||
| body: | ||
| transient: | ||
| cluster.remote.test_remote_cluster.mode: "simple" | ||
| cluster.remote.test_remote_cluster.simple.socket_connections: "3" | ||
| cluster.remote.test_remote_cluster.simple.addresses: $remote_ip | ||
|
|
||
| - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "simple"} | ||
| - match: {transient.cluster\.remote\.test_remote_cluster\.simple\.socket_connections: "3"} | ||
| - match: {transient.cluster\.remote\.test_remote_cluster\.simple\.addresses: $remote_ip} | ||
|
|
||
| - do: | ||
| search: | ||
| rest_total_hits_as_int: true | ||
| index: test_remote_cluster:test_index | ||
|
|
||
| - is_false: num_reduce_phases | ||
| - match: {_clusters.total: 1} | ||
| - match: {_clusters.successful: 1} | ||
| - match: {_clusters.skipped: 0} | ||
| - match: { _shards.total: 3 } | ||
| - match: { hits.total: 6 } | ||
| - match: { hits.hits.0._index: "test_remote_cluster:test_index" } | ||
|
|
||
| --- | ||
| "Add transient remote cluster using sniff connection mode using valid settings": | ||
| - do: | ||
| cluster.get_settings: | ||
| include_defaults: true | ||
|
|
||
| - set: { defaults.cluster.remote.my_remote_cluster.seeds.0: remote_ip } | ||
|
|
||
| - do: | ||
| cluster.put_settings: | ||
| flat_settings: true | ||
| body: | ||
| transient: | ||
| cluster.remote.test_remote_cluster.mode: "sniff" | ||
| cluster.remote.test_remote_cluster.sniff.node_connections: "3" | ||
| cluster.remote.test_remote_cluster.sniff.seeds: $remote_ip | ||
|
|
||
| - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "sniff"} | ||
| - match: {transient.cluster\.remote\.test_remote_cluster\.sniff\.node_connections: "3"} | ||
| - match: {transient.cluster\.remote\.test_remote_cluster\.sniff\.seeds: $remote_ip} | ||
|
|
||
| - do: | ||
| search: | ||
| rest_total_hits_as_int: true | ||
| index: test_remote_cluster:test_index | ||
|
|
||
| - is_false: num_reduce_phases | ||
| - match: {_clusters.total: 1} | ||
| - match: {_clusters.successful: 1} | ||
| - match: {_clusters.skipped: 0} | ||
| - match: { _shards.total: 3 } | ||
| - match: { hits.total: 6 } | ||
| - match: { hits.hits.0._index: "test_remote_cluster:test_index" } | ||
|
|
||
| --- | ||
| "Switch connection mode for configured cluster": | ||
| - do: | ||
| cluster.get_settings: | ||
| include_defaults: true | ||
|
|
||
| - set: { defaults.cluster.remote.my_remote_cluster.seeds.0: remote_ip } | ||
|
|
||
| - do: | ||
| cluster.put_settings: | ||
| flat_settings: true | ||
| body: | ||
| transient: | ||
| cluster.remote.test_remote_cluster.mode: "sniff" | ||
| cluster.remote.test_remote_cluster.sniff.seeds: $remote_ip | ||
|
|
||
| - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "sniff"} | ||
| - match: {transient.cluster\.remote\.test_remote_cluster\.sniff\.seeds: $remote_ip} | ||
|
|
||
| - do: | ||
| search: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this might fail as switching the remote connection mode does not wait for 10 seconds for the new connections to be established. I think we should adapt the waiting logic to take this into account.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So you want me to just always wait? Setting aside the mode, any change to a remote cluster config through settings will involve the connection being torn down and rebuilt.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made a change in remote cluster service to always wait. The update method will complete the listener before returning if the connection is being destroyed or unchanged (meaning no wait.) |
||
| rest_total_hits_as_int: true | ||
| index: test_remote_cluster:test_index | ||
|
|
||
| - is_false: num_reduce_phases | ||
| - match: {_clusters.total: 1} | ||
| - match: {_clusters.successful: 1} | ||
| - match: {_clusters.skipped: 0} | ||
| - match: { _shards.total: 3 } | ||
| - match: { hits.total: 6 } | ||
| - match: { hits.hits.0._index: "test_remote_cluster:test_index" } | ||
|
|
||
| - do: | ||
| catch: bad_request | ||
| cluster.put_settings: | ||
| flat_settings: true | ||
| body: | ||
| transient: | ||
| cluster.remote.test_remote_cluster.mode: "simple" | ||
| cluster.remote.test_remote_cluster.simple.addresses: $remote_ip | ||
|
|
||
| - match: { status: 400 } | ||
| - match: { error.root_cause.0.type: "illegal_argument_exception" } | ||
| - match: { error.root_cause.0.reason: "Setting \"cluster.remote.test_remote_cluster.sniff.seeds\" cannot be | ||
| used with the configured \"cluster.remote.test_remote_cluster.mode\" [required=SNIFF, configured=SIMPLE]" } | ||
|
|
||
| - do: | ||
| cluster.put_settings: | ||
| flat_settings: true | ||
| body: | ||
| transient: | ||
| cluster.remote.test_remote_cluster.mode: "simple" | ||
| cluster.remote.test_remote_cluster.sniff.seeds: null | ||
| cluster.remote.test_remote_cluster.simple.addresses: $remote_ip | ||
|
|
||
| - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "simple"} | ||
| - match: {transient.cluster\.remote\.test_remote_cluster\.simple\.addresses: $remote_ip} | ||
|
|
||
| - do: | ||
| search: | ||
| rest_total_hits_as_int: true | ||
| index: test_remote_cluster:test_index | ||
|
|
||
| - is_false: num_reduce_phases | ||
| - match: {_clusters.total: 1} | ||
| - match: {_clusters.successful: 1} | ||
| - match: {_clusters.skipped: 0} | ||
| - match: { _shards.total: 3 } | ||
| - match: { hits.total: 6 } | ||
| - match: { hits.hits.0._index: "test_remote_cluster:test_index" } | ||
Uh oh!
There was an error while loading. Please reload this page.