21126: Move BlobDeleteConcurrency==0 check up in the stack.
authorTom Clegg <tom@curii.com>
Thu, 26 Oct 2023 20:08:36 +0000 (16:08 -0400)
committerTom Clegg <tom@curii.com>
Thu, 26 Oct 2023 20:08:36 +0000 (16:08 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

services/keepstore/azure_blob_volume.go
services/keepstore/command.go
services/keepstore/s3aws_volume.go
services/keepstore/unix_volume.go

index f9b383e70e5a1d531c414f7c180e1d623e7c55b2..4fb469bdcbbba73be4c4aad728e2938939e11bb4 100644 (file)
@@ -575,10 +575,6 @@ func (v *AzureBlobVolume) isKeepBlock(s string) bool {
 // EmptyTrash looks for trashed blocks that exceeded BlobTrashLifetime
 // and deletes them from the volume.
 func (v *AzureBlobVolume) EmptyTrash() {
-       if v.cluster.Collections.BlobDeleteConcurrency < 1 {
-               return
-       }
-
        var bytesDeleted, bytesInTrash int64
        var blocksDeleted, blocksInTrash int64
 
index 555f16dfe1f290edbd1797437efd3842ad29dd4e..9d220022ab3cf5e05508cc36d2268ca94b08fae9 100644 (file)
@@ -208,7 +208,9 @@ func (h *handler) setup(ctx context.Context, cluster *arvados.Cluster, token str
        }
        h.keepClient.Arvados.ApiToken = fmt.Sprintf("%x", rand.Int63())
 
-       if d := h.Cluster.Collections.BlobTrashCheckInterval.Duration(); d > 0 {
+       if d := h.Cluster.Collections.BlobTrashCheckInterval.Duration(); d > 0 &&
+               h.Cluster.Collections.BlobTrash &&
+               h.Cluster.Collections.BlobDeleteConcurrency > 0 {
                go emptyTrash(h.volmgr.writables, d)
        }
 
index 8f2c27539109fbac45b844ac31281d9b4c3a76cd..aaec02721b47affd71f274a7d00bd3eee8ad0de3 100644 (file)
@@ -295,10 +295,6 @@ func (v *S3AWSVolume) Compare(ctx context.Context, loc string, expect []byte) er
 // EmptyTrash looks for trashed blocks that exceeded BlobTrashLifetime
 // and deletes them from the volume.
 func (v *S3AWSVolume) EmptyTrash() {
-       if v.cluster.Collections.BlobDeleteConcurrency < 1 {
-               return
-       }
-
        var bytesInTrash, blocksInTrash, bytesDeleted, blocksDeleted int64
 
        // Define "ready to delete" as "...when EmptyTrash started".
index a08b7de01a8f4a8480d34bd8c6d305bb2400c0d9..8c935dcddb249eb508450d17c1921ca6717ee931 100644 (file)
@@ -647,10 +647,6 @@ var unixTrashLocRegexp = regexp.MustCompile(`/([0-9a-f]{32})\.trash\.(\d+)$`)
 // EmptyTrash walks hierarchy looking for {hash}.trash.*
 // and deletes those with deadline < now.
 func (v *UnixVolume) EmptyTrash() {
-       if v.cluster.Collections.BlobDeleteConcurrency < 1 {
-               return
-       }
-
        var bytesDeleted, bytesInTrash int64
        var blocksDeleted, blocksInTrash int64