Skip to content

Commit 3734978

Browse files
authored
Ignore recovery rate limiter for the warm indexes while download (#20109)
Signed-off-by: Ajay kumar Movva <[email protected]>
1 parent a0a40bd commit 3734978

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ public Directory newFSDirectory(Path location, LockFactory lockFactory, IndexSet
6868
public Directory newDirectory(IndexSettings indexSettings, ShardPath path) throws IOException {
6969
String repositoryName = indexSettings.getRemoteStoreRepository();
7070
String indexUUID = indexSettings.getIndex().getUUID();
71-
7271
return newDirectory(
7372
repositoryName,
7473
indexUUID,
7574
path.getShardId(),
7675
indexSettings.getRemoteStorePathStrategy(),
7776
null,
78-
RemoteStoreUtils.isServerSideEncryptionEnabledIndex(indexSettings.getIndexMetadata())
77+
RemoteStoreUtils.isServerSideEncryptionEnabledIndex(indexSettings.getIndexMetadata()),
78+
indexSettings.isWarmIndex()
7979
);
8080
}
8181

@@ -101,6 +101,18 @@ public Directory newDirectory(
101101
RemoteStorePathStrategy pathStrategy,
102102
String indexFixedPrefix,
103103
boolean isServerSideEncryptionEnabled
104+
) throws IOException {
105+
return newDirectory(repositoryName, indexUUID, shardId, pathStrategy, indexFixedPrefix, isServerSideEncryptionEnabled, false);
106+
}
107+
108+
public Directory newDirectory(
109+
String repositoryName,
110+
String indexUUID,
111+
ShardId shardId,
112+
RemoteStorePathStrategy pathStrategy,
113+
String indexFixedPrefix,
114+
boolean isServerSideEncryptionEnabled,
115+
boolean isWarmIndex
104116
) throws IOException {
105117
assert Objects.nonNull(pathStrategy);
106118
// We should be not calling close for repository.
@@ -128,7 +140,9 @@ public Directory newDirectory(
128140
blobStoreRepository.blobStore(isServerSideEncryptionEnabled).blobContainer(dataPath),
129141
blobStoreRepository::maybeRateLimitRemoteUploadTransfers,
130142
blobStoreRepository::maybeRateLimitLowPriorityRemoteUploadTransfers,
131-
blobStoreRepository::maybeRateLimitRemoteDownloadTransfers,
143+
isWarmIndex
144+
? blobStoreRepository::maybeRateLimitRemoteDownloadTransfersForWarm
145+
: blobStoreRepository::maybeRateLimitRemoteDownloadTransfers,
132146
blobStoreRepository::maybeRateLimitLowPriorityDownloadTransfers,
133147
pendingDownloadMergedSegments
134148
);

server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4426,6 +4426,15 @@ public InputStream maybeRateLimitRemoteDownloadTransfers(InputStream inputStream
44264426
);
44274427
}
44284428

4429+
public InputStream maybeRateLimitRemoteDownloadTransfersForWarm(InputStream inputStream) {
4430+
return maybeRateLimit(
4431+
inputStream,
4432+
() -> remoteDownloadRateLimiter,
4433+
remoteDownloadRateLimitingTimeInNanos,
4434+
BlobStoreTransferContext.REMOTE_DOWNLOAD
4435+
);
4436+
}
4437+
44294438
public InputStream maybeRateLimitLowPriorityDownloadTransfers(InputStream inputStream) {
44304439
return maybeRateLimit(
44314440
maybeRateLimit(

0 commit comments

Comments
 (0)