I use solr 4.8.1 and solrj . When my server comes up it starts solr. If my server run configuration is to delete all data and start again fresh, I unload my solr core and then create it again. During this time, solr comes up.
Solr receives the core unload request while replaying its transaction log.
Any logical behavior would be accepted in this point:
1. Exception that it cannot drop the core because it's in the middle of log replaying.
2. Wait until the log replay is finish and then drop the core.
3. FORCE to drop the core and stop the replay.
4. Provide API so I would know to question solr if it's "busy".
What really happens is the only illogical behavior:
I get a timeout exception but it continues to replay the logs.
core.properties file is deleted, core.properties.unloaded file is created, and the folder is not deleted as I asked (using solrj). I can't delete the folder myself because it's locked, and I'm basically stuck with the core folder but with an unloaded core. I can't create the core again because the folder already exists, and I can't unload the core again because it does not exist!
If solr receives a core unload request during tlog replay, it should either reject it with a dedicated exception (not timeout) or process it fully. Currently it tries to do both and it won't work.