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/storage/erasure_coding | |
| 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/storage/erasure_coding')
| -rw-r--r-- | weed/storage/erasure_coding/ec_volume.go | 8 | ||||
| -rw-r--r-- | weed/storage/erasure_coding/ec_volume_info.go | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/weed/storage/erasure_coding/ec_volume.go b/weed/storage/erasure_coding/ec_volume.go index ac25d1112..d3a76b561 100644 --- a/weed/storage/erasure_coding/ec_volume.go +++ b/weed/storage/erasure_coding/ec_volume.go @@ -42,7 +42,7 @@ type EcVolume struct { ecjFileAccessLock sync.Mutex diskType types.DiskType datFileSize int64 - DestroyTime uint64 //ec volume destroy time, calculated from the ec volume was created + ExpireAtSec uint64 //ec volume destroy time, calculated from the ec volume was created } func NewEcVolume(diskType types.DiskType, dir string, dirIdx string, collection string, vid needle.VolumeId) (ev *EcVolume, err error) { @@ -73,7 +73,7 @@ func NewEcVolume(diskType types.DiskType, dir string, dirIdx string, collection if volumeInfo, _, found, _ := volume_info.MaybeLoadVolumeInfo(dataBaseFileName + ".vif"); found { ev.Version = needle.Version(volumeInfo.Version) ev.datFileSize = volumeInfo.DatFileSize - ev.DestroyTime = volumeInfo.DestroyTime + ev.ExpireAtSec = volumeInfo.ExpireAtSec } else { glog.Warningf("vif file not found,volumeId:%d, filename:%s", vid, dataBaseFileName) volume_info.SaveVolumeInfo(dataBaseFileName+".vif", &volume_server_pb.VolumeInfo{Version: uint32(ev.Version)}) @@ -206,7 +206,7 @@ func (ev *EcVolume) ToVolumeEcShardInformationMessage() (messages []*master_pb.V Id: uint32(s.VolumeId), Collection: s.Collection, DiskType: string(ev.diskType), - DestroyTime: ev.DestroyTime, + ExpireAtSec: ev.ExpireAtSec, } messages = append(messages, m) } @@ -277,5 +277,5 @@ func SearchNeedleFromSortedIndex(ecxFile *os.File, ecxFileSize int64, needleId t } func (ev *EcVolume) IsTimeToDestroy() bool { - return ev.DestroyTime > 0 && time.Now().Unix() > (int64(ev.DestroyTime)+destroyDelaySeconds) + return ev.ExpireAtSec > 0 && time.Now().Unix() > (int64(ev.ExpireAtSec)+destroyDelaySeconds) } diff --git a/weed/storage/erasure_coding/ec_volume_info.go b/weed/storage/erasure_coding/ec_volume_info.go index 5bfc8f5f6..f464a6d3d 100644 --- a/weed/storage/erasure_coding/ec_volume_info.go +++ b/weed/storage/erasure_coding/ec_volume_info.go @@ -11,16 +11,16 @@ type EcVolumeInfo struct { Collection string ShardBits ShardBits DiskType string - DestroyTime uint64 //ec volume destroy time, calculated from the ec volume was created + ExpireAtSec uint64 //ec volume destroy time, calculated from the ec volume was created } -func NewEcVolumeInfo(diskType string, collection string, vid needle.VolumeId, shardBits ShardBits, destroyTime uint64) *EcVolumeInfo { +func NewEcVolumeInfo(diskType string, collection string, vid needle.VolumeId, shardBits ShardBits, expireAtSec uint64) *EcVolumeInfo { return &EcVolumeInfo{ Collection: collection, VolumeId: vid, ShardBits: shardBits, DiskType: diskType, - DestroyTime: destroyTime, + ExpireAtSec: expireAtSec, } } @@ -61,7 +61,7 @@ func (ecInfo *EcVolumeInfo) ToVolumeEcShardInformationMessage() (ret *master_pb. EcIndexBits: uint32(ecInfo.ShardBits), Collection: ecInfo.Collection, DiskType: ecInfo.DiskType, - DestroyTime: ecInfo.DestroyTime, + ExpireAtSec: ecInfo.ExpireAtSec, } } |
