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

   ## Description
   
   A managed rolling update can make a shard unavailable for writes when the 
shard has one `NRT` or `TLOG` replica and one `PULL` replica. The operator 
counts the active `PULL` replica toward the shard availability budget and can 
select the pod hosting the only leader-eligible replica for deletion.
   
   `PULL` replicas do not participate in leader election. If the only `NRT` or 
`TLOG` replica goes down, the shard has no replica that can accept writes until 
that pod returns.
   
   The operator's [replica 
accounting](https://github.com/apache/solr-operator/blob/ed5c5c7d28a4c1189d19f581259e05385c0d4b20/controllers/util/solr_update_util.go#L394-L468)
 does not distinguish `PULL` from `NRT` or `TLOG`. The [managed-update 
selection 
path](https://github.com/apache/solr-operator/blob/ed5c5c7d28a4c1189d19f581259e05385c0d4b20/controllers/util/solr_update_util.go#L245-L291)
 uses these counts when deciding that a pod is safe to delete.
   
   ## Steps to reproduce
   
   1. Create a two-pod `SolrCloud` with persistent storage and the default 
managed update policy.
   2. Create one collection with one shard, one `NRT` replica, and one `PULL` 
replica. Place the `NRT` replica on `pod-0` and the `PULL` replica on `pod-1`.
   3. Send a successful update to the collection through the common Solr 
Service.
   4. Change a StatefulSet pod annotation in the `SolrCloud` to trigger a 
managed rolling update.
   5. Observe the operator select `pod-0` for deletion and continue sending 
updates to the common Service.
   
   Example collection request:
   
   ```text
   
action=CREATE&name=mixed&collection.configName=_default&numShards=1&nrtReplicas=1&pullReplicas=1&createNodeSet=pod-0,pod-1
   ```
   
   ## Expected behavior
   
   The operator should retain at least one active leader-eligible (`NRT` or 
`TLOG`) replica for the shard. It should not count an active `PULL` replica as 
sufficient shard availability for a rolling update.
   
   ## Actual behavior
   
   I reproduced this with Solr Operator commit 
`ed5c5c7d28a4c1189d19f581259e05385c0d4b20`, Kubernetes 1.33.1, and Solr 9.10.0 
on kind.
   
   Before the update, the shard was `GREEN`, writes returned HTTP 200, and the 
pod-0 replica was the active `NRT` leader. The operator then logged:
   
   ```text
   Pod selected to be deleted for update.
   pod: repro-solrcloud-0
   reason: Pod's replicas are safe to take down, adhering to the minimum active 
replicas per shard.
   Deleting solr pod for update
   ```
   
   After `pod-0` went down, pod-1 remained live with only the active `PULL` 
replica. The `NRT` replica became `down`, the shard became `RED`, and updates 
through the common Service failed:
   
   ```text
   No registered leader was found after waiting for 4000ms
   HTTP 503
   ```
   
   Two subsequent requests timed out. After `pod-0` returned, the `NRT` replica 
became leader again, the shard became `GREEN`, and updates returned HTTP 200.
   
   ## Environment
   
   - Solr Operator commit: `ed5c5c7d28a4c1189d19f581259e05385c0d4b20`
   - Solr: 9.10.0
   - Kubernetes: 1.33.1 (kind)
   - Storage: persistent volume on each Solr pod
   - Update strategy: `Managed`
   
   ## Suggested fix
   
   Track active leader-eligible replicas separately for each shard and use that 
count when deciding whether a pod can be deleted. An active `PULL` replica 
should not satisfy the requirement that a shard retain a leader-capable replica.
   


-- 
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