-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Updating ingest pipeline without changes is no-op #78196
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
Conversation
Pinging @elastic/es-data-management (Team:Data Management) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
} | ||
ingestService.putPipeline(ingestInfos, request, listener); | ||
}, listener::onFailure)); | ||
nodesInfoRequest.clear().addMetric(NodesInfoRequest.Metric.INGEST.metricName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really part of your change, but since it is touched now, maybe avoid chaining? And instead just:
nodesInfoRequest.clear();
nodesInfoRequest..addMetric(NodesInfoRequest.Metric.INGEST.metricName());
I think that is easier to read.
if (currentIngestMetadata != null && currentIngestMetadata.getPipelines().containsKey(request.getId())) { | ||
pipelineConfig = XContentHelper.convertToMap(request.getSource(), false, request.getXContentType()).v2(); | ||
var currentPipeline = currentIngestMetadata.getPipelines().get(request.getId()); | ||
if (currentPipeline.getConfigAsMap().equals(pipelineConfig)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering whether Maps.deepEquals(...)
be used here? But I don't think that is the case since we never have arrays as value in this map. So this should be good.
|
||
var pipelineId = randomAlphaOfLength(5); | ||
var value = randomAlphaOfLength(5); | ||
var pipelineString = "{\"processors\": [{\"set\" : {\"field\": \"_field\", \"value\": \"" + value + "\"}}]}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe create a variant of this test that creates a random deep map? I don't think PipelineConfiguration
cares about that content being valid.
@elasticmachine update branch |
Thanks, @martijnvg! |
Fixes #77382.