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

[Upgrade Assistant] Minimize reindex attributes used to create credential hash #123727

Merged
merged 4 commits into from
Jan 26, 2022

Conversation

alisonelizabeth
Copy link
Contributor

@alisonelizabeth alisonelizabeth commented Jan 25, 2022

Fixes #123616

It was determined that the reindexOp SO attributes were changing from the time the credentials are initially set to when the reindex worker requests them.

The diff was caused by the addition of the openAndClose parameter. I believe this is related to changes made in #59890 (originally implemented via #58890).

For now, I am excluding the reindexOptions from the credential hash. This seems like the least obtrusive change given the time constraints. I've opened #123752 as a follow-up issue to continue investigating and potentially consider updating the credential store with the updated reindexOptions as an alternative.

How to test

Steps to reproduce are listed in #123616. Note that Kibana must be stopped/restarted on the third step of the reindexing process - "Reindex documents" - in order to reproduce.

With this change, you should be able to click "Resume reindexing" and the reindexing process will finish successfully.

There are some existing functional tests that run through the reindexing flow, as well as jest tests for the credential store. I'm not sure if there's a good way to test this specific scenario by restarting Kibana.

@alisonelizabeth alisonelizabeth added bug Fixes for quality problems that affect the customer experience Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes Feature:Upgrade Assistant v7.17.0 labels Jan 25, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/platform-deployment-management (Team:Deployment Management)

Copy link
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

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

Tested locally and works as expected! 👍

I did find though another issue while testing but not a blocker on this fix. I created #123816 for it.

createHash('sha256')
.update(stringify({ id: reindexOp.id, ...reindexOp.attributes }))
const getHash = (reindexOp: ReindexSavedObject) => {
const { reindexOptions, ...attributes } = reindexOp.attributes;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a comment to mention that we exclude the reindexOptions for now as it creates an unstable hash. This needs to be investigated (with link to #123752)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 thanks for the reminder! Meant to do this and forgot to push it up.

@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

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

code changes lgtm, tested locally 🚀

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@alisonelizabeth alisonelizabeth merged commit bf12062 into elastic:7.17 Jan 26, 2022
@alisonelizabeth alisonelizabeth deleted the bugfix/ua/reindex_loop branch January 26, 2022 17:42
alisonelizabeth added a commit to alisonelizabeth/kibana that referenced this pull request Jan 26, 2022
alisonelizabeth added a commit to alisonelizabeth/kibana that referenced this pull request Jan 27, 2022
alisonelizabeth added a commit that referenced this pull request Jan 27, 2022
awahab07 pushed a commit to awahab07/kibana that referenced this pull request Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Upgrade Assistant release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.17.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants