aboutsummaryrefslogtreecommitdiff
path: root/weed/filer
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2025-08-30 11:18:03 -0700
committerchrislu <chris.lu@gmail.com>2025-08-30 11:18:03 -0700
commit87021a146027f83f911619f71b9c27bd51e9d55a (patch)
treec7720f1c285683ce19d28931bd7c11b5475a2844 /weed/filer
parent0748214c8e2f497a84b9392d2d7d4ec976bc84eb (diff)
parent879d512b552d834136cfb746a239e6168e5c4ffb (diff)
downloadseaweedfs-origin/add-ec-vacuum.tar.xz
seaweedfs-origin/add-ec-vacuum.zip
Merge branch 'master' into add-ec-vacuumorigin/add-ec-vacuum
Diffstat (limited to 'weed/filer')
-rw-r--r--weed/filer/filechunk_manifest.go6
-rw-r--r--weed/filer/filechunks_test.go4
2 files changed, 8 insertions, 2 deletions
diff --git a/weed/filer/filechunk_manifest.go b/weed/filer/filechunk_manifest.go
index 18ed8fa8f..80a741cf5 100644
--- a/weed/filer/filechunk_manifest.go
+++ b/weed/filer/filechunk_manifest.go
@@ -211,6 +211,12 @@ func retriedStreamFetchChunkData(ctx context.Context, writer io.Writer, urlStrin
}
func MaybeManifestize(saveFunc SaveDataAsChunkFunctionType, inputChunks []*filer_pb.FileChunk) (chunks []*filer_pb.FileChunk, err error) {
+ // Don't manifestize SSE-encrypted chunks to preserve per-chunk metadata
+ for _, chunk := range inputChunks {
+ if chunk.GetSseType() != 0 { // Any SSE type (SSE-C or SSE-KMS)
+ return inputChunks, nil
+ }
+ }
return doMaybeManifestize(saveFunc, inputChunks, ManifestBatch, mergeIntoManifest)
}
diff --git a/weed/filer/filechunks_test.go b/weed/filer/filechunks_test.go
index 4af2af3f6..4ae7d6133 100644
--- a/weed/filer/filechunks_test.go
+++ b/weed/filer/filechunks_test.go
@@ -5,7 +5,7 @@ import (
"fmt"
"log"
"math"
- "math/rand"
+ "math/rand/v2"
"strconv"
"testing"
@@ -71,7 +71,7 @@ func TestRandomFileChunksCompact(t *testing.T) {
var chunks []*filer_pb.FileChunk
for i := 0; i < 15; i++ {
- start, stop := rand.Intn(len(data)), rand.Intn(len(data))
+ start, stop := rand.IntN(len(data)), rand.IntN(len(data))
if start > stop {
start, stop = stop, start
}