Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,13 @@ private byte[] createDeterministicContent(int size) {
/** Writes file content to a directory and serializes it using the replication packet protocol. */
private byte[] serializeFileToPacketStream(byte[] content, String fileName) throws Exception {
DirectoryFactory directoryFactory = h.getCore().getDirectoryFactory();
// Use the same REPLICATION DirContext that the sender (DirectoryFileStream) uses to read the
// file, so the write and the read target the same (unwrapped) delegate Directory. For
// REPLICATION/BACKUP, CachingDirectoryFactory.filterDirectory() unwraps to the raw delegate.
Directory dir =
directoryFactory.get(
h.getCore().getNewIndexDir(),
DirectoryFactory.DirContext.DEFAULT,
DirectoryFactory.DirContext.REPLICATION,
h.getCore().getSolrConfig().indexConfig.lockType);

try {
Expand Down