Project

General

Profile

Actions

Bug #19509

open

cannot sync object with underscore by API(RESTFUL API FOR DR GEO-REPLICATION)

Added by mingshuai wang about 7 years ago. Updated about 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

using this api to sync object:

Extended object PUTWrites an object, return extra object metadata. Extends regular object write.
Syntax
PUT /bucket/object
Extra Response Headers:
1. Rgwx-Mtime: Object modification time.
Sync object from zone within region (intra-region copy)
Syntax:
PUT /bucket/objcect
Extra Params:
1. rgwx-source-zone: the source zone for where
2. rgwx-client-id: the id of the agent that initiated the request
3. rgwx-op-od: a unique op id, created by the agent
It is up for the agent to provide a meaningful client id and a unique (for that agent) op id. These will be used for handling opstate information.


when syncing object with underscore, eg: "_xxx2", rgw will reset object name to "__xxx2". therefore, error(404) occurred when destination-rgw requesting object's info from source-rgw.

-----------------------------------rgw log------------------------------------------

Thu, 06 Apr 2017 08:41:54 +0000
x-amz-copy-source:redick/_xxx2
/redick/_xxx2
2017-04-06 16:41:55.006006 7f5f89ebb700 15 calculated digest=6Wzgpv2CiFwet1pCHybmM/Joa7g=
/redick/_xxx2
2017-04-06 16:41:55.006006 7f5f89ebb700 15 calculated digest=6Wzgpv2CiFwet1pCHybmM/Joa7g=
2017-04-06 16:41:55.006008 7f5f89ebb700 15 auth_sign=6Wzgpv2CiFwet1pCHybmM/Joa7g=
2017-04-06 16:41:55.006013 7f5f89ebb700 15 compare=0
2017-04-06 16:41:55.006021 7f5f89ebb700 20 system request
2017-04-06 16:41:55.006031 7f5f89ebb700 2 req 8746481:0.000191:s3:PUT /redick/_xxx2:copy_obj:reading permissions
2017-04-06 16:41:55.006059 7f5f89ebb700 15 Read AccessControlPolicy<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/&quot;&gt;&lt;Owner&gt;&lt;ID&gt;redick&lt;/ID&gt;&lt;DisplayName&gt;redickwang&lt;/DisplayName&gt;&lt;/Owner&gt;&lt;AccessControlList&gt;&lt;Grant&gt;&lt;Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:type="CanonicalUser"><ID>redick</ID><DisplayName>redickwang</DisplayName></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>
2017-04-06 16:41:55.006067 7f5f89ebb700 2 req 8746481:0.000226:s3:PUT /redick/_xxx2:copy_obj:init op
2017-04-06 16:41:55.006069 7f5f89ebb700 2 req 8746481:0.000228:s3:PUT /redick/_xxx2:copy_obj:verifying op mask
2017-04-06 16:41:55.006078 7f5f89ebb700 20 required_mask= 2 user.op_mask=7
2017-04-06 16:41:55.006085 7f5f89ebb700 2 req 8746481:0.000244:s3:PUT /redick/_xxx2:copy_obj:verifying op permissions
2017-04-06 16:41:55.006112 7f5f89ebb700 15 Read AccessControlPolicy<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/&quot;&gt;&lt;Owner&gt;&lt;ID&gt;redick&lt;/ID&gt;&lt;DisplayName&gt;redickwang&lt;/DisplayName&gt;&lt;/Owner&gt;&lt;AccessControlList&gt;&lt;Grant&gt;&lt;Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:type="CanonicalUser"><ID>redick</ID><DisplayName>redickwang</DisplayName></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessContro
lList></AccessControlPolicy>
2017-04-06 16:41:55.006123 7f5f89ebb700 2 req 8746481:0.000282:s3:PUT /redick/_xxx2:copy_obj:verifying op params
2017-04-06 16:41:55.006124 7f5f89ebb700 2 req 8746481:0.000284:s3:PUT /redick/_xxx2:copy_obj:executing
2017-04-06 16:41:55.006143 7f5f89ebb700 10 x>> x-amz-copy-source:redick/_xxx2
2017-04-06 16:41:55.006167 7f5f89ebb700 5 Copy object redick({i=.main.rgw.buckets.index,e=.main.rgw.buckets.extra}.main.rgw.buckets[sz.459678.75
]):__xxx2 => redick(
{i=.main.rgw.buckets.index,e=.main.rgw.buckets.extra}.main.rgw.buckets[sz.459678.75]):__xxx2
2017-04-06 16:41:55.040710 7f5f89ebb700 20 get_obj_state: rctx=0x7f5f89eb6110 obj=redick:__xxx2
state=0x7f62bc0135d0 s->prefetch_data=0
2017-04-06 16:41:55.041118 7f5f89ebb700 20 RGWEnv::set(): HTTP_DATE: Thu Apr 6 08:41:55 2017
2017-04-06 16:41:55.041123 7f5f89ebb700 20 RGWEnv::set(): HTTP_X_AMZ_COPY_SOURCE: redick/_xxx2
2017-04-06 16:41:55.041131 7f5f89ebb700 10 meta>> HTTP_X_AMZ_COPY_SOURCE
2017-04-06 16:41:55.041140 7f5f89ebb700 10 x>> x-amz-copy-source:redick/_xxx2
2017-04-06 16:41:55.041145 7f5f89ebb700 0 > HTTP_DATE -> Thu Apr 6 08:41:55 2017
2017-04-06 16:41:55.041152 7f5f89ebb700 0 > HTTP_X_AMZ_COPY_SOURCE -> redick/_xxx2
2017-04-06 16:41:55.041165 7f5f89ebb700 10 get_canon_resource(): dest=/redick/__xxx2
2017-04-06 16:41:55.041166 7f5f89ebb700 10 generated canonical header: GET

