Repository navigation
Description
Name of the resource
elasticstack_elasticsearch_ml_datafeed
Summary
Provider support for the datafeed max_consecutive_extraction_failures field has been implemented and parked on branch datafeed-max-consecutive-extraction-failures (not merged), pending the upstream stack reintroduction of the feature. This issue tracks finishing and verifying it once a stack build actually persists the field.
Why it's parked (blocker)
The feature is being reintroduced across the stack after an earlier spec revert, but as of writing none of the upstream changes are merged/released:
- Reintroduce datafeed max_consecutive_extraction_failures elasticsearch#160601 — Reintroduce datafeed
max_consecutive_extraction_failures(basemain) — OPEN - [ML] Do not persist datafeed failure-stop field on 9.4 elasticsearch#160602 — Do not persist datafeed failure-stop field on 9.4 (base
9.4) — OPEN - [ML] Do not persist datafeed failure-stop field on 8.19 elasticsearch#160603 — Do not persist datafeed failure-stop field on 8.19 (base
8.19) — OPEN - Reintroduce max_consecutive_extraction_failures datafeed spec elasticsearch-specification#6671 — Reintroduce
max_consecutive_extraction_failuresdatafeed spec — not released
Verified empirically that no available ES build has the field yet: a fresh Elasticsearch 9.5.3 rejects it with:
PUT _ml/datafeeds/... {"max_consecutive_extraction_failures": 7}
→ 400 x_content_parse_exception: unknown field [max_consecutive_extraction_failures]
What is already implemented on the branch
- Schema attribute
max_consecutive_extraction_failures(optionalint64,>= 1), mirroringmax_empty_searches. - Write path: field added to the hand-rolled
DatafeedRequest(sent via.Raw()), so it does not depend on the vendoredgo-elasticsearchtyped client gaining the field. - Read path: decoded from the raw Get Datafeeds response (the vendored
types.MLDatafeeddoes not expose it). - Runtime version gate: create/update call
EnforceMinVersion(9.5.0)and error clearly on older stacks (8.19/9.4 accept-but-don't-persist, which would otherwise cause a permanent diff). Serverless short-circuits to supported. - Version-gated acceptance test (
TestAccResourceDatafeedMaxConsecutiveExtractionFailures), unit test, docs, examples, OpenSpec spec (REQ-036), and CHANGELOG entry.
Remaining work (do this once stack support ships)
- Confirm the exact version boundary. The 9.5 backport will land in a specific
9.5.xpatch (and9.6.0). The current gate/skip uses9.5.0, which is insufficient: released9.5.0–9.5.xbefore the backport are>= 9.5.0but still reject the field. Update:- the runtime gate
maxConsecutiveExtractionFailuresMinElasticsearchininternal/elasticsearch/ml/datafeed/version_gating.go, and - the acc-test skip version
datafeedMaxConsecutiveExtractionFailuresMinVersionininternal/elasticsearch/ml/datafeed/acc_test.go,
to the actual patch that first ships the field (to avoid a CI failure on9.5.x-without-field).
- the runtime gate
- Run the acceptance test against a stack build that persists the field (
TestAccResourceDatafeedMaxConsecutiveExtractionFailures), covering create, update, and import. - Re-check whether the vendored
go-elasticsearchtypes.MLDatafeedhas gained the field; if so, the raw-decode read path can optionally be simplified. - Rebase/merge the parked branch and update the CHANGELOG PR reference.
Version Introduced
Elasticsearch 9.5 / 9.6 (per elastic/elasticsearch#160601; exact 9.5.x patch TBD). Not persisted on 8.19 / 9.4 by design (#160602 / #160603).
Anything else?
- Feature was previously added then reverted upstream; #160601 is the "revert the revert" with cross-version wire handling.
- The provider deliberately bypasses the typed client for datafeed read/write, so there is no hard dependency on a
go-elasticsearchrelease for this field.
Activity
github-actions commentedon Sep 30, 2026
Thanks for filing this! I've added the
needs-speclabel to this issue.This issue already describes both the problem and the intended solution in a lot of detail — the schema attribute, write/read paths, version-gating approach, and a clear list of remaining steps (confirming the exact ES version boundary, running the acceptance test once stack support lands, rebasing/merging the parked branch) act as ready-made acceptance criteria. That's enough for a maintainer to move it straight into implementation planning once the upstream Elasticsearch changes ship, without needing a separate research phase.
If I've misclassified this or you have additional context, please leave a comment — a maintainer can adjust the label manually.