aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume_read_all.go
diff options
context:
space:
mode:
authorJames Hartig <me@jameshartig.com>2022-11-20 23:19:41 -0500
committerGitHub <noreply@github.com>2022-11-20 20:19:41 -0800
commit4c85da7844d50b424bd8b7ace6250f2f381846b9 (patch)
tree79ccba777c91b71b947112865b48f9f897d5b938 /weed/storage/volume_read_all.go
parent70a4c98b00d811c01289f26d3602992a0d3f45e1 (diff)
downloadseaweedfs-4c85da7844d50b424bd8b7ace6250f2f381846b9.tar.xz
seaweedfs-4c85da7844d50b424bd8b7ace6250f2f381846b9.zip
Include meta in ReadAllNeedles (#3991)
This is useful for doing backups on the data so we can accurately store the last modified time, the compression state, and verify the crc. Previously we were doing VolumeNeedleStatus and then an HTTP request which needlessly read from the dat file twice.
Diffstat (limited to 'weed/storage/volume_read_all.go')
-rw-r--r--weed/storage/volume_read_all.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/weed/storage/volume_read_all.go b/weed/storage/volume_read_all.go
index 9d4116eb0..798f9c495 100644
--- a/weed/storage/volume_read_all.go
+++ b/weed/storage/volume_read_all.go
@@ -30,10 +30,13 @@ func (scanner *VolumeFileScanner4ReadAll) VisitNeedle(n *needle.Needle, offset i
}
sendErr := scanner.Stream.Send(&volume_server_pb.ReadAllNeedlesResponse{
- VolumeId: uint32(scanner.V.Id),
- NeedleId: uint64(n.Id),
- Cookie: uint32(n.Cookie),
- NeedleBlob: n.Data,
+ VolumeId: uint32(scanner.V.Id),
+ NeedleId: uint64(n.Id),
+ Cookie: uint32(n.Cookie),
+ NeedleBlob: n.Data,
+ NeedleBlobCompressed: n.IsCompressed(),
+ LastModified: n.LastModified,
+ Crc: n.Checksum.Value(),
})
if sendErr != nil {
return sendErr