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

Make sure that index ranges get deleted when an index set is removed #3310

Merged
merged 3 commits into from Jan 9, 2017

Conversation

Projects
None yet
2 participants
@bernd
Member

bernd commented Jan 6, 2017

The old index set cleanup job left the index ranges for the deleted indices behind.

Fixes #3308

@bernd bernd added this to the 2.2.0 milestone Jan 6, 2017

@joschi

This comment has been minimized.

Contributor

joschi commented Jan 9, 2017

Wouldn't it be easier if we simply removed the check in MongoIndexRangeService#handleIndexClosing()?
If a non-managed index is being closed, there shouldn't be an index range for it anyway.

if (!indexSetRegistry.isManagedIndex(index)) {
LOG.debug("Not handling closed index <{}> because it's not managed by any index set.", index);
continue;
}

@joschi joschi self-assigned this Jan 9, 2017

@bernd

This comment has been minimized.

Member

bernd commented Jan 9, 2017

Wouldn't it be easier if we simply removed the check in MongoIndexRangeService#handleIndexClosing()? If a non-managed index is being closed, there shouldn't be an index range for it anyway.

That would be easier but it makes the code even harder to understand. I actually had a hard time to find out how the index ranges get deleted because this works completely different to other *Service classes.

We added the .isManagedIndex() calls to fix #3254, so if we remove it for handleIndexDeletion() it's a special case for the index range cleanup code that makes the whole thing even harder to understand in my opinion.

That's why I prefer to use an explicit remove() method.

@joschi

joschi approved these changes Jan 9, 2017

@joschi joschi merged commit 3b33249 into master Jan 9, 2017

4 checks passed

ci-web-linter Jenkins build graylog-pr-linter-check 1254 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details

@joschi joschi deleted the issue-3308 branch Jan 9, 2017

@joschi joschi removed the ready-for-review label Jan 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment