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

Open
cjcenizal opened this issue Dec 14, 2021 · 1 comment
Open

Upgrade Assistant README reindexing steps are inaccurate #121237

cjcenizal opened this issue Dec 14, 2021 · 1 comment
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
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

No branches or pull requests

3 participants