ijioio commented on a change in pull request #595:
URL: https://github.com/apache/solr/pull/595#discussion_r804897545



##########
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:
       Thank you, @cpoerschke ! But it seems it is not relevant anymore, I've 
added field `indexFileCount` to duplicate field `fileCount` in shard snapshot 
response if you don't mind:
   
   ```java
         details.add("fileCount", files.size()); // TODO: for removal, replaced 
with indexFileCount
         details.add("indexFileCount", files.size());
         ...
         details.add("snapshotCompletedAt", Instant.now().toString()); // TODO: 
for removal, replaced with endTime
         details.add("endTime", Instant.now().toString());
   ```




-- 
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-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to