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.
This commit is contained in:
Chris Lu
2026-01-29 14:42:09 -08:00
parent 550a4ff761
commit b91427c30f

View File

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