diff options
| author | chrislu <chris.lu@gmail.com> | 2024-10-24 21:35:11 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-10-24 21:35:11 -0700 |
| commit | ae5bd0667a7f88028a699e3dee483fd14929de2b (patch) | |
| tree | 84cfc0a923d1440b650837512a01debd71c84670 /weed/server/volume_grpc_erasure_coding.go | |
| parent | 1c2b10303aab6961bc005dbf41df81209f839335 (diff) | |
| download | seaweedfs-ae5bd0667a7f88028a699e3dee483fd14929de2b.tar.xz seaweedfs-ae5bd0667a7f88028a699e3dee483fd14929de2b.zip | |
rename proto field from DestroyTime to expire_at_sec
For TTL volume converted into EC volume, this change may leave the volumes staying.
Diffstat (limited to 'weed/server/volume_grpc_erasure_coding.go')
| -rw-r--r-- | weed/server/volume_grpc_erasure_coding.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/weed/server/volume_grpc_erasure_coding.go b/weed/server/volume_grpc_erasure_coding.go index fe12b3a22..642e8cce3 100644 --- a/weed/server/volume_grpc_erasure_coding.go +++ b/weed/server/volume_grpc_erasure_coding.go @@ -72,19 +72,16 @@ func (vs *VolumeServer) VolumeEcShardsGenerate(ctx context.Context, req *volume_ } // write .vif files - var destroyTime uint64 + var expireAtSec uint64 if v.Ttl != nil { - ttlMills := v.Ttl.ToSeconds() - if ttlMills > 0 { - destroyTime = uint64(time.Now().Unix()) + v.Ttl.ToSeconds() //calculated destroy time from the ec volume was created + ttlSecond := v.Ttl.ToSeconds() + if ttlSecond > 0 { + expireAtSec = uint64(time.Now().Unix()) + ttlSecond //calculated expiration time } } volumeInfo := &volume_server_pb.VolumeInfo{Version: uint32(v.Version())} - if destroyTime == 0 { - glog.Warningf("gen ec volume,cal ec volume destory time fail,set time to 0,ttl:%v", v.Ttl) - } else { - volumeInfo.DestroyTime = destroyTime - } + volumeInfo.ExpireAtSec = expireAtSec + datSize, _, _ := v.FileStat() volumeInfo.DatFileSize = int64(datSize) if err := volume_info.SaveVolumeInfo(baseFileName+".vif", volumeInfo); err != nil { |
