Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: fix rewrite a versioning object create a new object bug #18662

Merged
merged 1 commit into from Dec 18, 2017

Conversation

ZVampirEM77
Copy link
Contributor

Fixes: http://tracker.ceph.com/issues/21984

  1. List RADOS objects

$ rados -p default.rgw.buckets.data ls

cad03102-431e-4820-942e-efab29247df8.4120.1__shadow:cmhtSYIYdexIZfwSvZQdRQZSVF4i8q7_.74jv0KaZ03PqoWU5st8pEESl9VWCdC6_1
cad03102-431e-4820-942e-efab29247df8.4120.1_ver-10M
cad03102-431e-4820-942e-efab29247df8.4120.1__:cmhtSYIYdexIZfwSvZQdRQZSVF4i8q7_ver-10M
cad03102-431e-4820-942e-efab29247df8.4120.1__shadow:cmhtSYIYdexIZfwSvZQdRQZSVF4i8q7_.74jv0KaZ03PqoWU5st8pEESl9VWCdC6_2

  1. Rewrite a versioning object

$ radosgw-admin object rewrite --bucket=111 --object=ver-10M --object-version=cmhtSYIYdexIZfwSvZQdRQZSVF4i8q7

  1. List RADOS objects again

$ rados -p default.rgw.buckets.data ls

cad03102-431e-4820-942e-efab29247df8.4120.1__shadow:cmhtSYIYdexIZfwSvZQdRQZSVF4i8q7_.74jv0KaZ03PqoWU5st8pEESl9VWCdC6_1
cad03102-431e-4820-942e-efab29247df8.4120.1_ver-10M
cad03102-431e-4820-942e-efab29247df8.4120.1__:cmhtSYIYdexIZfwSvZQdRQZSVF4i8q7_ver-10M
cad03102-431e-4820-942e-efab29247df8.4120.1__shadow:cmhtSYIYdexIZfwSvZQdRQZSVF4i8q7_.osEcr1uHdcP8V6AzRJhzItAtnAUkrCT_2
cad03102-431e-4820-942e-efab29247df8.4120.1__shadow:cmhtSYIYdexIZfwSvZQdRQZSVF4i8q7_.74jv0KaZ03PqoWU5st8pEESl9VWCdC6_2
cad03102-431e-4820-942e-efab29247df8.4120.1__shadow:cmhtSYIYdexIZfwSvZQdRQZSVF4i8q7_.osEcr1uHdcP8V6AzRJhzItAtnAUkrCT_1

  1. List all objects in bucket 111 by s3cmd

$ s3cmd ls s3://111

2017-11-01 07:05 10485760 s3://111/ver-10M

  1. List all entries of garbage collection objects

$ radosgw-admin gc list --include-all

[
{
"tag": "cad03102-431e-4820-942e-efab29247df8.4120.5\u0000",
"time": "2017-11-01 17:07:37.0.587706s",
"objs": [
{
"pool": "default.rgw.buckets.data",
"oid": "cad03102-431e-4820-942e-efab29247df8.4120.1__shadow:cmhtSYIYdexIZfwSvZQdRQZSVF4i8q7_.74jv0KaZ03PqoWU5st8pEESl9VWCdC6_1",
"key": "",
"instance": ""
},
{
"pool": "default.rgw.buckets.data",
"oid": "cad03102-431e-4820-942e-efab29247df8.4120.1__shadow:cmhtSYIYdexIZfwSvZQdRQZSVF4i8q7_.74jv0KaZ03PqoWU5st8pEESl9VWCdC6_2",
"key": "",
"instance": ""
}
]
}
]

@ceph-jenkins
Copy link
Collaborator

all commits in this PR are signed

@ceph-jenkins
Copy link
Collaborator

submodules for project are unmodified

@ceph-jenkins
Copy link
Collaborator

OK - docs built

@ZVampirEM77
Copy link
Contributor Author

@cbodley Please review this PR. Maybe this commit should be backported to luminous.

@ceph-jenkins
Copy link
Collaborator

make check succeeded

1 similar comment
@ceph-jenkins
Copy link
Collaborator

make check succeeded

@ZVampirEM77
Copy link
Contributor Author

@cbodley ping~

1 similar comment
@ZVampirEM77
Copy link
Contributor Author

@cbodley ping~

@mattbenjamin
Copy link
Contributor

@ZVampirEM77 can we get a rebase?

@cbodley cbodley self-assigned this Nov 30, 2017
@ZVampirEM77
Copy link
Contributor Author

@mattbenjamin done~

@cbodley
Copy link
Contributor

cbodley commented Dec 1, 2017

manually tested the rewrite and confirmed that it didn't create a new version 👍

@yuriw
Copy link
Contributor

yuriw commented Dec 12, 2017

2 similar comments
@yuriw
Copy link
Contributor

yuriw commented Dec 12, 2017

@yuriw
Copy link
Contributor

yuriw commented Dec 12, 2017

@yuriw yuriw merged commit 054c364 into ceph:master Dec 18, 2017
mattbenjamin pushed a commit to linuxbox2/ceph that referenced this pull request Jan 3, 2018
A name is almost an oid.  Except that if a name starts
with a _, the corresponding oid starts with a double _.
The copy logic passes the oid straight in as a name,
which results in a triple _ on the oid, resulting in
an object name with a double __.

Fix: remove one _ when converting an oid back into
a name, so that the final oid only has a double _.

Fixes: http://tracker.ceph.com/issues/22529

This change is not needed on master or Luminous, due to
already-merged ceph#18662.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
ivancich pushed a commit to ivancich/ceph-fork that referenced this pull request Mar 27, 2018
A name is almost an oid.  Except that if a name starts
with a _, the corresponding oid starts with a double _.
The copy logic passes the oid straight in as a name,
which results in a triple _ on the oid, resulting in
an object name with a double __.

Fix: remove one _ when converting an oid back into
a name, so that the final oid only has a double _.

Fixes: http://tracker.ceph.com/issues/22529
Resolves: rhbz#1515275

This change is not needed on master or Luminous, due to
already-merged ceph#18662.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
guihecheng pushed a commit to guihecheng/ceph that referenced this pull request Sep 12, 2018
A name is almost an oid.  Except that if a name starts
with a _, the corresponding oid starts with a double _.
The copy logic passes the oid straight in as a name,
which results in a triple _ on the oid, resulting in
an object name with a double __.

Fix: remove one _ when converting an oid back into
a name, so that the final oid only has a double _.

Fixes: http://tracker.ceph.com/issues/22529
Resolves: rhbz#1515275

This change is not needed on master or Luminous, due to
already-merged ceph#18662.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants