Browse Source

filer: preserve existing TTL during CreateEntry/UpdateEntry gRPC calls

This ensures that metadata load correctly restores entries with their
original TTL instead of overwriting with the default from filer.conf.
Fixes #8159.
pull/7183/merge
Chris Lu 1 day ago
parent
commit
b91427c30f
  1. 4
      weed/server/filer_grpc_server.go

4
weed/server/filer_grpc_server.go

@ -155,7 +155,9 @@ func (fs *FilerServer) CreateEntry(ctx context.Context, req *filer_pb.CreateEntr
newEntry.Chunks = chunks newEntry.Chunks = chunks
// Don't apply TTL to remote entries - they're managed by remote storage // Don't apply TTL to remote entries - they're managed by remote storage
if newEntry.Remote == nil { if newEntry.Remote == nil {
newEntry.TtlSec = so.TtlSeconds
if newEntry.TtlSec == 0 {
newEntry.TtlSec = so.TtlSeconds
}
} else { } else {
newEntry.TtlSec = 0 newEntry.TtlSec = 0
} }

Loading…
Cancel
Save