diff options
| author | augustazz <102299780+augustazz@users.noreply.github.com> | 2024-08-16 15:20:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-16 00:20:00 -0700 |
| commit | 0b00706454478abbb246af2f0d30d34c79b09b40 (patch) | |
| tree | be46e19b7a2afa26b8e2f388b456cee05e95bb2b /weed/shell | |
| parent | 8f1f1730e9925c2f9e5e01867f806dcaac3dde11 (diff) | |
| download | seaweedfs-0b00706454478abbb246af2f0d30d34c79b09b40.tar.xz seaweedfs-0b00706454478abbb246af2f0d30d34c79b09b40.zip | |
EC volume supports expiration and displays expiration message when executing volume.list (#5895)
* ec volume expire
* volume.list show DestroyTime
* comments
* code optimization
---------
Co-authored-by: xuwenfeng <xuwenfeng1@zto.com>
Diffstat (limited to 'weed/shell')
| -rw-r--r-- | weed/shell/command_volume_list.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/weed/shell/command_volume_list.go b/weed/shell/command_volume_list.go index 70b7553b3..83e3a0d6f 100644 --- a/weed/shell/command_volume_list.go +++ b/weed/shell/command_volume_list.go @@ -9,6 +9,7 @@ import ( "golang.org/x/exp/slices" "path/filepath" "strings" + "time" "io" ) @@ -173,7 +174,13 @@ func (c *commandVolumeList) writeDiskInfo(writer io.Writer, t *master_pb.DiskInf if c.isNotMatchDiskInfo(false, ecShardInfo.Collection, ecShardInfo.Id) { continue } - output(verbosityLevel >= 5, writer, " ec volume id:%v collection:%v shards:%v\n", ecShardInfo.Id, ecShardInfo.Collection, erasure_coding.ShardBits(ecShardInfo.EcIndexBits).ShardIds()) + + var destroyTimeDisplay string + destroyTime := ecShardInfo.DestroyTime + if destroyTime > 0 { + destroyTimeDisplay = time.Unix(int64(destroyTime), 0).Format("2006-01-02 15:04:05") + } + output(verbosityLevel >= 5, writer, " ec volume id:%v collection:%v shards:%v destroyTime:%s\n", ecShardInfo.Id, ecShardInfo.Collection, erasure_coding.ShardBits(ecShardInfo.EcIndexBits).ShardIds(), destroyTimeDisplay) } output(verbosityLevel >= 4, writer, " Disk %s %+v \n", diskType, s) return s |
