mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
volume: also check cookie for possible duplicates
This commit is contained in:
parent
132921ad41
commit
0302b9496c
|
@ -120,7 +120,7 @@ func (vs *VolumeServer) doHeartbeat(ctx context.Context, masterNode, masterGrpcA
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
case <-tickChan:
|
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 {
|
if err = stream.Send(vs.store.CollectHeartbeat()); err != nil {
|
||||||
glog.V(0).Infof("Volume Server Failed to talk with master %s: %v", masterNode, err)
|
glog.V(0).Infof("Volume Server Failed to talk with master %s: %v", masterNode, err)
|
||||||
return "", err
|
return "", err
|
||||||
|
|
|
@ -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)
|
glog.V(0).Infof("Failed to check updated file at offset %d size %d: %v", nv.Offset.ToAcutalOffset(), nv.Size, err)
|
||||||
return false
|
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
|
n.DataSize = oldNeedle.DataSize
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue