Browse Source

volume: also check cookie for possible duplicates

pull/942/head
Chris Lu 6 years ago
parent
commit
0302b9496c
  1. 2
      weed/server/volume_grpc_client_to_master.go
  2. 2
      weed/storage/volume_read_write.go

2
weed/server/volume_grpc_client_to_master.go

@ -120,7 +120,7 @@ func (vs *VolumeServer) doHeartbeat(ctx context.Context, masterNode, masterGrpcA
return "", err
}
case <-tickChan:
glog.V(1).Infof("volume server %s:%d heartbeat", vs.store.Ip, vs.store.Port)
glog.V(2).Infof("volume server %s:%d heartbeat", vs.store.Ip, vs.store.Port)
if err = stream.Send(vs.store.CollectHeartbeat()); err != nil {
glog.V(0).Infof("Volume Server Failed to talk with master %s: %v", masterNode, err)
return "", err

2
weed/storage/volume_read_write.go

@ -29,7 +29,7 @@ func (v *Volume) isFileUnchanged(n *needle.Needle) bool {
glog.V(0).Infof("Failed to check updated file at offset %d size %d: %v", nv.Offset.ToAcutalOffset(), nv.Size, err)
return false
}
if oldNeedle.Checksum == n.Checksum && bytes.Equal(oldNeedle.Data, n.Data) {
if oldNeedle.Cookie == n.Cookie && oldNeedle.Checksum == n.Checksum && bytes.Equal(oldNeedle.Data, n.Data) {
n.DataSize = oldNeedle.DataSize
return true
}

Loading…
Cancel
Save