-
Notifications
You must be signed in to change notification settings - Fork 24
Bug fixed for ceph RGW diff fix #248
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
Open
sarwottamdev
wants to merge
1
commit into
clyso:main
Choose a base branch
from
sarwottamdev:bug-diff-fix-ceph-RGW
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+22
−22
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -23,6 +23,7 @@ import ( | |||||
|
|
||||||
| "github.com/hibiken/asynq" | ||||||
| "github.com/redis/go-redis/v9" | ||||||
| "github.com/rs/zerolog" | ||||||
|
|
||||||
| "github.com/clyso/chorus/pkg/dom" | ||||||
| "github.com/clyso/chorus/pkg/entity" | ||||||
|
|
@@ -803,6 +804,7 @@ func (r *DiffSvc) EnsureObjectsDeleted(ctx context.Context, id entity.DiffFixID, | |||||
| return fmt.Errorf("unable to get objects to remove: %w", err) | ||||||
| } | ||||||
|
|
||||||
| zerolog.Ctx(ctx).Warn().Int("count", len(objectsToRemove)).Msg("EnsureObjectsDeleted: checking objects to remove") | ||||||
| client, err := r.clients.AsCommon(ctx, location.Storage, user) | ||||||
| if err != nil { | ||||||
| return fmt.Errorf("unable to obtain client: %w", err) | ||||||
|
|
@@ -833,6 +835,7 @@ func (r *DiffSvc) EnsureObjectsDeleted(ctx context.Context, id entity.DiffFixID, | |||||
| return fmt.Errorf("unable to get objects to copy: %w", err) | ||||||
| } | ||||||
|
|
||||||
| zerolog.Ctx(ctx).Warn().Int("count", len(objectsToCopy)).Msg("EnsureObjectsDeleted: enqueuing copy tasks") | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| for _, object := range objectsToCopy { | ||||||
| payload, err := makePayload(object.Name, object.IsDir) | ||||||
| if err != nil { | ||||||
|
|
@@ -847,5 +850,9 @@ func (r *DiffSvc) EnsureObjectsDeleted(ctx context.Context, id entity.DiffFixID, | |||||
| return fmt.Errorf("unable to clean fix set store: %w", err) | ||||||
| } | ||||||
|
|
||||||
| if _, err := r.fixCopySetStore.Drop(ctx, id); err != nil { | ||||||
| return fmt.Errorf("unable to clean fix copy set store: %w", err) | ||||||
| } | ||||||
|
|
||||||
| return nil | ||||||
| } | ||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -74,10 +74,14 @@ func (s *svc) HandleMigrationObjCopy(ctx context.Context, t *asynq.Task) (err er | |||||
| } | ||||||
| fromVer, toVer := versions.From, versions.To | ||||||
|
|
||||||
| if fromVer != 0 && fromVer <= toVer { | ||||||
| isDiffFix := t.Type() == tasks.TypeDiffFixCopyS3 | ||||||
| if !isDiffFix && fromVer != 0 && fromVer <= toVer { | ||||||
| logger.Info().Int("from_ver", fromVer).Int("to_ver", toVer).Msg("migration obj copy: identical from/to obj version: skip copy") | ||||||
| return nil | ||||||
| } | ||||||
| if isDiffFix { | ||||||
| logger.Warn().Int("from_ver", fromVer).Int("to_ver", toVer).Msg("diff fix copy: proceeding with copy despite version check") | ||||||
| } | ||||||
| // 1. sync obj meta and content | ||||||
| err = lock.Do(ctx, time.Second*2, func() error { | ||||||
| return s.copySvc.CopyObject(ctx, p.ID.User(), copy.File{ | ||||||
|
|
@@ -105,7 +109,11 @@ func (s *svc) HandleMigrationObjCopy(ctx context.Context, t *asynq.Task) (err er | |||||
| return fmt.Errorf("migration obj copy: unable to update obj meta: %w", err) | ||||||
| } | ||||||
| } | ||||||
| logger.Info().Msg("migration obj copy: done") | ||||||
| if isDiffFix { | ||||||
| logger.Warn().Msg("diff fix copy: object copied successfully") | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } else { | ||||||
| logger.Info().Msg("migration obj copy: done") | ||||||
| } | ||||||
|
|
||||||
| return nil | ||||||
| } | ||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
will it be better to use Info level here? Warn should be used to signal that someing goes not as expected.