Thu Apr 6 08:41:55 2017
x-amz-copy-source:redick/_xxx2
/redick/__xxx2
2017-04-06 16:41:55.041201 7f5f89ebb700 15 generated auth header: AWS M4D866DRZ1X2LNGYHGNX:dWhxEhALqJW4ISdPckppB6zKx3s=
2017-04-06 16:41:55.041213 7f5f89ebb700 20 sending request to http://10.x.x.x:80/redick/__xxx2?rgwx-uid=adminuser&rgwx-region=cn&rgwx-prepend-m
etadata=cn
2017-04-06 16:41:55.108653 7f5f89ebb700 10 receive_http_header
2017-04-06 16:41:55.108660 7f5f89ebb700 10 received header:HTTP/1.1 404 Not Found
2017-04-06 16:41:55.108662 7f5f89ebb700 10 receive_http_header
2017-04-06 16:41:55.108677 7f5f89ebb700 10 received header:x-amz-request-id: tx00000000000000027057f-0058e5ff53-16f364-sz
2017-04-06 16:41:55.108688 7f5f89ebb700 10 receive_http_header
2017-04-06 16:41:55.108689 7f5f89ebb700 10 received header:Content-Length: 75
2017-04-06 16:41:55.108699 7f5f89ebb700 10 receive_http_header

Actions #1

Updated by Yehuda Sadeh about 7 years ago

this might have been fixed in jewel

Actions #2

Updated by mingshuai wang about 7 years ago

Yehuda Sadeh wrote:

this might have been fixed

hi, Yehuda Sadeh, thank you for your help.

After backport severl commits from jewel:

object that begins with single "_" and doesn't contain other "_" can be synced. eg: xxx
object that begins with multi "
" cannot be synced. eg: _xxx
object that begins with single "
" but contains other "_" cannot be synced. eg _a_xxx

is this considered as expected?

the commits backported:

d5f8c8e412133dca74de56c8f583cb51104065e2 rgw: unit test for testing rgw_obj encoding correctness
583a2959fb101873f8e53744b9a79fedc64c3b38 rgw: json dump rgw_obj::orig_obj
988979c3ef8a66937b63f5031e0a0ab8b60a3304 rgw: transform from cls_rgw_obj_key to rgw_obj correctly
470afb9cc7a792f09ab417ae833e4ec8b6fae7ef rgw: rgw_obj encoding fixes

Actions

Also available in: Atom PDF