cpoerschke commented on a change in pull request #595:
URL: https://github.com/apache/solr/pull/595#discussion_r804884691
##########
File path:
solr/core/src/java/org/apache/solr/cloud/api/collections/BackupCmd.java
##########
@@ -298,7 +306,7 @@ private void incrementalCopyIndexFiles(URI backupUri,
String collectionName, ZkN
uploadedIndexFileCount = Optional.of(uploadedIndexFileCount.orElse(0)
+ shardUploadedIndexFileCount);
}
Double shardIndexSizeMB = (Double) shardResp.get("indexSizeMB");
- if (shardUploadedIndexFileCount != null) {
+ if (shardIndexSizeMB != null) {
Review comment:
good catch!
##########
File path:
solr/core/src/java/org/apache/solr/cloud/api/collections/BackupCmd.java
##########
@@ -289,7 +294,10 @@ private void incrementalCopyIndexFiles(URI backupUri,
String collectionName, ZkN
NamedList<?> shardResp =
(NamedList<?>)((NamedList<?>)shards.getVal(i)).get("response");
if (shardResp == null)
continue;
- Integer shardIndexFileCount = (Integer) shardResp.get("indexFileCount");
+ // indexFileCount is expected to be found in case of incremental backups
+ // fileCount is expected to be found in case of snapshot backups
+ Integer shardIndexFileCount = (Integer) Optional.<Object>
ofNullable(shardResp.get("indexFileCount"))
+ .orElse(shardResp.get("fileCount"));
Review comment:
```suggestion
Integer shardIndexFileCount = (Integer) shardResp.get(incremental ?
"indexFileCount" : "fileCount");
```
--
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]