[ 
https://issues.apache.org/jira/browse/SOLR-10719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16019710#comment-16019710
 ] 

Erick Erickson commented on SOLR-10719:
---------------------------------------

[~romseygeek] There's no question that this is wrong. Yes, the ADDREPLICA 
succeeds. I looked at it quickly and the replica is even up and running. Until 
you restart solr then core.properties is not found, the core is not discovered 
and people are left wondering what happened. If you manually reconstruct the 
core.properties file at the destination of the symlink and restart, the core is 
alive and healthy. This is not theoretical BTW, it happened "in the field".

It's particularly scary when you then DELETEREPLICA because you see your new 
replica active. It takes over leadership and everything.

This worked in earlier versions of Solr.

Files.createDirectories throws an exception "file already exists" IIRC, but 
it's swallowed, doesn't propagate back up the stack.

So there are two issues here I suppose:
1> should we follow symlinks (I think we should)
2> should failing to write core.properties files cause the ADDREPLICA to fail 
(I think it should).

Maybe break <2> out into a new JIRA?



> ADDREPLICA fails if the instanceDir is a symlink
> ------------------------------------------------
>
>                 Key: SOLR-10719
>                 URL: https://issues.apache.org/jira/browse/SOLR-10719
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Erick Erickson
>            Assignee: Erick Erickson
>
> Well, it doesn't actually fail until you try to restart the Solr instance. 
> The root is that creating core.properties fails.
> This is due to SOLR-8260. CorePropertiesLocator.writePropertiesFile changed 
> from:
> propfile.getParentFile().mkdirs();
> to
> Files.createDirectories(propfile.getParent());
> The former (apparently) thinks it's OK if a symlink points to a directory, 
> but the latter throws an exception.
> So the behavior here is that the call appears to succeed, the replica is 
> created and is functional. Until you restart the instance when it's not 
> discovered.
> I hacked in a simple test to see if the parent existed already and skip the 
> call to createDirectories if so and ADDREPLICA works just fine. Restarting 
> Solr finds the replica.
> The test "for real" would probably have to be better than this as we probably 
> really want to keep from overwriting an existing replica and the like, didn't 
> check whether that's already accounted for though.
> There's another issue here that failing to write the properties file should 
> fail the ADDREPLICA IMO.
> [~romseygeek] I'm guessing that this is an unintended side-effect of 
> SOLR-8260 but wanted to check before diving in deeper.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to