mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 16:37:25 +08:00
volume server: accept fsync=true in write requests
This commit is contained in:
@@ -252,7 +252,7 @@ func (s *Store) Close() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Store) WriteVolumeNeedle(i needle.VolumeId, n *needle.Needle) (isUnchanged bool, err error) {
|
||||
func (s *Store) WriteVolumeNeedle(i needle.VolumeId, n *needle.Needle, fsync bool) (isUnchanged bool, err error) {
|
||||
if v := s.findVolume(i); v != nil {
|
||||
if v.IsReadOnly() {
|
||||
err = fmt.Errorf("volume %d is read only", i)
|
||||
@@ -260,7 +260,7 @@ func (s *Store) WriteVolumeNeedle(i needle.VolumeId, n *needle.Needle) (isUnchan
|
||||
}
|
||||
// using len(n.Data) here instead of n.Size before n.Size is populated in v.writeNeedle(n)
|
||||
if MaxPossibleVolumeSize >= v.ContentSize()+uint64(needle.GetActualSize(uint32(len(n.Data)), v.Version())) {
|
||||
_, _, isUnchanged, err = v.writeNeedle(n)
|
||||
_, _, isUnchanged, err = v.writeNeedle(n, fsync)
|
||||
} else {
|
||||
err = fmt.Errorf("volume size limit %d exceeded! current size is %d", s.GetVolumeSizeLimit(), v.ContentSize())
|
||||
}
|
||||
|
Reference in New Issue
Block a user