Browse Source

fix fsync logic

pull/6791/head
chrislu 5 days ago
parent
commit
d8c574a5ef
  1. 2
      weed/storage/store.go
  2. 2
      weed/storage/volume_write.go

2
weed/storage/store.go

@ -437,7 +437,7 @@ func (s *Store) WriteVolumeNeedle(i needle.VolumeId, n *needle.Needle, checkCook
err = fmt.Errorf("volume %d is read only", i)
return
}
_, _, isUnchanged, err = v.writeNeedle2(n, checkCookie, fsync && s.isStopping)
_, _, isUnchanged, err = v.writeNeedle2(n, checkCookie, fsync || s.isStopping)
return
}
glog.V(0).Infoln("volume", i, "not found!")

2
weed/storage/volume_write.go

@ -121,7 +121,7 @@ func (v *Volume) writeNeedle2(n *needle.Needle, checkCookie bool, fsync bool) (o
n.Ttl = v.Ttl
}
if !fsync {
if fsync {
return v.syncWrite(n, checkCookie)
} else {
asyncRequest := needle.NewAsyncRequest(n, true)

Loading…
Cancel
Save