-
Notifications
You must be signed in to change notification settings - Fork 307
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
Support legacy template api in elasticsearch 8 #1092
Support legacy template api in elasticsearch 8 #1092
Conversation
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.
Implementation looks clean and sensible.
I'd like to take a small step back and discuss the interface that we are exposing to the user
Right now the interface of this centered on the old template api:
template_legacy => true
: use the old thingtemplate_legacy => false
: don't use the old thingtemplate_legacy => auto
: use the old thing sometimes?
If we are stuck on a boolean-with-auto, I would prefer to either invert the setting to be centered on the new API, so that a user can tell us:
template_modern => true
to use the new thingtemplate_modern => false
to not use the new thingtemplate_modern => auto
to assume which one to use
But even this introduces terminology like "modern" not found in Elasticsearch documentation, and I particularly don't like "boolean" options with 3+ choices.
Elasticsearch mainly describes V2 templates as just plain "Index templates" (often in direct opposition to "legacy templates"), but it also uses "composable" to refer to the v2 templates when describing how they interact with the legacy templates:
Composable templates take precedence over legacy templates. If no composable template matches a given index, a legacy template may still match and be applied.
Maybe template_format
with options legacy
, composable
, and auto
?
template_format => legacy
: use the old thingtemplate_format => composable
: use the new thingtemplate_format => auto
: idk just do your best?
Or similarly template_api
?
template_api => legacy
: use the old thingtemplate_api => composable
: use the new thingtemplate_api => auto
: idk just do your best?
Separately, when the effective value is auto
, and we are talking to an ES7, I think we should emit a deprecation notice informing the user that they should either "lock in" legacy templates in advance of upgrading any part of their stack, or that they should migrate to composable templates.
|
Co-authored-by: Ry Biesemeyer <[email protected]>
Co-authored-by: Ry Biesemeyer <[email protected]>
@mashhurs The reason I avoid adding |
45ed6ab
to
bbd58ee
Compare
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.
Implementation looks great. I have a couple of suggestions on wording for both the log warning and the docs page.
Co-authored-by: Ry Biesemeyer <[email protected]>
Co-authored-by: Ry Biesemeyer <[email protected]>
…asticsearch into support_legacy_template_ES8 # Conflicts: # CHANGELOG.md # logstash-output-elasticsearch.gemspec
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
Fixed: #1088
Prior to the change, the plugin uses legacy API for ES 7.x and forces to use index template API for ES 8.x. However, legacy template API is still available in ES 8 and user should be allowed to use it.
This commit adds a new flag
template_api
to control which API to use. The available value isauto
,legacy
andcomposable
. The default value isauto
.auto
Logstash detect the version of Elasticsearch. It uses index template API for 8 and legacy API for 7.legacy
use legacy APIcomposable
use index template API