Copilot commented on code in PR #930:
URL: https://github.com/apache/solr-operator/pull/930#discussion_r4787623248
##########
controllers/util/solr_update_util.go:
##########
@@ -280,6 +288,16 @@ func pickPodsToUpdate(cloud *solr.SolrCloud, outOfDatePods
OutOfDatePodSegmentat
isSafeToUpdate = false
break
}
+
+ // PULL replicas cannot become
leader, so keep at least one leader-eligible (NRT/TLOG) replica active, if the
shard has more than one.
+ activeLeaderEligibleCount :=
nodeContent.activeLeaderEligibleReplicasPerShard[shard]
+ notActiveLeaderEligibleCount :=
state.ShardLeaderEligibleReplicasNotActive[shard]
+ if
!allShardReplicasMayBeUnavailable && activeLeaderEligibleCount > 0 &&
notActiveLeaderEligibleCount > 0 &&
+
notActiveLeaderEligibleCount+activeLeaderEligibleCount >=
state.TotalShardLeaderEligibleReplicas[shard] {
Review Comment:
If a shard's two active NRT/TLOG replicas share one pod and its PULL
replicas are elsewhere, `notActiveLeaderEligibleCount` is zero, so this guard
allows restarting that pod and leaving no leader-eligible replica active.
Either use `state.TotalShardLeaderEligibleReplicas[shard] > 1` for the
single-replica exception, requiring redistribution or the unlimited override
before restarting this pod, or explicitly document co-location as another
unavoidable-outage exception. Add a regression test for the chosen behavior.
--
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]