You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2021/10/06 20:06:36 UTC
[GitHub] [solr] epugh commented on a change in pull request #288: SOLR-6910: A deleteById request without _route_ param for implicit router could be sent to all shard leaders
epugh commented on a change in pull request #288:
URL: https://github.com/apache/solr/pull/288#discussion_r723637131
##########
File path: solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
##########
@@ -314,6 +314,23 @@ public void processDelete(DeleteUpdateCommand cmd) throws IOException {
@Override
protected void doDeleteById(DeleteUpdateCommand cmd) throws IOException {
+
+ // if using the CompositeId router and route field is missing, distribute to all shard leaders
+ if(cmd.getRoute()==null) {
+ zkCheck();
+ DocCollection coll = zkController.getClusterState().getCollection(collection);
+ DocRouter router = coll.getRouter();
+ String routeField = router.getRouteField(coll);
+ if (router instanceof CompositeIdRouter && routeField != null) {
+ DistribPhase phase = DistribPhase.parseParam(req.getParams().get(DISTRIB_UPDATE_PARAM));
+ if (phase == DistribPhase.NONE) {
+ log.debug("Using compositeId router and deleteById command is with missing route value, distributing to all shard leaders");
Review comment:
@makosten small nit, should this debug line be "command is missing" instead of "is with" ;-)
--
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: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org