Skip to content

rgw/cloud: Add custom headers for objects transitioned to cloud - #50098

Merged
soumyakoduri merged 1 commit into
ceph:mainfrom
soumyakoduri:wip-skoduri-cloud-trans-azure
Feb 23, 2023
Merged

soumyakoduri merged 1 commit into
ceph:mainfrom
soumyakoduri:wip-skoduri-cloud-trans-azure

Conversation

@soumyakoduri

@soumyakoduri soumyakoduri commented Feb 13, 2023 •

Copy link
Copy Markdown
Contributor

Some of the cloud services, (like MCG Noobaa/Azure Namespace store), may not be able to map and store the objects which contain s3 style metadata keys.

To help such services determine if the objects being transitioned are from RGW and whether or not ignore such attrs, added below two headers for the objects being copied/transitioned from RGW -

  1. x-rgw-cloud : true/false
    (set to "true" if the object is being transitioned/synced from RGW)

  2. x-rgw-cloud-keep-attrs : true/false

  • if set to default "true" , the cloud service should store all the x-amz-meta-rgwx-* attrs. If cannot be mapped/stored, the operation should fail
  • if set to "false", the destination cloud can ignore such attrs and just store the object data being sent.

Also fixed a bug in the cloudtier module wherein the user-defined attrs were not being copied to the cloud endpoint as part of transition

Signed-off-by: Soumya Koduri [email protected]
Fixes: https://tracker.ceph.com/issues/57980
Fixes:https://tracker.ceph.com/issues/58796

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

@soumyakoduri

Copy link
Copy Markdown
Contributor Author

@cbodley @mattbenjamin @yehudasa please let me know if these new headers added seem ok. If yes will add update the document https://docs.ceph.com/en/latest/radosgw/cloud-transition/#object-modification-limitations as well.

Also shall I add these headers for cloud synced objects as well?

@cbodley

cbodley commented Feb 13, 2023

Copy link
Copy Markdown
Contributor
  1. x-rgw-cloud-keep-rgwx-attrs : true/false
  • if set to default "true" , the cloud service should store all the x-amz-meta-rgwx-* attrs. If cannot be mapped/stored, the operation should fail

is there a reason to distinguish between x-amz-meta-rgwx- and any other x-amz-meta- attributes? doesn't cloud tiering expect all of that user-defined object metadata to be mapped/preserved?

@yehudasa

Copy link
Copy Markdown
Member

@cbodley are these even user visible attributes, or ones that we keep internally?

@cbodley

cbodley commented Feb 13, 2023

Copy link
Copy Markdown
Contributor

@cbodley are these even user visible attributes, or ones that we keep internally?

these rgwx attrs aren't stored in rgw's objects, but cloud transition is adding them to the objects we write to remote s3:

x-amz-meta-rgwx-versioned-epoch
x-amz-meta-rgwx-source-mtime
x-amz-meta-rgwx-source-etag
x-amz-meta-rgwx-source-key
x-amz-meta-rgwx-source-version-id

it doesn't look like RGWLCCloudStreamPut::init_send_attrs() is forwarding any x-amz-meta-* metadata stored in the rgw object, but i think it should. and i would expect noobaa not to mangle those metadata attributes either

the idea is that we should be able to someday transition these objects back to rgw in their original form

@soumyakoduri

Copy link
Copy Markdown
Contributor Author

@cbodley are these even user visible attributes, or ones that we keep internally?

these rgwx attrs aren't stored in rgw's objects, but cloud transition is adding them to the objects we write to remote s3:

x-amz-meta-rgwx-versioned-epoch
x-amz-meta-rgwx-source-mtime
x-amz-meta-rgwx-source-etag
x-amz-meta-rgwx-source-key
x-amz-meta-rgwx-source-version-id

it doesn't look like RGWLCCloudStreamPut::init_send_attrs() is forwarding any x-amz-meta-* metadata stored in the rgw object, but i think it should. and i would expect noobaa not to mangle those metadata attributes either

the idea is that we should be able to someday transition these objects back to rgw in their original form

Right! Cloud tier should not be skipping any original object attrs. I will test that case and update. Thanks!

@cbodley

cbodley commented Feb 17, 2023

Copy link
Copy Markdown
Contributor

Right! Cloud tier should not be skipping any original object attrs. I will test that case and update. Thanks!

@soumyakoduri i don't think that's a blocker for progress here; maybe just drop the rgwx- part of x-rgw-cloud-keep-rgwx-attrs header and document that it covers the mapping of all x-amz-meta- attrs?

@soumyakoduri
soumyakoduri force-pushed the wip-skoduri-cloud-trans-azure branch from 3e8ecc3 to 3eecafb Compare February 20, 2023 06:23
@soumyakoduri
soumyakoduri requested review from a team as code owners February 20, 2023 06:23
@soumyakoduri
soumyakoduri force-pushed the wip-skoduri-cloud-trans-azure branch from 3eecafb to 192755d Compare February 20, 2023 06:30
@soumyakoduri

Copy link
Copy Markdown
Contributor Author

Right! Cloud tier should not be skipping any original object attrs. I will test that case and update. Thanks!

@soumyakoduri i don't think that's a blocker for progress here; maybe just drop the rgwx- part of x-rgw-cloud-keep-rgwx-attrs header and document that it covers the mapping of all x-amz-meta- attrs?

Done. I even addressed this bug of not copying "x-amz-" attrs in this PR. Please review.

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

Docs suggestions

Comment thread doc/radosgw/cloud-transition.rst Outdated

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.

Maybe expand attrs to attributes?
And s/all the//

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.

Done. Thanks! Please review.

@soumyakoduri
soumyakoduri force-pushed the wip-skoduri-cloud-trans-azure branch 2 times, most recently from 936c3f0 to 41de07b Compare February 20, 2023 06:39
Comment thread src/rgw/driver/rados/rgw_lc_tier.cc Outdated
Comment on lines 534 to 535

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.

there's a boost::algorithm::istarts_with() that looks perfect for this

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.

I observed that user defined attrs are stored with extra 'user-' prefix in RGW (for eg., user-x-amz-meta-key1). So I used std::strstr here to split and fetch only the original key (x-amz-meta-key1) to be added as header.

Comment thread doc/radosgw/cloud-transition.rst Outdated

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.

x-rgw-cloud-keep-attrs

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.

Done.

Some of the cloud services, (like MCG Noobaa/Azure Namespace store),
may not be able to map and store the objects which contain s3 style
metadata keys.

To help such services determine if the objects being transitioned
are from RGW and whether or not ignore such attrs, added below two
headers for the objects being copied/transitioned from RGW -

1) x-rgw-cloud : true/false
(set to "true" if the object is being transitioned/synced from RGW)

2) x-rgw-cloud-keep-attrs : true/false
- if set to default "true" , the cloud service should store all the
x-amz-meta-* attrs. If cannot be mapped/stored, the operation
should fail
- if set to "false", the destination cloud can ignore such attrs and
just store the object data being sent.

Also fixed a bug in the cloudtier module wherein the user-defined attrs
were not being copied to the cloud endpoint as part of transition

Fixes: https://tracker.ceph.com/issues/57980
Fixes: https://tracker.ceph.com/issues/58796

Signed-off-by: Soumya Koduri <[email protected]>
@soumyakoduri
soumyakoduri force-pushed the wip-skoduri-cloud-trans-azure branch from 41de07b to 9c3264f Compare February 20, 2023 17:34
@soumyakoduri

Copy link
Copy Markdown
Contributor Author

jenkins render docs

@cbodley

cbodley commented Feb 22, 2023

Copy link
Copy Markdown
Contributor

p.s. please use the public "pulpito.ceph.com" links instead of "pulpito.front.sepia.ceph.com" so people without vpn access can view the results!

@soumyakoduri

Copy link
Copy Markdown
Contributor Author

p.s. please use the public "pulpito.ceph.com" links instead of "pulpito.front.sepia.ceph.com" so people without vpn access can view the results!

Thanks Casey! Updated the links.

@soumyakoduri
soumyakoduri merged commit 9f0440e into ceph:main Feb 23, 2023
@soumyakoduri soumyakoduri mentioned this pull request May 29, 2023
4 of 14 tasks
@soumyakoduri
soumyakoduri deleted the wip-skoduri-cloud-trans-azure branch August 19, 2024 08:22
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