Skip to content

Commit

Permalink
Increase worker count in line with snapshot deletion threadpool count
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Singh <[email protected]>
  • Loading branch information
ashking94 committed Aug 7, 2024
1 parent 3343c1d commit 685b2eb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ private void asyncCleanupUnlinkedShardLevelBlobs(
);

// Start as many workers as fit into the snapshot pool at once at the most
final int workers = Math.min(threadPool.info(ThreadPool.Names.SNAPSHOT).getMax(), staleFilesToDeleteInBatch.size());
final int workers = Math.min(threadPool.info(ThreadPool.Names.SNAPSHOT_DELETION).getMax(), staleFilesToDeleteInBatch.size());
for (int i = 0; i < workers; ++i) {
executeStaleShardDelete(staleFilesToDeleteInBatch, remoteStoreLockManagerFactory, groupedListener);
}
Expand Down Expand Up @@ -1740,7 +1740,7 @@ private void cleanupStaleIndices(

// Start as many workers as fit into the snapshot pool at once at the most
final int workers = Math.min(
threadPool.info(ThreadPool.Names.SNAPSHOT).getMax(),
threadPool.info(ThreadPool.Names.SNAPSHOT_DELETION).getMax(),
foundIndices.size() - survivingIndexIds.size()
);
for (int i = 0; i < workers; ++i) {
Expand Down Expand Up @@ -1979,6 +1979,7 @@ private void cleanupOldShardGens(RepositoryData existingRepositoryData, Reposito
)
);
try {
logger.info("{} shards generations to be deleted as part of cleanupOldShardGens", toDelete);
deleteFromContainer(rootBlobContainer(), toDelete);
} catch (Exception e) {
logger.warn("Failed to clean up old shard generation blobs", e);
Expand Down

0 comments on commit 685b2eb

Please sign in to comment.