murblanc commented on code in PR #2039:
URL: https://github.com/apache/solr/pull/2039#discussion_r1456807677
##########
solr/core/src/java/org/apache/solr/cloud/api/collections/RestoreCmd.java:
##########
@@ -341,10 +318,8 @@ private void createCoreLessCollection(
propMap.put(Overseer.QUEUE_OPERATION, CREATE.toString());
// mostly true. Prevents autoCreated=true in the collection state.
propMap.put("fromApi", "true");
- propMap.put(REPLICATION_FACTOR, numReplicas.get(Replica.Type.NRT));
- propMap.put(NRT_REPLICAS, numReplicas.get(Replica.Type.NRT));
- propMap.put(TLOG_REPLICAS, numReplicas.get(Replica.Type.TLOG));
- propMap.put(PULL_REPLICAS, numReplicas.get(Replica.Type.PULL));
+ propMap.put(REPLICATION_FACTOR,
numReplicas.get(Replica.Type.defaultType()));
+ numReplicas.writeProps(propMap);
Review Comment:
writeProps() skips adding counts for replicas that are not present in
numReplicas. This is a different behavior from previously , on the left we can
see all counts were added.
This causes `createCoreLessCollection` when it iterates over
`CollectionHandlingUtils.COLLECTION_PROPS_AND_DEFAULTS`, to add the backup
collection replica counts for the replicas that were not explicitly specified
in the restore message.
writeProps() should likely be made to add all replica counts, it is the
simplest fix here.
I ran into problems while working on SIP-20 (dealing with non compatible
replica types) and found this issue.
@pvcnt
--
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]