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 README reindexing steps are inaccurate #121237

Closed
cjcenizal opened this issue Dec 14, 2021 · 1 comment · Fixed by #200893
Closed

Upgrade Assistant README reindexing steps are inaccurate #121237

cjcenizal opened this issue Dec 14, 2021 · 1 comment · Fixed by #200893
Assignees
Labels
chore Feature:Upgrade Assistant Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@cjcenizal
Copy link
Contributor

cjcenizal commented Dec 14, 2021

The current README states that reindexing works like this:

  1. Create a new index with a "reindexed-" prefix (#30114).
  2. Create an index alias pointing from the original index name to the prefixed index name.
  3. Reindex from the original index into the prefixed index.
  4. Delete the old index and rename the prefixed index.

Per @yuliacech's comment at #120137 (comment), the correct steps are:

  1. Set index test_data to read-only using the index.blocks.write: true setting
  2. Create new index reindexed-v6.8-test_data
  3. Reindex documents from test_data to reindexed-v6.8-test_data
  4. Create alias test_data that points to reindexed-v6.8-test_data
  5. Delete index test_data

Whoever updates the README should read through https://github.com/elastic/kibana/blob/main/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts and verify what I've stated is correct.

While we're at it, we should also update this comment:

/**
* Sets the original index as readonly so new data can be indexed until the reindex
* is completed.
* @param reindexOp
*/
const setReadonly = async (reindexOp: ReindexSavedObject) => {
const { indexName } = reindexOp.attributes;
const { body: putReadonly } = await esClient.indices.putSettings({
index: indexName,
body: { blocks: { write: true } },
});
if (!putReadonly.acknowledged) {
throw new Error(`Index could not be set to readonly.`);
}
return actions.updateReindexOp(reindexOp, { lastCompletedStep: ReindexStep.readonly });
};

The comment states "so new data can be indexed", but that doesn't make sense because we're setting the index to be read-only. This might have just been a typo.

@cjcenizal cjcenizal added chore Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more Feature:Upgrade Assistant labels Dec 14, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-stack-management (Team:Stack Management)

@sebelga sebelga self-assigned this Dec 20, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 20, 2024
## Summary

Updates overview of Upgrade Assistant's reindexing actions. Also updates
some doc comments.

Close elastic#121237

<img width="1163" alt="Screenshot 2024-11-20 at 12 07 25"
src="https://github.com/user-attachments/assets/2b16e6e2-cee9-456b-b854-26ee658c3648">

---------

Co-authored-by: Rudolf Meijering <[email protected]>
(cherry picked from commit 3a6224f)
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this issue Nov 26, 2024
## Summary

Updates overview of Upgrade Assistant's reindexing actions. Also updates
some doc comments.

Close elastic#121237

<img width="1163" alt="Screenshot 2024-11-20 at 12 07 25"
src="https://github.com/user-attachments/assets/2b16e6e2-cee9-456b-b854-26ee658c3648">

---------

Co-authored-by: Rudolf Meijering <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this issue Dec 12, 2024
## Summary

Updates overview of Upgrade Assistant's reindexing actions. Also updates
some doc comments.

Close elastic#121237

<img width="1163" alt="Screenshot 2024-11-20 at 12 07 25"
src="https://github.com/user-attachments/assets/2b16e6e2-cee9-456b-b854-26ee658c3648">

---------

Co-authored-by: Rudolf Meijering <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:Upgrade Assistant Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants