autokctrl-team opened a new issue, #919:
URL: https://github.com/apache/solr-operator/issues/919

   ## Description
   
   During startup, each Solr pod runs a `setup-zk` initializer 
([`solr_util.go`](https://github.com/apache/solr-operator/blob/ed5c5c7d28a4c1189d19f581259e05385c0d4b20/controllers/util/solr_util.go#L531-L550)).
 The initializer reads `/security.json`; if the file is empty, it later uploads 
the bootstrap configuration using a separate command 
([`solr_security_util.go`](https://github.com/apache/solr-operator/blob/ed5c5c7d28a4c1189d19f581259e05385c0d4b20/controllers/util/solr_security_util.go#L242-L255)).
 There is no version check between the read and write.
   
   With multiple pods starting at once, one initializer can read the empty file 
and be delayed. Another pod can finish initialization, allowing an 
administrator to rotate a password through Solr's Security API. If the delayed 
initializer then continues, it overwrites the newer configuration with its 
stale bootstrap copy. Solr stops accepting the new password and accepts the old 
one again.
   
   ## Steps to reproduce
   
   1. Create a multi-replica `SolrCloud` with Basic Auth enabled and a fresh 
ZooKeeper chroot.
   2. While the Solr pods are starting, wait for one pod to become available 
while another pod is still running its `setup-zk` initializer.
   3. Use Solr's Security API to change the `solr` user's password. Confirm the 
new password works.
   4. After the other pod finishes initialization, test both passwords again 
and check `/security.json` in ZooKeeper.
   
   
   ## Expected behavior
   
   An initializer should not overwrite a security configuration that was 
updated after it read the file. The new password should continue to work after 
all pods finish starting.
   
   ## Observed behavior
   
   After the delayed initializer finishes, the new password returns HTTP 401 
and the old bootstrap password returns HTTP 200. ZooKeeper's `/security.json` 
contains the stale bootstrap configuration.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to