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

[streams] fork classic stream template #211368

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

klacabane
Copy link
Contributor

@klacabane klacabane commented Feb 16, 2025

When applying mappings or lifecycle changes to an unwired stream we don't want to update the current unmanaged index template for several reasons.
Our solution is to fork the effective template and tweak it slightly to make the streams' layer applicable in a controlled way

This change does:

  • duplicates the effective template with a higher priority and update the index_patterns to only look for the specific unwired stream
  • creates a @stream.layer component template similar to the wired streams. this layer will hold the streams' specific mappings and lifecycle
  • extracts the existing template's lifecycle/settings/mappings to a @base component template so stream's layer can override them
  • enables ilm lifecycle on unwired streams. the related UI changes will be implemented separately

This change does not:

  • implement a way to revert/eject the streams layer
  • add a way to specify mappings for unwired streams

these will be implemented separately

Testing

  • Updating a classic stream lifecycle will trigger a template fork
PUT kbn:/api/streams/my-unwired-stream
{
  "dashboards": [],
  "stream": {
    "ingest": {
      "lifecycle": {
        "dsl": { "data_retention": "1d" } // "ilm": { "policy": "my-policy" }
      },
      "processing": [],
      "routing": [],
      "unwired": {}
    }
  }
}

TODO

  • api tests

@@ -196,16 +197,15 @@ async function ensureStreamManagedPipelineReference(
},
},
};
executionPlan.push({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I replaced the executionPlan logic with elasticsearch calls since it does not seem to do much for now. Happy to revert if there are plans to add more to that construct

@klacabane klacabane added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels Feature:Streams This is the label for the Streams Project v9.1.0 v8.19.0 labels Feb 20, 2025
@klacabane klacabane marked this pull request as ready for review February 20, 2025 15:54
@klacabane klacabane requested a review from a team as a code owner February 20, 2025 15:54
@elasticmachine
Copy link
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #64 / Stateful Observability - Deployment-agnostic API integration tests Streams Endpoints Lifecycle Unwired streams allows ilm lifecycle on unwired streams
  • [job] [logs] FTR Configs #64 / Stateful Observability - Deployment-agnostic API integration tests Streams Endpoints Lifecycle Unwired streams allows ilm lifecycle on unwired streams

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:Streams This is the label for the Streams Project release_note:skip Skip the PR/issue when compiling release notes v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants