Skip to content

RGW - Zipper - remove RGWObjectCtx from SAL API#44616

Merged
dang merged 1 commit intoceph:masterfrom
dang:wip-dang-zipper-objctx
Mar 22, 2022
Merged

RGW - Zipper - remove RGWObjectCtx from SAL API#44616
dang merged 1 commit intoceph:masterfrom
dang:wip-dang-zipper-objctx

Conversation

@dang
Copy link
Contributor

@dang dang commented Jan 17, 2022

RGWObjectCtx is a RADOS-specific concept, but it's threaded through the
whole of RGW. Remove it from the SAL API, and from everything above the
line, leaving it only in RadosStore. As part of this, move RGWObjState
to SAL and use it as the key for an Object.

Signed-off-by: Daniel Gryniewicz dang@fprintf.net

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

@dang dang added the rgw label Jan 17, 2022
@dang dang requested review from cbodley and soumyakoduri January 17, 2022 19:50
obj_ctx, head_obj.get());
RGWRados::Object::Write obj_op(&op_target);

ldpp_dout(dpp, 0) << "Luke 2 if_match=" << if_match << dendl;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: cleanup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, missed these

emplace_attr(RGW_ATTR_OBJECT_RETENTION, std::move(obj_retention_bl));
}

ldpp_dout(this, 0) << "Luke 1 if_match=" << if_match << dendl;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: cleanup

Copy link
Contributor

@soumyakoduri soumyakoduri left a comment

Choose a reason for hiding this comment

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

Overall changes look good to me.

return 0;
}

//int DB::Object::get_manifest(const DoutPrefixProvider *dpp, RGWObjManifest **pmanifest)
Copy link
Contributor

Choose a reason for hiding this comment

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

This function may be removed completely from DBStore.

@dang dang force-pushed the wip-dang-zipper-objctx branch 3 times, most recently from e191996 to e25f775 Compare January 19, 2022 19:28
@dang
Copy link
Contributor Author

dang commented Jan 21, 2022

