dsmiley commented on code in PR #3185: URL: https://github.com/apache/solr/pull/3185#discussion_r1957129435
########## solr/core/src/java/org/apache/solr/handler/admin/api/ReplicationAPIBase.java: ########## @@ -246,6 +242,21 @@ protected FileListResponse getFileList(long generation, ReplicationHandler repli return filesResponse; } + private Directory getDirectory() throws IOException { + return solrCore + .getDirectoryFactory() + .get( + solrCore.getNewIndexDir(), + DirectoryFactory.DirContext.DEFAULT, Review Comment: And here; wouldn't we use REPLICATION? ########## solr/core/src/java/org/apache/solr/core/DirectoryFactory.java: ########## @@ -55,10 +55,16 @@ public abstract class DirectoryFactory implements NamedListInitializedPlugin, Cl // Absolute. protected Path dataHomePath; - // hint about what the directory contains - default is index directory + /** Hint about what the directory contains or what the directory will be used for. */ public enum DirContext { + /** Default is index directory. */ DEFAULT, - META_DATA + /** Directory containing metadata. */ + META_DATA, + /** Directory used to copy raw files during replication. */ + REPLICATE, + /** Directory used to copy raw files during backup. */ + BACKUP, Review Comment: Okay. I see changing the Lucene checksum to be of the raw bytes appears impossible because that checksum is not the responsibility of the Directory (if it was we could tweak it). Instead, most Lucene coded stuff writes it via CodecUtil.writeFooter ########## solr/core/src/java/org/apache/solr/handler/IncrementalShardBackup.java: ########## @@ -145,21 +145,22 @@ protected IncrementalShardSnapshotResponse backup(final IndexCommit indexCommit) details.startTime = Instant.now().toString(); Collection<String> files = indexCommit.getFileNames(); + DirectoryFactory directoryFactory = solrCore.getDirectoryFactory(); Directory dir = - solrCore - .getDirectoryFactory() - .get( - solrCore.getIndexDir(), - DirectoryFactory.DirContext.DEFAULT, - solrCore.getSolrConfig().indexConfig.lockType); + directoryFactory.get( + solrCore.getIndexDir(), + DirectoryFactory.DirContext.DEFAULT, Review Comment: Wouldn't we use BACKUP even if we're not sure if the DirectoryFactory is going to do something based on this? -- 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