@@ -679,7 +679,7 @@ private void asyncCleanupUnlinkedShardLevelBlobs(Collection<SnapshotId> snapshot
679
679
listener ,
680
680
l -> {
681
681
try {
682
- blobContainer (). deleteBlobsIgnoringIfNotExists ( resolveFilesToDelete (snapshotIds , deleteResults ));
682
+ deleteFromContainer ( blobContainer (), resolveFilesToDelete (snapshotIds , deleteResults ));
683
683
l .onResponse (null );
684
684
} catch (Exception e ) {
685
685
logger .warn (
@@ -911,7 +911,7 @@ private List<String> cleanupStaleRootFiles(Collection<SnapshotId> deletedSnapsho
911
911
logger .info ("[{}] Found stale root level blobs {}. Cleaning them up" , metadata .name (), blobsToLog );
912
912
}
913
913
}
914
- blobContainer (). deleteBlobsIgnoringIfNotExists ( blobsToDelete );
914
+ deleteFromContainer ( blobContainer (), blobsToDelete );
915
915
return blobsToDelete ;
916
916
} catch (IOException e ) {
917
917
logger .warn (() -> new ParameterizedMessage (
@@ -1030,7 +1030,7 @@ private void cleanupOldShardGens(RepositoryData existingRepositoryData, Reposito
1030
1030
(indexId , gens ) -> gens .forEach ((shardId , oldGen ) -> toDelete .add (
1031
1031
shardContainer (indexId , shardId ).path ().buildAsString ().substring (prefixPathLen ) + INDEX_FILE_PREFIX + oldGen )));
1032
1032
try {
1033
- blobContainer (). deleteBlobsIgnoringIfNotExists ( toDelete );
1033
+ deleteFromContainer ( blobContainer (), toDelete );
1034
1034
} catch (Exception e ) {
1035
1035
logger .warn ("Failed to clean up old shard generation blobs" , e );
1036
1036
}
@@ -1067,6 +1067,11 @@ public IndexMetadata getSnapshotIndexMetadata(final SnapshotId snapshotId, final
1067
1067
}
1068
1068
}
1069
1069
1070
+ private void deleteFromContainer (BlobContainer container , List <String > blobs ) throws IOException {
1071
+ logger .trace (() -> new ParameterizedMessage ("[{}] Deleting {} from [{}]" , metadata .name (), blobs , container .path ()));
1072
+ container .deleteBlobsIgnoringIfNotExists (blobs );
1073
+ }
1074
+
1070
1075
private BlobPath indicesPath () {
1071
1076
return basePath ().add ("indices" );
1072
1077
}
@@ -1538,7 +1543,7 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS
1538
1543
.mapToObj (gen -> INDEX_FILE_PREFIX + gen )
1539
1544
.collect (Collectors .toList ());
1540
1545
try {
1541
- blobContainer (). deleteBlobsIgnoringIfNotExists ( oldIndexN );
1546
+ deleteFromContainer ( blobContainer (), oldIndexN );
1542
1547
} catch (IOException e ) {
1543
1548
logger .warn (() -> new ParameterizedMessage ("Failed to clean up old index blobs {}" , oldIndexN ), e );
1544
1549
}
@@ -1618,6 +1623,8 @@ private long latestGeneration(Collection<String> rootBlobs) {
1618
1623
1619
1624
private void writeAtomic (final String blobName , final BytesReference bytesRef , boolean failIfAlreadyExists ) throws IOException {
1620
1625
try (InputStream stream = bytesRef .streamInput ()) {
1626
+ logger .trace (() ->
1627
+ new ParameterizedMessage ("[{}] Writing [{}] to the base path atomically" , metadata .name (), blobName ));
1621
1628
blobContainer ().writeBlobAtomic (blobName , stream , bytesRef .length (), failIfAlreadyExists );
1622
1629
}
1623
1630
}
@@ -1789,7 +1796,7 @@ public void snapshotShard(Store store, MapperService mapperService, SnapshotId s
1789
1796
}
1790
1797
if (writeShardGens == false ) {
1791
1798
try {
1792
- shardContainer . deleteBlobsIgnoringIfNotExists ( blobsToDelete );
1799
+ deleteFromContainer ( shardContainer , blobsToDelete );
1793
1800
} catch (IOException e ) {
1794
1801
logger .warn (() -> new ParameterizedMessage ("[{}][{}] failed to delete old index-N blobs during finalization" ,
1795
1802
snapshotId , shardId ), e );
@@ -2033,6 +2040,8 @@ private void writeShardIndexBlob(BlobContainer shardContainer, String indexGener
2033
2040
BlobStoreIndexShardSnapshots updatedSnapshots ) throws IOException {
2034
2041
assert ShardGenerations .NEW_SHARD_GEN .equals (indexGeneration ) == false ;
2035
2042
assert ShardGenerations .DELETED_SHARD_GEN .equals (indexGeneration ) == false ;
2043
+ logger .trace (() -> new ParameterizedMessage ("[{}] Writing shard index [{}] to [{}]" , metadata .name (),
2044
+ indexGeneration , shardContainer .path ()));
2036
2045
indexShardSnapshotsFormat .writeAtomic (updatedSnapshots , shardContainer , indexGeneration );
2037
2046
}
2038
2047
@@ -2141,7 +2150,10 @@ private void checkAborted() {
2141
2150
}
2142
2151
}
2143
2152
};
2144
- shardContainer .writeBlob (fileInfo .partName (i ), inputStream , partBytes , true );
2153
+ final String partName = fileInfo .partName (i );
2154
+ logger .trace (() ->
2155
+ new ParameterizedMessage ("[{}] Writing [{}] to [{}]" , metadata .name (), partName , shardContainer .path ()));
2156
+ shardContainer .writeBlob (partName , inputStream , partBytes , true );
2145
2157
}
2146
2158
Store .verify (indexInput );
2147
2159
snapshotStatus .addProcessedFile (fileInfo .length ());
0 commit comments