From a7c979c85fe24a5fc8a7822c54ed01eabc4e25ca Mon Sep 17 00:00:00 2001 From: vibhansa-msft Date: Mon, 4 Sep 2023 12:05:44 +0530 Subject: [PATCH] Add option to ignore-sync for RMAN backup/restore case --- CHANGELOG.md | 8 +++++++- common/types.go | 2 +- component/file_cache/file_cache.go | 10 +++++++++- setup/baseConfig.yaml | 3 ++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6353e8da2..625e7ff1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -## 2.1.0 (WIP) +## 2.1.1 (WIP) +**Features** + +**Bug Fixes** +- RMAN does a sync call after every file upload and then reads file back. Disable deletion from local-cache using a flag to optimize this workflow. + +## 2.1.0 (2023-08-31) **Features** - Added support for ARM64 architecture. - Block cache component added to support faster serial reads of large files with prefetching of blocks diff --git a/common/types.go b/common/types.go index 4da1ba3cf..dd5adf0fc 100644 --- a/common/types.go +++ b/common/types.go @@ -47,7 +47,7 @@ import ( // Standard config default values const ( - blobfuse2Version_ = "2.1.0" + blobfuse2Version_ = "2.1.1-preview.1" DefaultMaxLogFileSize = 512 DefaultLogFileCount = 10 diff --git a/component/file_cache/file_cache.go b/component/file_cache/file_cache.go index 07cd15ccd..04fe47777 100644 --- a/component/file_cache/file_cache.go +++ b/component/file_cache/file_cache.go @@ -74,6 +74,7 @@ type FileCache struct { allowOther bool offloadIO bool syncToFlush bool + syncToDelete bool maxCacheSize float64 defaultPermission os.FileMode @@ -105,6 +106,7 @@ type FileCacheOptions struct { V1Timeout uint32 `config:"file-cache-timeout-in-seconds" yaml:"-"` EmptyDirCheck bool `config:"empty-dir-check" yaml:"-"` SyncToFlush bool `config:"sync-to-flush" yaml:"sync-to-flush,omitempty"` + SyncNoOp bool `config:"ignore-sync" yaml:"ignore-sync,omitempty"` RefreshSec uint32 `config:"refresh-sec" yaml:"refresh-sec,omitempty"` } @@ -229,6 +231,7 @@ func (c *FileCache) Configure(_ bool) error { c.offloadIO = conf.OffloadIO c.maxCacheSize = conf.MaxSizeMB c.syncToFlush = conf.SyncToFlush + c.syncToDelete = !conf.SyncNoOp c.refreshSec = conf.RefreshSec c.tmpPath = common.ExpandPath(conf.TmpPath) @@ -322,6 +325,8 @@ func (c *FileCache) OnConfigChange() { c.policyTrace = conf.EnablePolicyTrace c.offloadIO = conf.OffloadIO c.maxCacheSize = conf.MaxSizeMB + c.syncToFlush = conf.SyncToFlush + c.syncToDelete = !conf.SyncNoOp _ = c.policy.UpdateConfig(c.GetPolicyConfig(conf)) } @@ -1091,7 +1096,7 @@ func (fc *FileCache) SyncFile(options internal.SyncFileOptions) error { log.Trace("FileCache::SyncFile : handle=%d, path=%s", options.Handle.ID, options.Handle.Path) if fc.syncToFlush { options.Handle.Flags.Set(handlemap.HandleFlagDirty) - } else { + } else if fc.syncToDelete { err := fc.NextComponent().SyncFile(options) if err != nil { log.Err("FileCache::SyncFile : %s failed", options.Handle.Path) @@ -1497,6 +1502,9 @@ func init() { syncToFlush := config.AddBoolFlag("sync-to-flush", false, "Sync call on file will force a upload of the file.") config.BindPFlag(compName+".sync-to-flush", syncToFlush) + ignoreSync := config.AddBoolFlag("ignore-sync", false, "Just ignore sync call and do not invalidate locally cached file.") + config.BindPFlag(compName+".ignore-sync", ignoreSync) + config.RegisterFlagCompletionFunc("tmp-path", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { return nil, cobra.ShellCompDirectiveDefault }) diff --git a/setup/baseConfig.yaml b/setup/baseConfig.yaml index c1bdbce72..cd5b7cbcc 100644 --- a/setup/baseConfig.yaml +++ b/setup/baseConfig.yaml @@ -109,7 +109,8 @@ file_cache: offload-io: true|false sync-to-flush: true|false refresh-sec: - + ignore-sync: true|false + # Attribute cache related configuration attr_cache: timeout-sec: