fix fsync logic
This commit is contained in:
@@ -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!")
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user