Repository navigation
rgw: chunk encoding fixes - #35350
mdw-at-linuxbox wants to merge 5 commits into
Conversation
mattbenjamin
left a comment
There was a problem hiding this comment.
this looks very promising; is beast work in progress?
There was a problem hiding this comment.
hmm, well as you specify, we can't merge this--is there civetweb change proposed in a PR as well?
|
Yes, the parallel civetweb fix is: |
|
I want to address beast too -- but that will probably be a separate PR (unless this is still pending...) |
|
"make check" failed due to the civetweb submodule change - to be expected. |
|
Is there a need to implement the send_close methods individually by the frontends, can't we just implement a ClientIO::send_close() which sends the HTTP close similar to how we do 100/continues for all the frontends. |
fe620b9 to
e2c8ea7
Compare
|
I have pushed an updated set of commits for this. I left off the "boto2" and "transfer-encoding/content-length" conflict fixes - I'll have separate PR's for that. This should just be the "safe" non-controversial changes. Note this still reuqires a civetweb update. This time I pushed the commits to ceph's civetweb; that means this should pass - but the civetweb fixes should still be commited to ceph-master for the sake of everyone's sanity. |
|
"send_close" is a bad name for that logic. It implies an immediancy of operation that is in fact incorrect. It is necessary to close the connection after sending the error response, which is quite a different thing. As it stands, all of the logic that decides to do "set-must-close" is contained within the frontend, so I didn't see any reason to add it to the generic interface. If there's a good reason for the rest of rgw to know about it, then I don't see a reason not to do this, but I don't quite know what "set-must-close" actually means for fcgi or for nfs. |
|
For beast - this does fix one beast specific thing (set-must-close) - but all the code is in rgw; no beast changes required. |
e2c8ea7 to
80e85d7
Compare
|
I may have botched the civetweb changes - I missed one commit for sure ,but I may have other problems. |
80e85d7 to
44de124
Compare
|
I fixed my botched refactor. This should build now. |
|
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. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
a note about commit e7b4863 - |
|
@mdw-at-linuxbox mark says this needs a rebase, and notes we couldn't merge because no teuthology run was done; what about the related PRs? What should be on master and pacific? |
e7b4863 to
578d74d
Compare
|
as discussed, rebased and teuthology job submitted: |
|
one of the tempest tests ( excerpt: |
|
@mdw-at-linuxbox please note the teuthology results above, |
578d74d to
356699a
Compare
|
I pushed a new version of this patch. This should address the "kafka cammel connector" problem in a more comprehensive sense. It will need more testing. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
I've been exploring the tempest failure with my latest version. So far, I've failed to recreate it. Examining teuthology failures, it looks like this may be specific to ubuntu and the beast front-end, which I have not yet tried. Also, my last set of commits here failed to build in ceph-ci; hopefully a rebase which i have to do anyways will fix that. |
For chunked transfers, the "content-length" field is not required and should not be specified by the client. That means that it is not correct to always require that the content-length field be supplied. Fixes: https://tracker.ceph.com/issues/45789 Signed-off-by: Marcus Watts <[email protected]>
s3 clients *should* provide an x-amz-decoded-content-length field when they use transport-encoding: chunked. Some clients do not. With swift we already allow chunked uploads that do not specify the content length in advance. This commit adds similar support for s3. Known client affected by this: boto2. Fixes: https://tracker.ceph.com/issues/45789 Signed-off-by: Marcus Watts <[email protected]>
The existing logic for chunk headers assumes there will be ony one field specified for chunk header, and that that field will be named will be "chunk-signature". RFC 2616/7230 make it clear it's possible to put other fields there, so there may be S3 clients now or in the future that do so. Additionally Amazon could in the future extend S3 to make use of this feature of the protocol. This patch adds more robust parsing of the fields in the chunk header. It should be capable of handling a more diverse mix of present and future clients. Fixes: https://tracker.ceph.com/issues/45790 Signed-off-by: Marcus Watts <[email protected]>
With transfer-encoding: chunked, it is possible for bad data to cause a the body read to fail early. If this happens, the input pointer will be left pointing to the middle of the data that could not be consumed, which will cause subsequent attempts to read a request on this connection to see the wrong data. This is not useful, and it can lead to worse problems. The only safe recovery choice is to close the connection after issuing an error message. This commit adds support to do this. Fixes: https://tracker.ceph.com/issues/45789 Signed-off-by: Marcus Watts <[email protected]>
Future proofing exercise. Chunked headers include support for multiple field values, but only one is currently defined. The existing logic assumed only that one field (signature=64 bytes) existed, so read into a fixed size buffer for this and otherwise depended on that fixed size. This new logic attempts to more carefully read a chunk header that might contain other field names, and should no longer be assuming chunked headers are a fixed size; rather it should only require that chunk headers contain at least the signature, and are not too big (1024 byte limit seems plenty generous.) Signed-off-by: Marcus Watts <[email protected]>
356699a to
3b21641
Compare
|
I've pushed a new version of this. This contains the chunkfix code, rebased to the latest master (as of a week ago or so). The most significant change is that civetweb is gone - so this PR no longer contains the civetweb specific bits. A backport effort would need to re-acquire those bits. Even without civetweb, some of the fixes here (especially bc3967a) are important. I pushed this exact version through ceph-ci and teuthology. See http://pulpito.front.sepia.ceph.com:80/mwatts-2021-05-20_01:33:51-rgw-mdw-master-chunkfix-8-distro-basic-smithi/ The teuthology problem turns out to be a tempest problem - it was specifying "transfer-encoding: chunked" twice. The test is currently (recently?) disabled in tempest - https://bugs.launchpad.net/tempest/+bug/1905432 Also this behavior was showing up in ceph without this fix -https://tracker.ceph.com/issues/49747 I'm not sure why ceph was behaving differently on ubuntu, but since the logic for that is contained entirely within beast, I think this behavior is entirely outside the scope of this fix. If it remains a problem it could be within scope for chunkfix phase 2 which already includes beast patches. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
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. |
|
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! |

This is a set of fixes related to transfer-encoding: chunked, which are ready to review.
DNM - pending civetweb changes.
This includes fixes to civetweb - I'll make a separate PR for that to merge into our civetweb repo. That will need to be completed, and this PR will need to be updated to reflect that.
This PR mainly addresses civetweb - although some of the fixes also apply to beast.
I don't have any test logic here - most of the problems arise only with esoteric client software. Most client frameworks (such as boto3) are simply not designed to exercise the edge cases this PR addresses.
This PR addresses these 2 related PR's,
https://tracker.ceph.com/issues/45789
https://tracker.ceph.com/issues/45790