diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-04-11 21:39:16 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-04-11 21:39:16 -0700 |
| commit | e4af63a721f62c280596f626302b64729baeaee9 (patch) | |
| tree | 06c863d0362c23d53efdc053ab7750bf88e7feb6 /weed/topology | |
| parent | 5987810e5eb56611389451029fb85ff1fd700996 (diff) | |
| download | seaweedfs-e4af63a721f62c280596f626302b64729baeaee9.tar.xz seaweedfs-e4af63a721f62c280596f626302b64729baeaee9.zip | |
volume server: accept fsync=true in write requests
Diffstat (limited to 'weed/topology')
| -rw-r--r-- | weed/topology/store_replicate.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/weed/topology/store_replicate.go b/weed/topology/store_replicate.go index 6f043a601..236f8d773 100644 --- a/weed/topology/store_replicate.go +++ b/weed/topology/store_replicate.go @@ -22,8 +22,10 @@ func ReplicatedWrite(masterNode string, s *storage.Store, volumeId needle.Volume //check JWT jwt := security.GetJwt(r) + // check whether this is a replicated write request var remoteLocations []operation.Location if r.FormValue("type") != "replicate" { + // this is the initial request remoteLocations, err = getWritableRemoteReplications(s, volumeId, masterNode) if err != nil { glog.V(0).Infoln(err) @@ -31,8 +33,14 @@ func ReplicatedWrite(masterNode string, s *storage.Store, volumeId needle.Volume } } + // read fsync value + fsync := false + if r.FormValue("fsync") == "true" { + fsync = true + } + if s.GetVolume(volumeId) != nil { - isUnchanged, err = s.WriteVolumeNeedle(volumeId, n) + isUnchanged, err = s.WriteVolumeNeedle(volumeId, n, fsync) if err != nil { err = fmt.Errorf("failed to write to local disk: %v", err) glog.V(0).Infoln(err) |
