rename proto field from DestroyTime to expire_at_sec
For TTL volume converted into EC volume, this change may leave the volumes staying.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user