From e84b96f3462d1cb4cb94493b0ad04ed8e36dd545 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 5 Apr 2026 15:28:48 -0700 Subject: [PATCH] fix(azuresink): track recreated blobs for cleanup on write failure handleExistingBlob deletes and recreates the blob when overwrite is needed, but freshlyCreated was only set on the initial Create success path. Set freshlyCreated = needsWrite after handleExistingBlob so recreated blobs are also cleaned up on content write failure. --- weed/replication/sink/azuresink/azure_sink.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weed/replication/sink/azuresink/azure_sink.go b/weed/replication/sink/azuresink/azure_sink.go index f8f519170..1c2eb7944 100644 --- a/weed/replication/sink/azuresink/azure_sink.go +++ b/weed/replication/sink/azuresink/azure_sink.go @@ -147,6 +147,8 @@ func (g *AzureSink) CreateEntry(key string, entry *filer_pb.Entry, signatures [] if handleErr != nil { return handleErr } + // handleExistingBlob recreates the blob when needsWrite is true + freshlyCreated = needsWrite } else { return fmt.Errorf("azure create append blob %s/%s: %w", g.container, key, err) }