Skip to content

[FEATURE] Finish/verify max_consecutive_extraction_failures on elasticstack_elasticsearch_ml_datafeed once stack support lands #5026

Open

Description

@edsavage

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:

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 (optional int64, >= 1), mirroring max_empty_searches.
  • Write path: field added to the hand-rolled DatafeedRequest (sent via .Raw()), so it does not depend on the vendored go-elasticsearch typed client gaining the field.
  • Read path: decoded from the raw Get Datafeeds response (the vendored types.MLDatafeed does 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)

  1. Confirm the exact version boundary. The 9.5 backport will land in a specific 9.5.x patch (and 9.6.0). The current gate/skip uses 9.5.0, which is insufficient: released 9.5.0–9.5.x before the backport are >= 9.5.0 but still reject the field. Update:
    • the runtime gate maxConsecutiveExtractionFailuresMinElasticsearch in internal/elasticsearch/ml/datafeed/version_gating.go, and
    • the acc-test skip version datafeedMaxConsecutiveExtractionFailuresMinVersion in internal/elasticsearch/ml/datafeed/acc_test.go,
      to the actual patch that first ships the field (to avoid a CI failure on 9.5.x-without-field).
  2. Run the acceptance test against a stack build that persists the field (TestAccResourceDatafeedMaxConsecutiveExtractionFailures), covering create, update, and import.
  3. Re-check whether the vendored go-elasticsearch types.MLDatafeed has gained the field; if so, the raw-decode read path can optionally be simplified.
  4. 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-elasticsearch release for this field.

Activity

  1. added
    needs-spec
    triaged
    on Sep 30, 2026
  2. github-actions commented on Sep 30, 2026

    @github-actions
    Contributor

    Thanks for filing this! I've added the needs-spec label 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.

  3. added
    enhancement
    on Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementneeds-spectriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions