Skip to content

Improvements to the IndicesService class#17638

Closed
abeyad wants to merge 4 commits intoelastic:masterfrom
abeyad:indices-service-improvements
Closed

Improvements to the IndicesService class#17638
abeyad wants to merge 4 commits intoelastic:masterfrom
abeyad:indices-service-improvements

Conversation

@abeyad
Copy link
Copy Markdown

@abeyad abeyad commented Apr 11, 2016

This commit contains the following improvements/fixes:

  1. Renaming method names and variables to better reflect the purpose
    of the method and the semantics of the variable.
  2. For deleting indexes, replace the closed parameter passed to the delete index/store methods with obtaining the index's state from the IndexSettings that is already passed in.
  3. Adding tests to the IndexWithShadowReplicaIT suite, some of which show issues in the shadow replica delete process that are captured in Shadow Replica indexes do not delete properly #17695

This commit contains the following improvements/fixes:
  1. When a shadow replica index is deleted, its index contents is also
deleted.
  2. Renaming method names and variables to better reflect the purpose
of the method and the semantics of the variable.
* This method returns true if the current node is allowed to delete the
* given index. If the index uses a shared filesystem this method always
* returns false.
* This method returns true if the current node is allowed to delete the given index.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should also say we return false if the folder doesn't exist

@abeyad abeyad force-pushed the indices-service-improvements branch from 39fec17 to 89aa0ad Compare April 12, 2016 06:04
@abeyad abeyad force-pushed the indices-service-improvements branch from 89aa0ad to 62b8eca Compare April 12, 2016 16:05
IOUtils.rm(customLocation);
// shared shard data on shared file systems might have already been deleted by another node,
// this can only happen if a shared file system index was closed, then deleted on all nodes
if (Files.exists(customLocation)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I rather not make this change (and if we do, let's name the method "delete*IfExists). If I understand correctly it's only needed for shadow indices, which we agreed to tackle in another PR.

@bleskes
Copy link
Copy Markdown
Contributor

bleskes commented Apr 12, 2016

@abeyad left some initial feedback

@abeyad abeyad force-pushed the indices-service-improvements branch 2 times, most recently from 4768f99 to cc929c8 Compare April 12, 2016 19:04
@abeyad abeyad force-pushed the indices-service-improvements branch from cc929c8 to 8dcc6eb Compare April 13, 2016 02:29
assertIndicesDirsDeleted(nodes);
}

public void testDeletingIndexWithDedicatedMasterNodes() throws Exception {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@bleskes To really test the scenario of dedicated master nodes only with a shadow replica index, it would seem we should simulate the situation where the master nodes don't have the shared data path mounted on its file system. Any thoughts on how to simulate this? Or is it not worth the effort here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we need to get into this now. For now we can remove the test and just keep a test where we have some nodes with no shards assigned to them.

@abeyad
Copy link
Copy Markdown
Author

abeyad commented Apr 13, 2016

@bleskes PR has been updated based on your feedback and our discussion. Mainly, I've just added some tests to IndexWithShadowReplicaIT.

//assertIndicesDirsDeleted(nodes);
}

public void testNodeJoinsWithoutShadowReplicaConfigured() throws Exception {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

++ on adding this.

@bleskes
Copy link
Copy Markdown
Contributor

bleskes commented Apr 13, 2016

Looking good. Left some comments w.r.t tests.

@abeyad abeyad force-pushed the indices-service-improvements branch 2 times, most recently from a12f582 to 51b55c9 Compare April 13, 2016 18:32
@abeyad
Copy link
Copy Markdown
Author

abeyad commented Apr 13, 2016

@abeyad abeyad force-pushed the indices-service-improvements branch from 51b55c9 to 1a3dced Compare April 13, 2016 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants