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

Add auto follow pattern challenge #734

47 changes: 47 additions & 0 deletions elastic/logs/challenges/auto-follow-pattern.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{% import "rally.helpers" as rally %}
{% set p_follow_index_pattern = "copy-{{leader_index}}" %}
{
"name": "auto-follow-pattern",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use a better name for the challenge...something that reminds what this does? Something like "ccr-shard-recovery". I guess this track is not only useful for synthetic source... but probably it would provide useful info in Serverless too where we probably retrieve data from S3?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use a better name for the challenge...something that reminds what this does?

+1 - I will add ccr replication to the name and add a description.

. I guess this track is not only useful for synthetic source... but probably it would provide useful info in Serverless too where we probably retrieve data from S3?

IIRC CCR currently only works in stateful. To keep the follower indices up to date it relies on operation based replication, which doesn't exist in serverless.

"description": "",
"default": false,
"schedule": [
{# non-serverless-index-statistics-marker-start #}{%- if build_flavor != "serverless" or serverless_operator == true -%}
{
"name": "setup-remote-for-local",
"operation": {
"operation-type": "setup-local-remote"
}
},
{
"name": "put_auto_follow_pattern",
"operation": {
"operation-type": "raw-request",
"path": "/_ccr/auto_follow/my_pattern",
"method": "PUT",
"body": {
"remote_cluster": "local",
"leader_index_patterns": ["logs-*"],
"follow_index_pattern": "{{ p_follow_index_pattern }}"
}
}
},
{% include "tasks/index-setup.json" %},
{%- endif -%}{# non-serverless-index-statistics-marker-end #}
{
"name": "bulk-index",
"operation": {
"operation-type": "raw-bulk",
"param-source": "processed-source",
"time-format": "milliseconds",
"profile": "fixed_interval",
"bulk-size": {{ p_bulk_size }},
"detailed-results": true
},
"clients": {{ p_bulk_indexing_clients }}{% if p_throttle_indexing %},
"ignore-response-error-level": "{{error_level | default('non-fatal')}}",
"schedule": "timestamp-throttler",
"max-delay-secs": 1
{% endif %}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
{% if index_mode %}
"index": {
"mode": {{ index_mode | tojson }}
{% if codec %}
,"codec": {{codec | tojson}}
{% endif %}
{% if source_mode %}
,"mapping.source.mode": {{ source_mode | tojson }}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"template": {
"settings": {
"index": {
"codec": "best_compression",
"mapping": {
"total_fields": {
"limit": "10000"
Expand Down
12 changes: 12 additions & 0 deletions elastic/logs/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@
from shared.track_processors.track_id_generator import TrackIdGenerator


async def setup_local_remote(es, params):
response = await es.cluster.state()
master_node = response["master_node"]
response = await es.nodes.info()
ip = response["nodes"][master_node]["transport_address"]
b = {"cluster.remote.local.seeds": ip}
response = await es.cluster.put_settings(persistent=b)
return {"weight": 1, "unit": "ops"}


def register(registry):
registry.register_param_source("initial-indices-source", InitialIndicesParamSource)
registry.register_param_source("add-track-path", parameter_sources.add_track_path)
Expand Down Expand Up @@ -88,3 +98,5 @@ def register(registry):
registry.register_runner("configure-remote-clusters", ConfigureRemoteClusters(), async_runner=True)
registry.register_runner("configure-ccr", ConfigureCrossClusterReplication(), async_runner=True)
registry.register_runner("multi-cluster-wrapper", MultiClusterWrapper(), async_runner=True)

registry.register_runner("setup-local-remote", setup_local_remote, async_runner=True)