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

Add logic to delete Solr cores as part of instance and bulk delete #40

Open
dsolovay opened this Issue Nov 5, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@dsolovay
Copy link
Owner

dsolovay commented Nov 5, 2016

Currently, Solr cores are left in place if a site is deleted. Functionality can be added to fix this by adding logic to call

http://localhost:8983/solr/admin/cores?action=UNLOAD&deleteIndex=true&deleteInstanceDir=true&core=CORE_NAME

The Solr URL is in the Solr root config, and the name of each core can be pulled from the individual index configurations. The DELETE information screen text should also be updated.

@dsolovay dsolovay added the enhancement label Nov 5, 2016

@AlenPelin

This comment has been minimized.

Copy link
Collaborator

AlenPelin commented Nov 7, 2016

We should be very careful implementing this feature because there could be several instances sharing same Solr Cores. My suggestion is to create popup that asks user for confirmation before proceeding with delete command.

@dsolovay

This comment has been minimized.

Copy link
Owner

dsolovay commented Nov 15, 2016

What if we added a configuration option, Core/Delete/SolrIndexes, and set the default to "False"? This would simplify things for users that used the SIM script to create a number of instances, and would work better with automated scripts.
image

@dsolovay

This comment has been minimized.

Copy link
Owner

dsolovay commented Dec 6, 2016

@AlenPelin What if we only bulk deleted the index if the name of the instance was embedded? So an instance called sc82u1 could delete its indexes if they all started with sc82u1 (e.g. sc82u1_sitecore_master_index, etc.) but could not delete an index called sitecore_master_index. This would make the risk of deleting a shared index extremely slight, and would greatly help a developer who has created a large number of instances and needs to clean up.

This behavior would delete indexes that were created by the plugin, but would not delete indexes that were created by manually enabling the config files.

@AlenPelin

This comment has been minimized.

Copy link
Collaborator

AlenPelin commented Dec 6, 2016

I think we can ask for confirmation before deleting each core the same way as SIM asks before deleting SQL database that is stored out of instance's root folder.
The reason is that Solr cores can be shared between several instances which is not trivial to check.

@dsolovay

This comment has been minimized.

Copy link
Owner

dsolovay commented Dec 6, 2016

The reason is that Solr cores can be shared between several instances which is not trivial to check.

Doesn't checking that the index begins with the instance name solve this problem?

At 15 indexes per instance, prompting on each one will become very tedious, especially if you are cleaning up multiple instances. I had >100 cores at one point.

@AlenPelin

This comment has been minimized.

Copy link
Collaborator

AlenPelin commented Dec 6, 2016

Agree, it makes sense to aggregate indexes by similar prefix and show popups with batches.

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