Skip to content

rgw: fix versioning in archive zone - #30667

Closed
smanjara wants to merge 1 commit into
ceph:masterfrom
smanjara:wip-test-archive
Closed

smanjara wants to merge 1 commit into
ceph:masterfrom
smanjara:wip-test-archive

Conversation

@smanjara

@smanjara smanjara commented Oct 1, 2019 •

Copy link
Copy Markdown
Contributor

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

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • 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 backend
  • jenkins test docs
  • jenkins render docs

@smanjara smanjara changed the title Fix versioning in archive zone rgw: fix versioning in archive zone Oct 1, 2019
@smanjara

smanjara commented Oct 3, 2019

Copy link
Copy Markdown
Contributor Author

Still requires multisite suite to be run.

@smanjara

smanjara commented Oct 3, 2019

Copy link
Copy Markdown
Contributor Author

jenkins retest make check

Comment thread src/rgw/rgw_rados.cc Outdated
if (copy_if_newer) {
/* need to get mtime for destination */
ret = get_obj_state(&obj_ctx, dest_bucket_info, dest_obj, &dest_state, false, null_yield);
ret = get_obj_state(&obj_ctx, dest_bucket_info, src_obj, &dest_state, true, null_yield);

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.

ok i'm glad this fix works! before merge though, i'd like to find a way to preserve the ability for fetch_remote_obj() to use a different src_obj and dest_obj

my only idea here is to add two separate args to fetch_remote_obj() (which unfortunately already has a million arguments) for stat_dest_obj and stat_follow_olh

then for normal multisite replication, we'd pass stat_dest_obj=dest_obj and stat_follow_olh=false

and for the archive zone sync module, RGWArchiveDataSyncModule::sync_object() would pass stat_dest_obj=key and stat_follow_olh=true in the /* force version if not set */ case

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@cbodley @smanjara I agree that we should make sure fetch_remote_obj() still does what it does now, but does this fix even work if there are multiple concurrent writes to the different zones on the same object? Seems to me that following the olh for mtime will only work consistently if there's only a single change. Maybe the way to go would be to identify the correct dest by searching for the mtime at the sync module level?

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.

i'm not sure what is meant by finding the correct change; is it related to requiring archive of all unique versions of an object? I'm unconvinced that this is a requirement--but if it is, I'm not certain that modification time is a valid selector for same

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@mattbenjamin the problem here is archiving too many versions of the same object instance. The fix here (if I understand it correctly) tries to eliminate it by identifying that that current versioned head object (on the archive zone) has the same mtime as the source object (which is not necessarily versioned). However, I don't believe that checking the current head object is reliable.

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.

but does this fix even work if there are multiple concurrent writes to the different zones on the same object?

it doesn't, no. with concurrent writes to a non-versioned bucket on active-active zones A and B, replication will converge on the copy with the latest mtime. an archive zone C has no way to guarantee that it can fetch both copies of the object, because the replication between A and B is racing to overwrite one of them

even considering a simpler configuration with a single zone A and archive zone C, what guarantees can the archive zone make about its ability to archive overwrites to an object? if zone A overwrites the object every 10 minutes, and the archive zone's replication delta is lower than that, then it should archive every copy. but the time between overwrites could be arbitratily small, and the replication delta could be arbitrarily large

Maybe the way to go would be to identify the correct dest by searching for the mtime at the sync module level?

even if we do find a copy older than the 'current' archived version and include that mtime in the If-Modified-Since header, if the replication between A and B converges first, we'd still fetch two copies of that latest version and end up with duplicates

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.

I made essentially this argument in a conversation with Casey last week--with the quibble that it satisfies "works" for some definition of consistency. It appeared to me that, as above, it feels too strong to require that every version that existed transiently needs to be captured at the archive zone (but someone might ask for it); meanwhile, it feels almost expected that we would be able to remove duplicates, especially ones arriving at the same time, but maybe in general; with some bound on the number of versions we permit in the archive zone, we could use etag/checksum checks to do that?

@cbodley
cbodley requested a review from yehudasa October 3, 2019 15:24
Comment on lines +1 to +2
overrides:
rgw-multisite:

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.

nice

@@ -15,7 +15,7 @@ overrides:
endpoints: [c1.client.0]

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.

goes in prior commit?

Comment thread src/rgw/rgw_rados.cc Outdated
if (copy_if_newer) {
/* need to get mtime for destination */
ret = get_obj_state(&obj_ctx, dest_bucket_info, dest_obj, &dest_state, false, null_yield);
ret = get_obj_state(&obj_ctx, dest_bucket_info, src_obj, &dest_state, true, null_yield);

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.

i'm not sure what is meant by finding the correct change; is it related to requiring archive of all unique versions of an object? I'm unconvinced that this is a requirement--but if it is, I'm not certain that modification time is a valid selector for same

@yehudasa

yehudasa commented Oct 8, 2019

Copy link
Copy Markdown
Member

@mattbenjamin to clarify, and following our conversation, I do not believe that requiring archive of all unique versions of an object is a requirement. When implemented this feature we specifically said that this is not going to happen (not with this architecture).
I'm ok with the general idea here, just we need to make sure that we don't break anything else. Specifically we should limit this change only to the specific code path that we care about here.
As I also mentioned, there are still cases that could end with duplicates of the same object in the archive zone (when there are multiple writes to the same object), but should be solving it for the simple case.

@smanjara

Copy link
Copy Markdown
Contributor Author

@yehudasa @cbodley @mattbenjamin I have tried to preserve fetch_remote_obj()'s original capability by using stat_follow_olh as the differentiator. Please review again. Thanks. Will be fixing test scripts to enable archive zone and run a round of multisite tests.

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

otherwise looks great 👍

Comment thread src/rgw/rgw_data_sync.cc Resolved
@cbodley

cbodley commented Oct 14, 2019

Copy link
Copy Markdown
Contributor

@smanjara it looks like the normal multisite tests are trying to create buckets on the archive zone, which shouldn't be supported. i'd try changing AZone.is_read_only() to return False

@cbodley

cbodley commented Dec 5, 2019

Copy link
Copy Markdown
Contributor

ping @smanjara

@smanjara

smanjara commented Dec 6, 2019

Copy link
Copy Markdown
Contributor Author

ping @smanjara

@cbodley sorry I missed replying earlier. I thought I had enabled AZone.is_read_only(), but after looking at the failures in the log, I realized, it was never passed into the command. Fixed that. Re-testing it.

@smanjara

Copy link
Copy Markdown
Contributor Author

http://qa-proxy.ceph.com/teuthology/smanjara-2019-12-09_11:43:28-rgw:archive-zone-wip-test-archive-distro-basic-smithi/4584427/teuthology.log

2019-12-09T13:27:30.106 INFO:tasks.rgw_multisite_tests:test versioning support on zones ... FAIL
ERROR: test old object version in archive zone
new_bucket_az = az_zones[0].conn.get_bucket(new_bucket_name_az)
S3ResponseError: S3ResponseError: 404 Not Found

Tests fail for cases when bucket name on master zone is deleted. Since bucket removal is not allowed on archive zone, it gets renamed on archive zone to something like "my-bucket-deleted-cc8b5f17f3f7b0b93843609e93fb5d4f". A GETBucket fails to query this new name. The problem seems to come from the bucket remove cleanup part of RGWArchiveBucketMetadataHandler

Tracker opened to address this: https://tracker.ceph.com/issues/43221

@smanjara

Copy link
Copy Markdown
Contributor Author

@cbodley can you please take a look?

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

looks plausible

@smanjara

smanjara commented Dec 12, 2019 •

Copy link
Copy Markdown
Contributor Author

http://qa-proxy.ceph.com/teuthology/smanjara-2019-12-12_11:34:32-rgw:archive-zone-wip-test-archive-distro-basic-smithi/4595861/teuthology.log

11 out of 12 tests passed.
"test versioning support on zones" test failed with S3ResponseError: 403 Forbidden, because we try to remove a delete_marker from archive_zone which is set to read-only.

- rgw-multisite:
- rgw-multisite-tests:
args:
- tasks.rgw_multi.tests_az

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.

other than the new realm description in realms/two-zone-archive.yaml, this tasks.rgw_multi.tests_az line seems to be the only difference from the rgw/multisite suite. do you think there's a way to put two-zone-archive.yaml under rgw/multisite/realms/ and teach the rgw_multisite_tests.py task (or the rgw_multi tests themselves) how to filter the tests based on cluster configuration?

i'd like to make a similar change for pubsub tests, and would rather not duplicate the entire suite again

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.

@cbodley I have removed the archive yamls from here. Will open a new PR for test fixes. I think it is safe to merge.

@smanjara
smanjara force-pushed the wip-test-archive branch 3 times, most recently from 020604a to 1cc790d Compare December 18, 2019 10:36
@cbodley

cbodley commented Dec 18, 2019

Copy link
Copy Markdown
Contributor

jenkins test make check

@cbodley

cbodley commented Dec 18, 2019

Copy link
Copy Markdown
Contributor

jenkins test make check

@cbodley

cbodley commented Dec 19, 2019

Copy link
Copy Markdown
Contributor

make check looks broken here, could you try rebasing?

@cbodley

cbodley commented Feb 6, 2020

Copy link
Copy Markdown
Contributor

@smanjara can you please prioritize rebasing this? we need to get it merged

@smanjara

smanjara commented Feb 7, 2020

Copy link
Copy Markdown
Contributor Author

@smanjara can you please prioritize rebasing this? we need to get it merged

@cbodley, sorry about the delay. It seems like the original issue has resurfaced. Some of the related code has changed. Looking in to it.

…oned source zone,

fetch the current version of src_obj.

Signed-off-by: Shilpa Jagannath <[email protected]>
@stale

stale Bot commented Apr 13, 2020

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.

@stale stale Bot added the stale label Apr 13, 2020
@stale

stale Bot commented Jul 12, 2020

Copy link
Copy Markdown

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!

@stale stale Bot closed this Jul 12, 2020
@smanjara

smanjara commented Apr 3, 2023

Copy link
Copy Markdown
Contributor Author

Replacing this PR with #50841

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.

5 participants