Skip to content

Commit

Permalink
remove write-back cache config
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmeenkaur committed Jan 6, 2025
1 parent 4f52888 commit eb46378
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 28 deletions.
12 changes: 0 additions & 12 deletions cfg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ type FileSystemConfig struct {
TempDir ResolvedPath `yaml:"temp-dir"`

Uid int64 `yaml:"uid"`

WriteBackCache bool `yaml:"write-back-cache"`
}

type GcsAuthConfig struct {
Expand Down Expand Up @@ -555,12 +553,6 @@ func BuildFlagSet(flagSet *pflag.FlagSet) error {

flagSet.IntP("uid", "", -1, "UID owner of all inodes.")

flagSet.BoolP("write-back-cache", "", true, "Specifies whether to allow write-back caching. Write-Back cache improves write performance, especially for small writes, by allowing the kernel to buffer and coalesce writes before sending them to the filesystem. This can result in fewer, larger writes, but may affect data consistency if the underlying storage is modified externally. When streaming writes are enabled, write back cache is disabled.")

if err := flagSet.MarkHidden("write-back-cache"); err != nil {
return err
}

flagSet.IntP("write-block-size-mb", "", 64, "Specifies the block size for streaming writes. The value should be more than 0.")

if err := flagSet.MarkHidden("write-block-size-mb"); err != nil {
Expand Down Expand Up @@ -904,10 +896,6 @@ func BindFlags(v *viper.Viper, flagSet *pflag.FlagSet) error {
return err
}

if err := v.BindPFlag("file-system.write-back-cache", flagSet.Lookup("write-back-cache")); err != nil {
return err
}

if err := v.BindPFlag("write.block-size-mb", flagSet.Lookup("write-block-size-mb")); err != nil {
return err
}
Expand Down
12 changes: 0 additions & 12 deletions cfg/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,6 @@
default: -1
usage: "UID owner of all inodes."

- config-path: "file-system.write-back-cache"
flag-name: "write-back-cache"
type: "bool"
usage: "Specifies whether to allow write-back caching. Write-Back cache
improves write performance, especially for small writes, by allowing the
kernel to buffer and coalesce writes before sending them to the filesystem.
This can result in fewer, larger writes, but may affect data consistency if
the underlying storage is modified externally. When streaming writes are
enabled, write back cache is disabled."
default: true
hide-flag: true

- flag-name: "foreground"
config-path: "foreground"
type: "bool"
Expand Down
1 change: 0 additions & 1 deletion cfg/rationalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func resolveStatCacheMaxSizeMB(v isSet, c *MetadataCacheConfig) {
func resolveStreamingWriteConfig(c *Config) {
if c.Write.ExperimentalEnableStreamingWrites {
c.Write.CreateEmptyFile = false
c.FileSystem.WriteBackCache = false
}

c.Write.BlockSizeMb *= util.MiB
Expand Down
1 change: 0 additions & 1 deletion cfg/rationalize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ func TestRationalize_WriteConfig(t *testing.T) {
assert.Equal(t, tc.expectedCreateEmptyFile, tc.config.Write.CreateEmptyFile)
assert.Equal(t, tc.expectedMaxBlocksPerFile, tc.config.Write.MaxBlocksPerFile)
assert.Equal(t, tc.expectedBlockSizeMB, tc.config.Write.BlockSizeMb)
assert.False(t, tc.config.FileSystem.WriteBackCache)
}
})
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ func getFuseMountConfig(fsName string, newConfig *cfg.Config) *fuse.MountConfig
// users experience the performance gains. E.g. if a user workload tries to
// access two files under same directory parallely, then the lookups also
// happen parallely.
EnableParallelDirOps: !(newConfig.FileSystem.DisableParallelDirops),
DisableWritebackCaching: !(newConfig.FileSystem.WriteBackCache),
EnableParallelDirOps: !(newConfig.FileSystem.DisableParallelDirops),
// We disable write-back cache when streaming writes are enabled.
DisableWritebackCaching: newConfig.Write.ExperimentalEnableStreamingWrites,
}

mountCfg.ErrorLogger = logger.NewLegacyLogger(logger.LevelError, "fuse: ")
Expand Down

0 comments on commit eb46378

Please sign in to comment.