@@ -702,7 +702,7 @@ private void asyncCleanupUnlinkedShardLevelBlobs(Collection<SnapshotId> snapshot
702
702
listener ,
703
703
l -> {
704
704
try {
705
- blobContainer (). deleteBlobsIgnoringIfNotExists ( resolveFilesToDelete (snapshotIds , deleteResults ));
705
+ deleteFromContainer ( blobContainer (), resolveFilesToDelete (snapshotIds , deleteResults ));
706
706
l .onResponse (null );
707
707
} catch (Exception e ) {
708
708
logger .warn (
@@ -934,7 +934,7 @@ private List<String> cleanupStaleRootFiles(Collection<SnapshotId> deletedSnapsho
934
934
logger .info ("[{}] Found stale root level blobs {}. Cleaning them up" , metadata .name (), blobsToLog );
935
935
}
936
936
}
937
- blobContainer (). deleteBlobsIgnoringIfNotExists ( blobsToDelete );
937
+ deleteFromContainer ( blobContainer (), blobsToDelete );
938
938
return blobsToDelete ;
939
939
} catch (IOException e ) {
940
940
logger .warn (() -> new ParameterizedMessage (
@@ -1053,7 +1053,7 @@ private void cleanupOldShardGens(RepositoryData existingRepositoryData, Reposito
1053
1053
(indexId , gens ) -> gens .forEach ((shardId , oldGen ) -> toDelete .add (
1054
1054
shardContainer (indexId , shardId ).path ().buildAsString ().substring (prefixPathLen ) + INDEX_FILE_PREFIX + oldGen )));
1055
1055
try {
1056
- blobContainer (). deleteBlobsIgnoringIfNotExists ( toDelete );
1056
+ deleteFromContainer ( blobContainer (), toDelete );
1057
1057
} catch (Exception e ) {
1058
1058
logger .warn ("Failed to clean up old shard generation blobs" , e );
1059
1059
}
@@ -1090,6 +1090,11 @@ public IndexMetadata getSnapshotIndexMetadata(final SnapshotId snapshotId, final
1090
1090
}
1091
1091
}
1092
1092
1093
+ private void deleteFromContainer (BlobContainer container , List <String > blobs ) throws IOException {
1094
+ logger .trace (() -> new ParameterizedMessage ("[{}] Deleting {} from [{}]" , metadata .name (), blobs , container .path ()));
1095
+ container .deleteBlobsIgnoringIfNotExists (blobs );
1096
+ }
1097
+
1093
1098
private BlobPath indicesPath () {
1094
1099
return basePath ().add ("indices" );
1095
1100
}
@@ -1561,7 +1566,7 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS
1561
1566
.mapToObj (gen -> INDEX_FILE_PREFIX + gen )
1562
1567
.collect (Collectors .toList ());
1563
1568
try {
1564
- blobContainer (). deleteBlobsIgnoringIfNotExists ( oldIndexN );
1569
+ deleteFromContainer ( blobContainer (), oldIndexN );
1565
1570
} catch (IOException e ) {
1566
1571
logger .warn (() -> new ParameterizedMessage ("Failed to clean up old index blobs {}" , oldIndexN ), e );
1567
1572
}
@@ -1641,6 +1646,8 @@ private long latestGeneration(Collection<String> rootBlobs) {
1641
1646
1642
1647
private void writeAtomic (final String blobName , final BytesReference bytesRef , boolean failIfAlreadyExists ) throws IOException {
1643
1648
try (InputStream stream = bytesRef .streamInput ()) {
1649
+ logger .trace (() ->
1650
+ new ParameterizedMessage ("[{}] Writing [{}] to the base path atomically" , metadata .name (), blobName ));
1644
1651
blobContainer ().writeBlobAtomic (blobName , stream , bytesRef .length (), failIfAlreadyExists );
1645
1652
}
1646
1653
}
@@ -1812,7 +1819,7 @@ public void snapshotShard(Store store, MapperService mapperService, SnapshotId s
1812
1819
}
1813
1820
if (writeShardGens == false ) {
1814
1821
try {
1815
- shardContainer . deleteBlobsIgnoringIfNotExists ( blobsToDelete );
1822
+ deleteFromContainer ( shardContainer , blobsToDelete );
1816
1823
} catch (IOException e ) {
1817
1824
logger .warn (() -> new ParameterizedMessage ("[{}][{}] failed to delete old index-N blobs during finalization" ,
1818
1825
snapshotId , shardId ), e );
@@ -2056,6 +2063,8 @@ private void writeShardIndexBlob(BlobContainer shardContainer, String indexGener
2056
2063
BlobStoreIndexShardSnapshots updatedSnapshots ) throws IOException {
2057
2064
assert ShardGenerations .NEW_SHARD_GEN .equals (indexGeneration ) == false ;
2058
2065
assert ShardGenerations .DELETED_SHARD_GEN .equals (indexGeneration ) == false ;
2066
+ logger .trace (() -> new ParameterizedMessage ("[{}] Writing shard index [{}] to [{}]" , metadata .name (),
2067
+ indexGeneration , shardContainer .path ()));
2059
2068
indexShardSnapshotsFormat .writeAtomic (updatedSnapshots , shardContainer , indexGeneration );
2060
2069
}
2061
2070
@@ -2164,7 +2173,10 @@ private void checkAborted() {
2164
2173
}
2165
2174
}
2166
2175
};
2167
- shardContainer .writeBlob (fileInfo .partName (i ), inputStream , partBytes , true );
2176
+ final String partName = fileInfo .partName (i );
2177
+ logger .trace (() ->
2178
+ new ParameterizedMessage ("[{}] Writing [{}] to [{}]" , metadata .name (), partName , shardContainer .path ()));
2179
+ shardContainer .writeBlob (partName , inputStream , partBytes , true );
2168
2180
}
2169
2181
Store .verify (indexInput );
2170
2182
snapshotStatus .addProcessedFile (fileInfo .length ());
0 commit comments