/** Mark further operations on this object as being atomic */
virtual void set_atomic(RGWObjectCtx* rctx) const = 0;
virtual void set_atomic() {
state.is_atomic = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

what does "is_atomic" signify? what semantics should the backend store ensure if it is set to true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems to cause atomic RADOS ops to be used instead of non-atomic ops.

Copy link
Contributor

Choose a reason for hiding this comment

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

okay..thanks! I am unsure if its needed for other stores. But I guess that can be confirmed and cleaned up once the other stores are fully ready.


int get_state(const DoutPrefixProvider *dpp, RGWObjState **pstate, bool follow_olh);
int get_manifest(const DoutPrefixProvider *dpp, RGWObjManifest **pmanifest);
/*int get_manifest(const DoutPrefixProvider *dpp, RGWObjManifest **pmanifest);*/
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: cleanup

Copy link
Contributor

@soumyakoduri soumyakoduri left a comment

Choose a reason for hiding this comment

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

sal* changes look good to me.

@github-actions
Copy link

github-actions bot commented Feb 8, 2022

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@dang dang force-pushed the wip-dang-zipper-objctx branch from e25f775 to 1bdd4fb Compare February 8, 2022 19:39
@dang
Copy link
Contributor Author

dang commented Feb 15, 2022

jenkins test make check

@dang
Copy link
Contributor Author

dang commented Feb 15, 2022

jenkins test make check arm64

@dang
Copy link
Contributor Author

dang commented Feb 15, 2022

jenkins test api

@dang dang force-pushed the wip-dang-zipper-objctx branch from 1bdd4fb to 94b30f7 Compare February 15, 2022 18:41
@dang
Copy link
Contributor Author

dang commented Feb 15, 2022

@andriytk can you review the MOTR bits?

Copy link
Contributor

@andriytk andriytk left a comment

Choose a reason for hiding this comment

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

@dang all looks fine, thanks!

@github-actions
Copy link

github-actions bot commented Mar 7, 2022

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

RGWObjectCtx is a RADOS-specific concept, but it's threaded through the
whole of RGW.  Remove it from the SAL API, and from everything above the
line, leaving it only in RadosStore.  As part of this, move RGWObjState
to SAL and use it as the key for an Object.

Signed-off-by: Daniel Gryniewicz <dang@fprintf.net>
@dang dang force-pushed the wip-dang-zipper-objctx branch from 94b30f7 to 88bcacc Compare March 7, 2022 15:53
@dang
Copy link
Contributor Author

dang commented Mar 9, 2022

@dang
Copy link
Contributor Author

dang commented Mar 9, 2022

jenkins test api

1 similar comment
@dang
Copy link
Contributor Author

dang commented Mar 22, 2022

jenkins test api

@dang
Copy link
Contributor Author

dang commented Mar 22, 2022

jenkins test windows

@andriytk
Copy link
Contributor

andriytk commented Sep 8, 2022

Hello @dang, I have a question: in the latest motr sal code we are using RGWObjectCtx to set the error msg from MotrObject::get_obj_state(), in case the object does not exist, see Seagate#368. Could you advise, please, how/where this error can be set after this change?

BTW, it seems the problem with setting the correct error msg also exists with RADOS backend, but I'm not 100% sure. Here is what I found in the latest code in the main branch:

ceph/src/rgw/rgw_rest_s3.cc

Lines 5255 to 5259 in 72f8cfa

* FIXME Missing headers:
* With a working errordoc, the s3 error fields are rendered as HTTP headers,
* x-amz-error-code: NoSuchKey
* x-amz-error-message: The specified key does not exist.
* x-amz-error-detail-Key: foo

Thank you in advance!

@cdeshmukh
Copy link

cdeshmukh commented Sep 14, 2022

Hi @dang, can you please suggest some way if you know, i believe you must of thought of same when doing these changes. We(cortx-rgw) are based out of quincy release right now and we will face issues when we rebase with main in future.

@cbodley
Copy link
Contributor

cbodley commented Sep 14, 2022

in the latest motr sal code we are using RGWObjectCtx to set the error msg from MotrObject::get_obj_state()

@andriytk @cdeshmukh this feels like a layering violation to me. MotrObject::get_obj_state() should't assume that a req_state even exists - these sal apis can be called through background threads like GC/LC, radosgw-admin commands, or test cases where there is no request context

if there's a need to pass more-specific errors back up to the calling RGWOp, we might look at adding new ERR_ codes to rgw_common.h to represent those. but in this case, it looks like some RGWOps would just need to map ENOENT-> "The specified key does not exist." and ERR_PRECONDITION_FAILED -> "At least one of the pre-conditions you specified did not hold."

if i understand correctly, all radosgw backends would lack these error messages, so this shouldn't be solved in the motr layer

that linked PR mentions "copy object operation" specifically, so i'd start with RGWCopyObj and RGWPutObj. if we only want these messages in S3 and not Swift responses, they would go in RGWCopyObj_ObjStore_S3::send_partial_response() and RGWPutObj_ObjStore_S3::send_response()

ivancich added a commit to ivancich/ceph-fork that referenced this pull request Sep 14, 2022
get_obj_head_ioctx returns an int where 0 indicates success. When
called in RGWRados::check_disk_state the result was treated as a
booleann with inverted logic. This fixes that error.

This was already fixed in PR ceph#44616 as part of a larger commit, but
this PR unifies the codebase, so various backports are consistent.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
ivancich added a commit to ivancich/ceph-fork that referenced this pull request Sep 14, 2022
get_obj_head_ioctx returns an int where 0 indicates success. When
called in RGWRados::check_disk_state the result was treated as a
booleann with inverted logic. This fixes that error.

This was already fixed in PR ceph#44616 as part of a larger commit, but
this PR unifies the codebase, so various backports are consistent.

This also adds additional logging.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
ivancich added a commit to ivancich/ceph-fork that referenced this pull request Sep 14, 2022
get_obj_head_ioctx returns an int where 0 indicates success. When
called in RGWRados::check_disk_state the result was treated as a
booleann with inverted logic. This fixes that error.

This was already fixed in PR ceph#44616 as part of a larger commit, but
this PR unifies the codebase, so various backports are consistent.

This also adds additional logging.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
ivancich added a commit to ivancich/ceph-fork that referenced this pull request Sep 15, 2022
get_obj_head_ioctx returns an int where 0 indicates success. When
called in RGWRados::check_disk_state the result was treated as a
booleann with inverted logic. This fixes that error.

This was already fixed in PR ceph#44616 as part of a larger commit, but
this PR unifies the codebase, so various backports are consistent.

This also adds additional logging.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
@cdeshmukh
Copy link

in the latest motr sal code we are using RGWObjectCtx to set the error msg from MotrObject::get_obj_state()

@andriytk @cdeshmukh this feels like a layering violation to me. MotrObject::get_obj_state() should't assume that a req_state even exists - these sal apis can be called through background threads like GC/LC, radosgw-admin commands, or test cases where there is no request context

thanks @cbodley for the details, we raised this to understand proper ways of handling it.
And probably we can add additional check that req_state exists and then only proceed to use it, until we correct this approach & finish testing thoroughly.

if there's a need to pass more-specific errors back up to the calling RGWOp, we might look at adding new ERR_ codes to rgw_common.h to represent those. but in this case, it looks like some RGWOps would just need to map ENOENT-> "The specified key does not exist." and ERR_PRECONDITION_FAILED -> "At least one of the pre-conditions you specified did not hold."

Yes, its needed for AWS S3 compliance

if i understand correctly, all radosgw backends would lack these error messages, so this shouldn't be solved in the motr layer

Agree, our approach was for time being until we understand proper ways, for which this query was raised.

that linked PR mentions "copy object operation" specifically, so i'd start with RGWCopyObj and RGWPutObj. if we only want these messages in S3 and not Swift responses, they would go in RGWCopyObj_ObjStore_S3::send_partial_response() and RGWPutObj_ObjStore_S3::send_response()

Yes, targeting in S3 alone for AWS compliance.

@cbodley
Copy link
Contributor

cbodley commented Sep 16, 2022

Yes, its needed for AWS S3 compliance

we've never really considered these error messages to be part of the s3 api for compliance purposes - only the error codes like NoSuchKey/PreconditionFailed along with the http status

these error messages are helpful for clients trying to debug issues so i definitely support adding more, but we shouldn't require them to match AWS' error messages verbatim

ivancich added a commit to ivancich/ceph-fork that referenced this pull request Sep 23, 2022
get_obj_head_ioctx returns an int where 0 indicates success. When
called in RGWRados::check_disk_state the result was treated as a
booleann with inverted logic. This fixes that error.

This was already fixed in PR ceph#44616 as part of a larger commit, but
this PR unifies the codebase, so various backports are consistent.

This also adds additional logging.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 28d04e8)
ivancich added a commit to ivancich/ceph-fork that referenced this pull request Sep 23, 2022
get_obj_head_ioctx returns an int where 0 indicates success. When
called in RGWRados::check_disk_state the result was treated as a
booleann with inverted logic. This fixes that error.

This was already fixed in PR ceph#44616 as part of a larger commit, but
this PR unifies the codebase, so various backports are consistent.

This also adds additional logging.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 28d04e8)
ivancich added a commit to ivancich/ceph-fork that referenced this pull request Sep 23, 2022
get_obj_head_ioctx returns an int where 0 indicates success. When
called in RGWRados::check_disk_state the result was treated as a
booleann with inverted logic. This fixes that error.

This was already fixed in PR ceph#44616 as part of a larger commit, but
this PR unifies the codebase, so various backports are consistent.

This also adds additional logging.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 28d04e8)
ivancich added a commit to ivancich/ceph-fork that referenced this pull request Sep 28, 2022
get_obj_head_ioctx returns an int where 0 indicates success. When
called in RGWRados::check_disk_state the result was treated as a
booleann with inverted logic. This fixes that error.

This was already fixed in PR ceph#44616 as part of a larger commit, but
this PR unifies the codebase, so various backports are consistent.

This also adds additional logging.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 28d04e8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants