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

Remove _state directory if index has been deleted #8610

Merged
merged 1 commit into from Nov 24, 2014

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Nov 22, 2014

Today we try to delete the index directory if all shard locks have been
acquired. Yet, if this fails due to still running recoveries etc. We might
re-import the index as dangeling which also can happen if the node is restarted.
In contrast to the shard direcotries we can safely delete the metastate which is used
to import dangling indices while leaving the shard directories untouched.

try {
MetaDataStateFormat.deleteMetaState(nodeEnv.indexPaths(index));
} catch (IOException ex) {
logger.warn("Failed to delete metas-tate for index {}", ex, index);
Copy link
Member

Choose a reason for hiding this comment

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

metas-tate -> meta-state

Copy link
Member

Choose a reason for hiding this comment

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

I also think we should re-throw the exception here and not silently fail

@dakrone
Copy link
Member

dakrone commented Nov 24, 2014

Left really minor comments but LGTM

@s1monw
Copy link
Contributor Author

s1monw commented Nov 24, 2014

@dakrone can you take another look?

@dakrone
Copy link
Member

dakrone commented Nov 24, 2014

LGTM, thanks for making the changes!

Today we try to delete the index directory if all shard locks have been
acquired. Yet, if this fails due to still running recoveries etc. We might
re-import the index as dangeling which also can happen if the node is restarted.
In contrast to the shard direcotries we can safely delete the metastate which is used
to import dangling indices while leaving the shard directories untouched.
@s1monw s1monw merged commit 043b37d into elastic:master Nov 24, 2014
@s1monw s1monw deleted the delete_index_state branch November 24, 2014 15:05
@clintongormley clintongormley added :Core/Infra/Core Core issues without another label and removed review labels Mar 19, 2015
@clintongormley clintongormley changed the title [GATEWAY] Remove _state directory if index has been deleted Remove _state directory if index has been deleted Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/Core Core issues without another label v1.5.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants