Hello,
We have snapshots for ES 7.5.2 cluster in Google Cloud Storage(GCS). We have a lot of snapshots going almost a year back and now we are trying to delete the snapshots and keep only last 90 days of data. In the process, it takes 8+ hours deletion of one snapshot and we have a thousands to go through.
I see the task still running and this is the hot_threads output for the node where the task is running:
25.4% (126.7ms out of 500ms) cpu usage by thread 'elasticsearch[elasticsearch-master-2][snapshot][T#2384]'
10/10 snapshots sharing following 59 elements
java.base@13.0.1/sun.nio.ch.Net.poll(Native Method)
java.base@13.0.1/sun.nio.ch.NioSocketImpl.park(NioSocketImpl.java:182)
java.base@13.0.1/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:286)
java.base@13.0.1/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:310)
java.base@13.0.1/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:351)
java.base@13.0.1/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:802)
java.base@13.0.1/java.net.Socket$SocketInputStream.read(Socket.java:937)
java.base@13.0.1/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:450)
java.base@13.0.1/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:68)
java.base@13.0.1/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1409)
java.base@13.0.1/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1022)
java.base@13.0.1/java.io.BufferedInputStream.fill(BufferedInputStream.java:245)
java.base@13.0.1/java.io.BufferedInputStream.read1(BufferedInputStream.java:285)
java.base@13.0.1/java.io.BufferedInputStream.read(BufferedInputStream.java:344)
java.base@13.0.1/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:746)
java.base@13.0.1/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)
java.base@13.0.1/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1610)
java.base@13.0.1/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1515)
java.base@13.0.1/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
java.base@13.0.1/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:308)
com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:36)
com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:144)
com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:79)
com.google.api.client.http.HttpRequest.execute(HttpRequest.java:995)
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:515)
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:448)
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:565)
com.google.cloud.storage.spi.v1.HttpStorageRpc.list(HttpStorageRpc.java:358)
com.google.cloud.storage.StorageImpl$8.call(StorageImpl.java:355)
com.google.cloud.storage.StorageImpl$8.call(StorageImpl.java:352)
com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:105)
com.google.cloud.RetryHelper.run(RetryHelper.java:76)
com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
com.google.cloud.storage.StorageImpl.listBlobs(StorageImpl.java:351)
com.google.cloud.storage.StorageImpl.access$200(StorageImpl.java:82)
com.google.cloud.storage.StorageImpl$BlobPageFetcher.getNextPage(StorageImpl.java:296)
com.google.cloud.PageImpl.getNextPage(PageImpl.java:116)
com.google.cloud.PageImpl$PageIterator.computeNext(PageImpl.java:66)
com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
java.base@13.0.1/java.lang.Iterable.forEach(Iterable.java:74)
org.elasticsearch.repositories.gcs.GoogleCloudStorageBlobStore.lambda$listBlobsByPrefix$2(GoogleCloudStorageBlobStore.java:145)
org.elasticsearch.repositories.gcs.GoogleCloudStorageBlobStore$$Lambda$4566/0x00000008018a7440.run(Unknown Source)
org.elasticsearch.repositories.gcs.SocketAccess.lambda$doPrivilegedVoidIOException$0(SocketAccess.java:54)
org.elasticsearch.repositories.gcs.SocketAccess$$Lambda$4567/0x00000008018a6840.run(Unknown Source)
java.base@13.0.1/java.security.AccessController.executePrivileged(AccessController.java:784)
java.base@13.0.1/java.security.AccessController.doPrivileged(AccessController.java:554)
org.elasticsearch.repositories.gcs.SocketAccess.doPrivilegedVoidIOException(SocketAccess.java:53)
org.elasticsearch.repositories.gcs.GoogleCloudStorageBlobStore.listBlobsByPrefix(GoogleCloudStorageBlobStore.java:144)
org.elasticsearch.repositories.gcs.GoogleCloudStorageBlobStore.listBlobs(GoogleCloudStorageBlobStore.java:129)
org.elasticsearch.repositories.gcs.GoogleCloudStorageBlobContainer.listBlobs(GoogleCloudStorageBlobContainer.java:47)
app//org.elasticsearch.repositories.blobstore.BlobStoreRepository.deleteShardSnapshot(BlobStoreRepository.java:1321)
app//org.elasticsearch.repositories.blobstore.BlobStoreRepository.access$400(BlobStoreRepository.java:159)
app//org.elasticsearch.repositories.blobstore.BlobStoreRepository$1.doRun(BlobStoreRepository.java:682)
app//org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:773)
app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
java.base@13.0.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
java.base@13.0.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
java.base@13.0.1/java.lang.Thread.run(Thread.java:830)