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

ILM setup misleads user when check_exists is false #24046

Closed
adriansr opened this issue Feb 15, 2021 · 2 comments · Fixed by #24480
Closed

ILM setup misleads user when check_exists is false #24046

adriansr opened this issue Feb 15, 2021 · 2 comments · Fixed by #24480
Assignees
Labels
bug discuss Issue needs further discussion. Team:Elastic-Agent Label for the Agent team

Comments

@adriansr
Copy link
Contributor

adriansr commented Feb 15, 2021

When a Beat is run with setup.ilm.check_exists: false

It prints:

INFO	[index-management]	idxmgmt/std.go:309	Write alias successfully generated.

However, that is not true, as the function creating the write alias is silently skipping the creation of the index due to check_exists being false:

  if err := m.ilm.EnsureAlias(); err != nil {
	  if ilm.ErrReason(err) != ilm.ErrAliasAlreadyExists {
		  return err
	  }
	  log.Info("Write alias exists already")
  } else {
	  log.Info("Write alias successfully generated.")
  }
[...]
func (m *stdManager) EnsureAlias() error {
	if !m.checkExists {
		return nil
	}

	b, err := m.client.HasAlias(m.alias.Name)
	if err != nil {
		return err
	}
	if b {
		return nil
	}

	// This always assume it's a date pattern by sourrounding it by <...>
	return m.client.CreateAlias(m.alias)
}

In the scenario were ILM is not setup properly, this will result in the write index not being created. An index named after the write index created instead.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 15, 2021
@adriansr adriansr added Team: Ingest Team:Services (Deprecated) Label for the former Integrations-Services team labels Feb 15, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 15, 2021
@adriansr adriansr added bug discuss Issue needs further discussion. labels Feb 15, 2021
@andresrc andresrc added Team:Elastic-Agent Label for the Agent team and removed Team: Ingest Team:Services (Deprecated) Label for the former Integrations-Services team labels Feb 15, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug discuss Issue needs further discussion. Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants