-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add chunk-dedup flag to support local cas chunk deduplication. #519
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #519 +/- ##
==========================================
- Coverage 37.81% 37.70% -0.11%
==========================================
Files 60 60
Lines 7090 7163 +73
==========================================
+ Hits 2681 2701 +20
- Misses 4097 4149 +52
- Partials 312 313 +1
|
config/config.go
Outdated
@@ -326,6 +327,10 @@ func ParseParameters(args *flags.Args, cfg *SnapshotterConfig) error { | |||
daemonConfig.FsDriver = args.FsDriver | |||
} | |||
|
|||
if args.ChunkDedup { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can not only check if this option is true
because the case of --chunk-dedup=false
is omitted.
Please refer to the pull request at #391.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
config/daemonconfig/fscache.go
Outdated
@@ -45,6 +45,10 @@ type FscacheDaemonConfig struct { | |||
CacheConfig struct { | |||
WorkDir string `json:"work_dir"` | |||
} `json:"cache_config"` | |||
DedupConfig struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
pkg/daemon/daemon.go
Outdated
@@ -260,6 +262,15 @@ func (d *Daemon) sharedFusedevMount(rafs *Rafs) error { | |||
return errors.Wrap(err, "dump instance configuration") | |||
} | |||
|
|||
// static dedup bootstrap | |||
if d.States.ChunkDedup { | |||
log.L.Infoln("sharedFusedevMount, cfg = ", cfg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid printing too many logs. I suppose Debug
level is more reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -118,6 +120,10 @@ type DeviceConfig struct { | |||
DisableIndexedMap bool `json:"disable_indexed_map"` | |||
} `json:"config"` | |||
} `json:"cache"` | |||
Dedup struct { | |||
Enable bool `json:"enable"` | |||
WorkDir string `json:"work_dir"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this WorkDir
option redundant? Otherwise, it should be exported as well to the configuration file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this
WorkDir
option redundant? Otherwise, it should be exported as well to the configuration file.
Nydusd needs WorkDir
to specify the location of the CAS database. "Exported to the configuration file" means to dump WorkDir
into the config file passed to nydusd?
Signed-off-by: xwb1136021767 <[email protected]>
Need rebase. 😉 |
Add chunk-dedup flag to support local cas chunk deduplication. If you want to enable the local cas chunk deduplication function, start nydus-snapshotter with
--chunk-dedup
flag and add dedup related configurations to the nydus configuration file.example: