-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Remove auto
option from setup.ilm.enabled
and set the default value to true
#28671
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ import ( | |
|
||
// ClientHandler defines the interface between a remote service and the Manager. | ||
type ClientHandler interface { | ||
CheckILMEnabled(Mode) (bool, error) | ||
CheckILMEnabled(bool) (bool, error) | ||
|
||
HasAlias(name string) (bool, error) | ||
CreateAlias(alias Alias) error | ||
|
@@ -92,40 +92,29 @@ func NewFileClientHandler(c FileClient) *FileClientHandler { | |
} | ||
|
||
// CheckILMEnabled indicates whether or not ILM is supported for the configured mode and ES instance. | ||
func (h *ESClientHandler) CheckILMEnabled(mode Mode) (bool, error) { | ||
if mode == ModeDisabled { | ||
func (h *ESClientHandler) CheckILMEnabled(enabled bool) (bool, error) { | ||
if !enabled { | ||
return false, nil | ||
} | ||
|
||
avail, probe := checkILMVersion(mode, h.client.GetVersion()) | ||
if !avail { | ||
if mode == ModeEnabled { | ||
ver := h.client.GetVersion() | ||
return false, errf(ErrESVersionNotSupported, | ||
"Elasticsearch %v does not support ILM", ver.String()) | ||
} | ||
return false, nil | ||
} | ||
|
||
if !probe { | ||
// version potentially supports ILM, but mode + version indicates that we | ||
// want to disable ILM support. | ||
return false, nil | ||
ver := h.client.GetVersion() | ||
ruflin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if !checkILMVersion(h.client.GetVersion()) { | ||
return false, errf(ErrESVersionNotSupported, "Elasticsearch %v does not support ILM", ver.String()) | ||
} | ||
|
||
avail, enabled, err := h.checkILMSupport() | ||
avail, enabledILM, err := h.checkILMSupport() | ||
if err != nil { | ||
return false, err | ||
} | ||
|
||
if !avail { | ||
if mode == ModeEnabled { | ||
if enabledILM { | ||
return false, errOf(ErrESVersionNotSupported) | ||
} | ||
return false, nil | ||
} | ||
|
||
if !enabled && mode == ModeEnabled { | ||
if !enabledILM && enabled { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if |
||
return false, errOf(ErrESILMDisabled) | ||
} | ||
return enabled, nil | ||
|
@@ -244,18 +233,14 @@ func (h *ESClientHandler) queryFeatures(to interface{}) (int, error) { | |
} | ||
|
||
// CheckILMEnabled indicates whether or not ILM is supported for the configured mode and client version. | ||
func (h *FileClientHandler) CheckILMEnabled(mode Mode) (bool, error) { | ||
if mode == ModeDisabled { | ||
return false, nil | ||
} | ||
avail, probe := checkILMVersion(mode, h.client.GetVersion()) | ||
if avail { | ||
return probe, nil | ||
} | ||
if mode != ModeEnabled { | ||
func (h *FileClientHandler) CheckILMEnabled(enabled bool) (bool, error) { | ||
if !enabled { | ||
return false, nil | ||
} | ||
version := h.client.GetVersion() | ||
if checkILMVersion(version) { | ||
return enabled, nil | ||
} | ||
return false, errf(ErrESVersionNotSupported, | ||
"Elasticsearch %v does not support ILM", version.String()) | ||
} | ||
|
@@ -287,11 +272,6 @@ func (h *FileClientHandler) HasAlias(name string) (bool, error) { | |
// avail: indicates whether version supports ILM | ||
// probe: in case version potentially supports ILM, check the combination of mode + version | ||
// to indicate whether or not ILM support should be enabled or disabled | ||
func checkILMVersion(mode Mode, ver common.Version) (avail, probe bool) { | ||
avail = !ver.LessThan(esMinILMVersion) | ||
if avail { | ||
probe = (mode == ModeEnabled) || | ||
(mode == ModeAuto && !ver.LessThan(esMinDefaultILMVersion)) | ||
} | ||
return avail, probe | ||
func checkILMVersion(ver common.Version) (avail bool) { | ||
return !ver.LessThan(esMinILMVersion) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just checked in the code what There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So let's clean this up 👍🏼 |
||
} |
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.
As a follow up: As we only have data streams in 8.0, the rollover_alias config can be removed. Deprecate in 7.x?
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.
👍