Skip to content

Bug fixed for ceph RGW diff fix - #248

Merged
arttor merged 1 commit into
clyso:mainfrom
sarwottamdev:bug-diff-fix-ceph-RGW
Aug 24, 2026
Merged

arttor merged 1 commit into
clyso:mainfrom
sarwottamdev:bug-diff-fix-ceph-RGW

Conversation

@sarwottamdev

Copy link
Copy Markdown
Contributor

Diff Fix for Ceph RGW

Description

This PR addresses issues identified during diff migrations against Ceph RGW and fixes cases where valid copy operations were not executed.

1. Object Key Normalization Fix

Updated the normalizeOutputName and normalizeInputName functions to stop prepending a leading / to object keys.

Previously, object keys for non-MinIO providers (such as Ceph RGW) were normalized with a leading slash, causing S3 operations including:

  • StatObject
  • GetObject
  • PutObject

to fail with errors such as:

object missing in source

Object keys are now preserved as-is, ensuring compatibility with Ceph RGW object lookups.

2. Diff Pipeline Fix

File: service/worker/handler/diff_handlers.go

Changes:

  • Removed the len(objectsToRemove) == 0 early return from EnsureObjectsDeleted()
  • Ensured diff-fix copy tasks are always enqueued, even when there are no objects to delete
  • Added fixCopySetStore.Drop() to clean up stale Redis state before creating new diff-fix copy tasks

This prevents scenarios where the diff-fix workflow exits prematurely and skips required copy operations.

3. Diff Fix Copy Version Check Bypass

File: service/worker/handler/migration_obj_copy_handler.go

Added an isDiffFix check to bypass the version validation below for diff-fix copy tasks:

fromVer != 0 && fromVer <= toVer

This prevents valid diff-fix copy operations from being skipped due to version comparison logic that is intended for normal migration workflows rather than repair or reconciliation tasks.

Checklist

  • I have read the CONTRIBUTING.md file.
  • My commits include a Signed-off-by line to certify agreement with the pdated documentation in README.md if applicable.

Note: By submitting this PR, you agree to license your contributions under the Apache 2.0 License _CONDUCT.md.

@aiivashchenko

Copy link
Copy Markdown
Contributor

Hi @sarwottamdev, thank you for pointing this out.

The issue appears to be slightly wider and relates to how keys are treated by back end.

In a short, some back ends respect byte-to-byte keys on put, some are trying to transform them.
An assumption on leading slash wasn't correct indeed.

Written AWS S3 gofakes3 Ceph RGW MinIO SeaweedFS Garage
s1/a s1/a s1/a s1/a s1/a s1/a s1/a
/s2/a /s2/a /s2/a /s2/a s2/a s2/a s2/a
//s3/a //s3/a //s3/a //s3/a s3/a s3/a s3/a
s4//a s4//a s4//a s4//a REJECTED s4/a s4//a
/s5//a /s5//a /s5//a /s5//a s5/a s5/a s5//a
s6/a/ s6/a/ s6/a/ s6/a/ s6/a/ s6/a/ - no data s6/a/

We'll check how that can be addressed and will get back.

Comment thread service/worker/handler/diff_handlers.go Resolved
Comment thread service/worker/handler/diff_handlers.go Resolved
@sarwottamdev
sarwottamdev requested a review from arttor August 20, 2026 06:14
@aiivashchenko

Copy link
Copy Markdown
Contributor

Hi @sarwottamdev. Your concern has been addressed in #251

We've decided to drop off normalization completely, as it is apparently not addressing the problem it was intended for.
It required slightly more changes, therefore it ended up in a separate PR.
Some of the related issues has been addressed in PR as well.

Comment thread service/worker/handler/diff_handlers.go Resolved
Comment thread pkg/objstore/s3_common.go Resolved

@arttor arttor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

one of the log statements still using warn level.

Comment thread service/worker/handler/diff_handlers.go Resolved
@sarwottamdev
sarwottamdev requested a review from arttor August 22, 2026 17:36
@arttor

arttor commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@sarwottamdev CI is failing. Please sign off your commits https://github.com/clyso/chorus/blob/main/CONTRIBUTING.md#submitting-changes

@sarwottamdev
sarwottamdev force-pushed the bug-diff-fix-ceph-RGW branch from 49cf615 to 756a7cd Compare August 24, 2026 08:40
@sarwottamdev

sarwottamdev commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor Author

@arttor Fixed. The branch bug-diff-fix-ceph-RGW has been rewritten with Signed-off-by on all 6 commits and force-pushed. The DCO check should now pass.

The final tree against origin/main:

pkg/objstore/s3_common.go — normalization removed
service/worker/handler/diff_handlers.go — diff pipeline fix
service/worker/handler/migration_obj_copy_handler.go — version check bypass for diff-fix copies

@arttor

arttor commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@sarwottamdev thanks, can you also rebase onto main to resolve conflicts? maybe in this case it is also makes sense to squash commits.

@sarwottamdev
sarwottamdev force-pushed the bug-diff-fix-ceph-RGW branch from 756a7cd to 597f20b Compare August 24, 2026 08:52
- Remove early return in EnsureObjectsDeleted when no objects to remove,
  ensuring diff-fix copy tasks are always enqueued
- Bypass version check for diff-fix copy tasks to prevent valid copies
  from being skipped
- Fix log level for diff-fix version bypass message

(cherry picked from commit 800c78a)

Signed-off-by: Sarwottam-choudhary1 <sarwottamtinku@gmail.com>
@sarwottamdev
sarwottamdev force-pushed the bug-diff-fix-ceph-RGW branch from 597f20b to f84ccf2 Compare August 24, 2026 08:54
@sarwottamdev

Copy link
Copy Markdown
Contributor Author

@arttor Rebased onto main and squashed into a single commit. Conflicts resolved.

@arttor
arttor merged commit 8084223 into clyso:main Aug 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants