aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_fs_meta_cat.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-01-12 20:29:07 -0800
committerchrislu <chris.lu@gmail.com>2023-01-12 20:29:07 -0800
commit2452f3b2f74d8254190cce5291b68862d67e9100 (patch)
tree95630979f0c7f089a1ee8ee40a45d39c98698c2e /weed/shell/command_fs_meta_cat.go
parent361d97941b81253c6cc74594df640318520aea00 (diff)
downloadseaweedfs-2452f3b2f74d8254190cce5291b68862d67e9100.tar.xz
seaweedfs-2452f3b2f74d8254190cce5291b68862d67e9100.zip
sort chunks by offset
Diffstat (limited to 'weed/shell/command_fs_meta_cat.go')
-rw-r--r--weed/shell/command_fs_meta_cat.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/shell/command_fs_meta_cat.go b/weed/shell/command_fs_meta_cat.go
index 7ad1035a2..69eee6e01 100644
--- a/weed/shell/command_fs_meta_cat.go
+++ b/weed/shell/command_fs_meta_cat.go
@@ -5,6 +5,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/filer"
"google.golang.org/protobuf/proto"
"io"
+ "sort"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
@@ -49,6 +50,11 @@ func (c *commandFsMetaCat) Do(args []string, commandEnv *CommandEnv, writer io.W
return err
}
+ chunks := respLookupEntry.Entry.Chunks
+ sort.Slice(chunks, func(i, j int) bool {
+ return chunks[i].Offset < chunks[j].Offset
+ })
+
filer.ProtoToText(writer, respLookupEntry.Entry)
bytes, _ := proto.Marshal(respLookupEntry.Entry)