add additional fdatasync before close() on writes (#9947)

This commit is contained in:
Harshavardhana
2020-07-01 10:57:23 -07:00
committed by GitHub
parent 5388ae4acb
commit 174f428571
9 changed files with 134 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
// +build !freebsd
// +build !freebsd,!netbsd,!openbsd,!solaris
/*
* MinIO Cloud Storage, (C) 2020 MinIO, Inc.
@@ -26,8 +26,42 @@ import (
"github.com/minio/minio/pkg/madmin"
diskhw "github.com/shirou/gopsutil/disk"
"github.com/shirou/gopsutil/host"
)
func getLocalOsInfoOBD(ctx context.Context, r *http.Request) madmin.ServerOsOBDInfo {
addr := r.Host
if globalIsDistErasure {
addr = GetLocalPeer(globalEndpoints)
}
info, err := host.InfoWithContext(ctx)
if err != nil {
return madmin.ServerOsOBDInfo{
Addr: addr,
Error: err.Error(),
}
}
sensors, err := host.SensorsTemperaturesWithContext(ctx)
if err != nil {
return madmin.ServerOsOBDInfo{
Addr: addr,
Error: err.Error(),
}
}
// ignore user err, as it cannot be obtained reliably inside containers
users, _ := host.UsersWithContext(ctx)
return madmin.ServerOsOBDInfo{
Addr: addr,
Info: info,
Sensors: sensors,
Users: users,
}
}
func getLocalDiskHwOBD(ctx context.Context, r *http.Request) madmin.ServerDiskHwOBDInfo {
addr := r.Host
if globalIsDistErasure {