Skip to content

rgw/sync: add copying of mdlog entries in fullsync() - #51829

Closed
thotz wants to merge 1 commit into
ceph:mainfrom
thotz:full-sync-copy-mdlog-entries
Closed

thotz wants to merge 1 commit into
ceph:mainfrom
thotz:full-sync-copy-mdlog-entries

Conversation

@thotz

@thotz thotz commented May 30, 2023

Copy link
Copy Markdown
Contributor

In metadata incremental sync, RGWCloneMetaLogCoroutine copies mdlog entries from the primary zone, so that it can serve those entries to other zones in the case of failover (and it's promoted to the 'metadata master'), these entries are not copied in metadata full sync. so a new zone that syncs all of its metadata from full sync won't have any of the mdlog entries. if that new zone is promoted to the metadata master, it won't be able to serve these entries to other zones hat are behind in incremental sync. so those zones will think they're caught up, but may be missing lots of metadata

Fixes: https://tracker.ceph.com/issues/55770

Contribution Guidelines

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

@thotz
thotz requested a review from a team as a code owner May 30, 2023 10:19
@github-actions github-actions Bot added the rgw label May 30, 2023
Comment thread src/rgw/driver/rados/rgw_sync.cc Resolved
Comment thread src/rgw/driver/rados/rgw_sync.cc Resolved

@cbodley cbodley 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.

we'll need to clone the logs from each period separately. it's not clear to me how this interacts with the loop over periods in RGWMetaSyncCR: https://github.com/ceph/ceph/blob/84296aa/src/rgw/driver/rados/rgw_sync.cc#L2011-L2013

Comment thread src/rgw/driver/rados/rgw_sync.cc Outdated
Comment on lines 1663 to 1655

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.

ultimately we just want to be calling RGWCloneMetaLogCoroutine in a loop, without any of the other stuff below that was copy/pasted from incremental sync

@mattbenjamin

Copy link
Copy Markdown
Contributor

@thotz it seems like it would be better to squash these into 1 commit? the first commit otherwise is adding a bunch of code that I think the second one just removes

In metadata incremental sync, RGWCloneMetaLogCoroutine copies mdlog entries
from the primary zone, so that it can serve those entries to other zones in
the case of failover (and it's promoted to the 'metadata master'), these entries
are not copied in metadata full sync. so a new zone that syncs all of its metadata
from full sync won't have any of the mdlog entries. if that new zone is promoted
to the metadata master, it won't be able to serve these entries to other zones
hat are behind in incremental sync. so those zones will think they're caught up,
but may be missing lots of metadata

Signed-off-by: Jiffin Tony Thottan <[email protected]>
@thotz
thotz force-pushed the full-sync-copy-mdlog-entries branch from 8ef6093 to dee4fc3 Compare October 13, 2023 09:40
@thotz
thotz requested review from a team, cbodley and mattbenjamin October 13, 2023 09:40
@thotz

thotz commented Oct 16, 2023

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@thotz

thotz commented Oct 16, 2023

Copy link
Copy Markdown
Contributor Author

jenkins test api

@thotz

thotz commented Oct 16, 2023

Copy link
Copy Markdown
Contributor Author

I have tested the following scenario:

  • Created cluster with master zone us-east and add us-west to it
  • Created the user "a1" and "bkt" via s3. Upload the file into it
  • Added Zone us-north into, sync status was successful. Was able to fetch bkt/file via a1 user credentials and us-north endpoint
  • Now killed server in us-east and change master zone to us-north
  • Added zone us-south into it, sync status throw an error failed to fetch datalog info but I was able to fetch bkt/file via a1 user credentials using us-south endpoint.

@thotz

thotz commented Oct 17, 2023

Copy link
Copy Markdown
Contributor Author

I have tested the following scenario:

* Created cluster with master zone `us-east` and add `us-west` to it

* Created the user "a1" and "bkt" via s3. Upload the file into it

* Added Zone `us-north` into, sync status was successful. Was able to fetch bkt/file via a1 user credentials and us-north endpoint

* Now killed server in `us-east` and change master zone to `us-north`

* Added zone `us-south` into it, sync status throw an error  `failed to fetch datalog info` but I was able to fetch bkt/file via a1 user credentials using `us-south` endpoint.

Above scenario works even without this PR

@github-actions

Copy link
Copy Markdown

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 Dec 16, 2023
@thotz

thotz commented Dec 18, 2023

Copy link
Copy Markdown
Contributor Author

Closing this PR since no longer issue is seen in multicluster enviroment

@github-actions github-actions Bot removed the stale label Dec 18, 2023
@github-actions

Copy link
Copy Markdown

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 Feb 16, 2024
@thotz thotz closed this Feb 19, 2024
@smanjara

smanjara commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

apart from testing, the PR looks ok to me. @cbodley is there more to be done here?

@cbodley

cbodley commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

failover may happen multiple times, generating a new period each time. each period has its own separate mdlog. incremental metadata sync will loop over periods in order and process the mdlogs for each until it's caught up with the current period. so the metadata master zone is expected to serve those mdlogs for all periods that its peers are still referencing

this pr calls RGWCloneMetaLogCoroutine for the current period, but doesn't try to clone the logs for any earlier periods. i think we still need to cover that part, and build test cases that exercise it

@smanjara

smanjara commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

failover may happen multiple times, generating a new period each time. each period has its own separate mdlog. incremental metadata sync will loop over periods in order and process the mdlogs for each until it's caught up with the current period. so the metadata master zone is expected to serve those mdlogs for all periods that its peers are still referencing

this pr calls RGWCloneMetaLogCoroutine for the current period, but doesn't try to clone the logs for any earlier periods. i think we still need to cover that part, and build test cases that exercise it

agreed, thanks! i'll follow up with an update in #70829

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.

4 participants