Browse Source

keep system log data

pull/3905/head
chrislu 2 years ago
parent
commit
377870f4a9
  1. 10
      weed/shell/command_volume_fsck.go

10
weed/shell/command_volume_fsck.go

@ -134,14 +134,10 @@ func (c *commandVolumeFsck) Do(args []string, commandEnv *CommandEnv, writer io.
delete(volumeIdToVInfo, volumeId) delete(volumeIdToVInfo, volumeId)
continue continue
} }
// or skip /topics/.system/log without collection name
if (*c.collection != "" && vinfo.collection != *c.collection) || vinfo.collection == "" {
if *c.collection != "" && vinfo.collection != *c.collection {
delete(volumeIdToVInfo, volumeId) delete(volumeIdToVInfo, volumeId)
continue continue
} }
if *c.volumeId > 0 && *c.collection == "" {
*c.collection = vinfo.collection
}
cutoffFrom := time.Now().Add(-*cutoffTimeAgo).UnixNano() cutoffFrom := time.Now().Add(-*cutoffTimeAgo).UnixNano()
err = c.collectOneVolumeFileIds(dataNodeId, volumeId, vinfo, uint64(cutoffFrom)) err = c.collectOneVolumeFileIds(dataNodeId, volumeId, vinfo, uint64(cutoffFrom))
if err != nil { if err != nil {
@ -548,7 +544,7 @@ func (c *commandVolumeFsck) oneVolumeFileIdsSubtractFilerFileIds(dataNodeId stri
return return
} }
voluemAddr := pb.NewServerAddressWithGrpcPort(dataNodeId, 0)
volumeAddr := pb.NewServerAddressWithGrpcPort(dataNodeId, 0)
if err = c.readFilerFileIdFile(volumeId, func(nId types.NeedleId, itemPath util.FullPath) { if err = c.readFilerFileIdFile(volumeId, func(nId types.NeedleId, itemPath util.FullPath) {
inUseCount++ inUseCount++
if *c.verifyNeedle { if *c.verifyNeedle {
@ -557,7 +553,7 @@ func (c *commandVolumeFsck) oneVolumeFileIdsSubtractFilerFileIds(dataNodeId stri
if v.Size > newSize { if v.Size > newSize {
v.Size = newSize v.Size = newSize
} }
if _, err := readSourceNeedleBlob(c.env.option.GrpcDialOption, voluemAddr, volumeId, *v); err != nil {
if _, err := readSourceNeedleBlob(c.env.option.GrpcDialOption, volumeAddr, volumeId, *v); err != nil {
fmt.Fprintf(c.writer, "failed to read file %s NeedleBlob %+v: %+v", itemPath, nId, err) fmt.Fprintf(c.writer, "failed to read file %s NeedleBlob %+v: %+v", itemPath, nId, err)
if *c.forcePurging { if *c.forcePurging {
return return

Loading…
Cancel
Save