[feat]: use DSYNC for xl.meta writes and NOATIME for reads (#11615)

Instead of using O_SYNC, we are better off using O_DSYNC
instead since we are only ever interested in data to be
persisted to disk not the associated filesystem metadata.

For reads we ask customers to turn off noatime, but instead
we can proactively use O_NOATIME flag to avoid atime updates
upon reads.
This commit is contained in:
Harshavardhana
2021-02-24 00:14:16 -08:00
committed by GitHub
parent 14aef52004
commit b517c791e9
14 changed files with 278 additions and 74 deletions
+4 -3
View File
@@ -31,6 +31,7 @@ import (
"github.com/minio/minio/cmd/config/storageclass"
"github.com/minio/minio/cmd/logger"
"github.com/minio/minio/pkg/color"
xioutil "github.com/minio/minio/pkg/ioutil"
"github.com/minio/minio/pkg/sync/errgroup"
sha256 "github.com/minio/sha256-simd"
)
@@ -156,7 +157,7 @@ func newFormatErasureV3(numSets int, setLen int) *formatErasureV3 {
// successfully the version only if the backend is Erasure.
func formatGetBackendErasureVersion(formatPath string) (string, error) {
meta := &formatMetaV1{}
b, err := ioutil.ReadFile(formatPath)
b, err := xioutil.ReadFile(formatPath)
if err != nil {
return "", err
}
@@ -218,7 +219,7 @@ func formatErasureMigrateV1ToV2(export, version string) error {
formatPath := pathJoin(export, minioMetaBucket, formatConfigFile)
formatV1 := &formatErasureV1{}
b, err := ioutil.ReadFile(formatPath)
b, err := xioutil.ReadFile(formatPath)
if err != nil {
return err
}
@@ -251,7 +252,7 @@ func formatErasureMigrateV2ToV3(export, version string) error {
formatPath := pathJoin(export, minioMetaBucket, formatConfigFile)
formatV2 := &formatErasureV2{}
b, err := ioutil.ReadFile(formatPath)
b, err := xioutil.ReadFile(formatPath)
if err != nil {
return err
}