From 84d65b3905017caef3a2bea147c5dcfd33e22164 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 5 Apr 2026 16:17:38 -0700 Subject: [PATCH] fix(azuresink): include DeleteSnapshots in cleanup delete Match the DeleteSnapshots option used in handleExistingBlob so cleanup succeeds even if a snapshot was created by an automated policy. --- weed/replication/sink/azuresink/azure_sink.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weed/replication/sink/azuresink/azure_sink.go b/weed/replication/sink/azuresink/azure_sink.go index 1c2eb7944..3fbe114b8 100644 --- a/weed/replication/sink/azuresink/azure_sink.go +++ b/weed/replication/sink/azuresink/azure_sink.go @@ -170,7 +170,9 @@ func (g *AzureSink) CreateEntry(key string, entry *filer_pb.Entry, signatures [] glog.Warningf("azure sink: cleaning up empty blob %s/%s after write failure: %v", g.container, key, writeErr) ctxCleanup, cancelCleanup := context.WithTimeout(context.Background(), azure.DefaultAzureOpTimeout) defer cancelCleanup() - if _, delErr := appendBlobClient.Delete(ctxCleanup, nil); delErr != nil { + if _, delErr := appendBlobClient.Delete(ctxCleanup, &blob.DeleteOptions{ + DeleteSnapshots: to.Ptr(blob.DeleteSnapshotsOptionTypeInclude), + }); delErr != nil { if !bloberror.HasCode(delErr, bloberror.BlobNotFound) { glog.Warningf("azure sink: failed to clean up blob %s/%s: %v", g.container, key, delErr) }