volume: change all writes to fsync during graceful stopping

fix https://github.com/chrislusf/seaweedfs/issues/2193
This commit is contained in:
Chris Lu
2021-07-13 01:29:57 -07:00
parent 01adc567aa
commit 49c66e88a0
3 changed files with 12 additions and 1 deletions

View File

@@ -259,6 +259,7 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v
// Stop heartbeats
if !volumeServer.StopHeartbeat() {
volumeServer.SetStopping()
glog.V(0).Infof("stop send heartbeat and wait %d seconds until shutdown ...", *v.preStopSeconds)
time.Sleep(time.Duration(*v.preStopSeconds) * time.Second)
}