aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2025-01-28 23:59:39 -0800
committerchrislu <chris.lu@gmail.com>2025-01-28 23:59:42 -0800
commit33ba88df9cbf1b8ca086e02e6cb09918279a4ca4 (patch)
tree5394475ef1168fb705b9f34a256b4b0c4ee497c3
parent7c3a0ed8747fafbf0f5bfb3ab3c9249d4a2115ea (diff)
downloadseaweedfs-33ba88df9cbf1b8ca086e02e6cb09918279a4ca4.tar.xz
seaweedfs-33ba88df9cbf1b8ca086e02e6cb09918279a4ca4.zip
fix from ensure() before actual deletion, within the b2 client library
fix https://github.com/seaweedfs/seaweedfs/issues/6483
-rw-r--r--weed/replication/sink/b2sink/b2_sink.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/weed/replication/sink/b2sink/b2_sink.go b/weed/replication/sink/b2sink/b2_sink.go
index de7899c60..28a10b195 100644
--- a/weed/replication/sink/b2sink/b2_sink.go
+++ b/weed/replication/sink/b2sink/b2_sink.go
@@ -79,7 +79,14 @@ func (g *B2Sink) DeleteEntry(key string, isDirectory, deleteIncludeChunks bool,
targetObject := bucket.Object(key)
- return targetObject.Delete(context.Background())
+ err = targetObject.Delete(context.Background())
+ if err != nil {
+ // b2_download_file_by_name: 404: File with such name does not exist.
+ if strings.Contains(err.Error(), ": 404:") {
+ return nil
+ }
+ }
+ return err
}