Skip to content

Commit 7051168

Browse files
Replication/Recovery changes for writable warm index
1 parent f7ed4cc commit 7051168

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

server/src/main/java/org/opensearch/index/store/CompositeDirectory.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,8 @@ public IndexInput openInput(String name, IOContext context) throws IOException {
212212
}
213213
// If file has been uploaded to the Remote Store, fetch it from the Remote Store in blocks via OnDemandCompositeBlockIndexInput
214214
else {
215-
logger.trace("Complete file not in FileCache, to be fetched in Blocks from Remote");
216-
RemoteSegmentMetadata remoteSegmentMetadata = remoteDirectory.readLatestMetadataFile();
217-
RemoteSegmentStoreDirectory.UploadedSegmentMetadata uploadedSegmentMetadata = remoteSegmentMetadata.getMetadata().get(name);
215+
logger.trace("Complete file not in FileCache, to be fetched in Blocks from Remote {}", name);
216+
RemoteSegmentStoreDirectory.UploadedSegmentMetadata uploadedSegmentMetadata = remoteDirectory.getSegmentsUploadedToRemoteStore().get(name);
218217
// TODO : Refactor FileInfo and OnDemandBlockSnapshotIndexInput to more generic names as they are not Remote Snapshot specific
219218
BlobStoreIndexShardSnapshot.FileInfo fileInfo = new BlobStoreIndexShardSnapshot.FileInfo(
220219
name,
@@ -233,7 +232,6 @@ public IndexInput openInput(String name, IOContext context) throws IOException {
233232
public void close() throws IOException {
234233
Arrays.stream(localDirectory.listAll()).forEach(f -> fileCache.remove(localDirectory.getDirectory().resolve(f)));
235234
localDirectory.close();
236-
remoteDirectory.close();
237235
}
238236

239237
/**

0 commit comments

Comments
 (0)