mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
set needle AppendAtNs value during writes
This commit is contained in:
parent
655b449270
commit
ea8ecf35f4
|
@ -101,6 +101,7 @@ func (v *Volume) writeNeedle(n *Needle) (size uint32, err error) {
|
|||
}
|
||||
}
|
||||
|
||||
n.AppendAtNs = uint64(time.Now().UnixNano())
|
||||
if size, _, err = n.Append(v.dataFile, v.Version()); err != nil {
|
||||
if e := v.dataFile.Truncate(offset); e != nil {
|
||||
err = fmt.Errorf("%s\ncannot truncate %s: %v", err, v.dataFile.Name(), e)
|
||||
|
@ -139,6 +140,7 @@ func (v *Volume) deleteNeedle(n *Needle) (uint32, error) {
|
|||
return size, err
|
||||
}
|
||||
n.Data = nil
|
||||
n.AppendAtNs = uint64(time.Now().UnixNano())
|
||||
_, _, err = n.Append(v.dataFile, v.Version())
|
||||
return size, err
|
||||
}
|
||||
|
|
|
@ -207,6 +207,7 @@ func (v *Volume) makeupDiff(newDatFileName, newIdxFileName, oldDatFileName, oldI
|
|||
fakeDelNeedle := new(Needle)
|
||||
fakeDelNeedle.Id = key
|
||||
fakeDelNeedle.Cookie = 0x12345678
|
||||
fakeDelNeedle.AppendAtNs = uint64(time.Now().UnixNano())
|
||||
_, _, err = fakeDelNeedle.Append(dst, v.Version())
|
||||
if err != nil {
|
||||
return fmt.Errorf("append deleted %d failed: %v", key, err)
|
||||
|
|
Loading…
Reference in a new issue