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.
This commit is contained in:
Chris Lu
2026-04-05 15:28:48 -07:00
parent fb3aa607be
commit e84b96f346
@@ -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)
}