Skip to content

[DNM] rgw: allow zone to sync from itself (cross bucket sync)#56563

Closed
yehudasa wants to merge 3 commits intoceph:mainfrom
yehudasa:wip-rgw-sync-local
Closed

[DNM] rgw: allow zone to sync from itself (cross bucket sync)#56563
yehudasa wants to merge 3 commits intoceph:mainfrom
yehudasa:wip-rgw-sync-local

Conversation

@yehudasa
Copy link
Member

Enable zone sync to happen from itself. This is probably not the most efficient way to achieve cross bucket sync (within the same zone) functionality, however, it a very minimal change.
Would need to be conditionally enabled.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@yehudasa yehudasa requested a review from a team as a code owner March 28, 2024 18:33
@github-actions github-actions bot added the rgw label Mar 28, 2024
@cbodley
Copy link
Contributor

cbodley commented Mar 29, 2024

without tests or examples, it's hard to tell exactly what this does. maybe you could share a couple examples of replication policies that are enabled by this?

if you have two active-active zones A and B, i would have guessed that cross-bucket policies already work because objects uploaded to A:bucket1 would replicate to B:bucket2, then back to A:bucket2 from there. so is the primary motivation to enable these replication policies in single-zone configurations?

@yehudasa
Copy link
Member Author

@cbodley the scenario that you describe would work only if there's bidirectional sync between A and B. Also, as you pointed out doesn't work at all if there's only a single zone. From the perspective of the S3 API users this can be very confusing as the topology might not even be visible to them and the expectation is that when you replicate a bucket into another one then the data shows up there.

@smanjara
Copy link
Contributor

smanjara commented Apr 1, 2024

what kind of configuration management changes would this entail? a user might just want to replicate buckets within the same zone and not opt for multi-zone env at all. they may also expect to access the replicated buckets with separate accounts, as it seems like the main use case for SRR.

@cbodley
Copy link
Contributor

cbodley commented Apr 2, 2024

is it safe to assume that these sync policy changes cause us to spawn a RGWDataSyncProcessorThread against the local zone's endpoints, consult local sync status when trimming datalogs/bilogs, report on local status in 'radosgw-admin sync status', etc?

This is probably not the most efficient way to achieve cross bucket sync

two thoughts here:

  1. it would be great to take advantage of our ref-counting optimization for server-side copy here
  2. 'local' data sync still has to process every datalog/bilog entry written, even though these cross-bucket events probably represent a small subset of those. that means the cost of this feature scales faster than the value it provides

perhaps we could add a special case to RGWDefaultDataSyncModule::sync_object() for src_zone==dst_zone that skips all calls with src_obj==dst_obj, and calls RGWRados::copy_obj() otherwise? hopefully there's a way to prevent copy_obj() from overwriting new objects with older ones

that could go a long way to reduce the per-object cost of this feature, but the additional cost of polling seems inescapable. considering a zonegroup with two active-active zones, this would double the number of datalog/bilog listing requests overall

@yehudasa
Copy link
Member Author

yehudasa commented Apr 2, 2024

@smanjara we would need to figure out what the correct configuration is. As it is right now this PR is missing the configuration part. It should still work on a single zone (that's how I tested it), but we'll need to create a way to enable/disable this feature.

@yehudasa
Copy link
Member Author

yehudasa commented Apr 2, 2024

@cbodley copying object instead of fetching it sounds like a relatively easy optimization. The RGWObjFetchCR does a bit more than just fetching the object, it also in certain cases stats the remote object to get its tags, so that it can match it with the appropriate replication policy rules. I'm not sure copy pasting all this logic would be the best way forward, can probably add the logic into the RGWObjFetchCR itself.

@cbodley
Copy link
Contributor

cbodley commented Apr 2, 2024

@smanjara we would need to figure out what the correct configuration is. As it is right now this PR is missing the configuration part. It should still work on a single zone (that's how I tested it), but we'll need to create a way to enable/disable this feature.

does the sync policy framework have a way to add a unidirectional pipe from one zone to another? adding such a pipe with src_zone==dst_zone seems like a reasonable way for users to opt in to this

@yehudasa
Copy link
Member Author

yehudasa commented Apr 2, 2024

@smanjara we would need to figure out what the correct configuration is. As it is right now this PR is missing the configuration part. It should still work on a single zone (that's how I tested it), but we'll need to create a way to enable/disable this feature.

does the sync policy framework have a way to add a unidirectional pipe from one zone to another? adding such a pipe with src_zone==dst_zone seems like a reasonable way for users to opt in to this

I'm not sure we allow it explicitly, but that's what this PR does implicitly. We can bake some syntactic sugar into the policy that would be easier for the users to digest.

Remove unneeded params and refactor internal calls

Signed-off-by: Yehuda Sadeh <[email protected]>
When doing local sync use local stat operation, rather
than go through the remote calls.

Signed-off-by: Yehuda Sadeh <[email protected]>
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Jun 14, 2024
@github-actions
Copy link

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants