Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ type Storage struct {

StorageRegion string `json:"storage_region" toml:"storage_region" yaml:"storage_region"`

// copy behaviour control option
StorageOptimizeCopy bool `json:"storage_optimize_copy" toml:"storage_optimize_copy" yaml:"storage_optimize_copy"`

// File storage default s3. Available: s3, fs
StorageType string `json:"storage_type" toml:"storage_type" yaml:"storage_type"`

Expand Down
9 changes: 7 additions & 2 deletions pkg/proc/interaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,14 @@ func ListFilesToCopy(prefix string, port uint64, cfg config.Storage, src storage
path := strings.TrimPrefix(objectMetas[i].Path, cfg.StoragePrefix)
reworked := path
if _, ok := vi[reworked]; !ok {
ylogger.Zero.Info().Int("index", i).Str("object path", objectMetas[i].Path).Msg("not in virtual index, skipping...")
skipCopy := config.InstanceConfig().StorageCnf.StorageOptimizeCopy
skipped = append(skipped, objectMetas[i])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok that some objects are present in both lists (skipped and toCopy) when StorageOptimizeCopy=false?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this list is for verbosity purposes, actual user (ProcessCopyExtended) ignores this.

continue

ylogger.Zero.Info().Int("index", i).Str("reworked name", reworked).Str("object path", objectMetas[i].Path).Bool("skipping", skipCopy).Msg("not in virtual index")

if skipCopy {
continue
}
}
if sz, ok := copiedSizes[objectMetas[i].Path]; ok {
ylogger.Zero.Info().
Expand Down
Loading