]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
5 years agoceph-volume: never log to stdout, use stderr instead 29602/head
Jan Fajerski [Thu, 8 Aug 2019 08:42:37 +0000 (10:42 +0200)]
ceph-volume: never log to stdout, use stderr instead

We should never print log messages to stdout, as this should be reserved
for output of ceph-volume.

Fixes: https://tracker.ceph.com/issues/41158
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit b8d6dcbe9f803c96c0af68da54f1262e9b6a9e77)

5 years agoceph-volume: terminal: encode unicode when writing to stdout
Kefu Chai [Sun, 24 Mar 2019 09:11:31 +0000 (17:11 +0800)]
ceph-volume: terminal: encode unicode when writing to stdout

python determins the encoding of stdout and stderr based on the LC_CTYPE
and PYTHONIOENCODING env variable, by default, python3's sys.stdout uses
'utf-8' as its encoding, so it will be able to write unicode string even
the stdout is not attached to a tty device. but when it comes to
python2, it will default to ascii if neither of these variabls is set.
so, if we are writing unicode using `_Write` in an environment where
LC_CTYPE and/or PYTHONIOENCODING are using non UTF-8 encoding, it chokes
by raising `UnicodeEncodeError` exception.

in this change, we add a wrapper around `_Write._writer` so it is able
to write unicode string in such a non-unicode-friendly environment.

for more info related the encoding of stdout and stderr, see
https://docs.python.org/3/using/cmdline.html#envvar-PYTHONIOENCODING .

Signed-off-by: Alfredo Deza <adeza@redhat.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 77912c0c71874a23785d3bdd109ad61e4f4c0e28)

5 years agoMerge pull request #29507 from jan--f/wip-41138-mimic
Jan Fajerski [Wed, 7 Aug 2019 08:18:45 +0000 (10:18 +0200)]
Merge pull request #29507 from jan--f/wip-41138-mimic

mimic: ceph-volume prints errors to stdout with --format json

5 years agoceph-volume: print most logging messages to stderr 29507/head
Jan Fajerski [Mon, 4 Mar 2019 10:28:13 +0000 (11:28 +0100)]
ceph-volume: print most logging messages to stderr

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
Fixes: http://tracker.ceph.com/issues/38548
(cherry picked from commit 1f8f1e95dee88b4bab2d6931e720ed83584d2887)

 Conflicts:
src/pybind/mgr/test_orchestrator/module.py
        removed

5 years agoMerge pull request #29417 from jan--f/wip-41022-mimic
Jan Fajerski [Wed, 7 Aug 2019 06:44:00 +0000 (08:44 +0200)]
Merge pull request #29417 from jan--f/wip-41022-mimic

mimic: simple: when 'type' file is not present activate fails

5 years agoMerge pull request #29255 from smithfarm/wip-39274-mimic
Yuri Weinstein [Tue, 6 Aug 2019 21:19:37 +0000 (14:19 -0700)]
Merge pull request #29255 from smithfarm/wip-39274-mimic

mimic: rgw: S3 policy evaluated incorrectly

Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agoMerge pull request #29256 from smithfarm/wip-39415-mimic
Yuri Weinstein [Tue, 6 Aug 2019 21:19:15 +0000 (14:19 -0700)]
Merge pull request #29256 from smithfarm/wip-39415-mimic

mimic: rgw: multisite: period pusher gets 403 Forbidden against other zonegroups

Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agoMerge pull request #29262 from smithfarm/wip-39748-mimic
Yuri Weinstein [Tue, 6 Aug 2019 21:18:55 +0000 (14:18 -0700)]
Merge pull request #29262 from smithfarm/wip-39748-mimic

mimic: rgw: Add support for --bypass-gc flag of radosgw-admin bucket rm command in RGW Multi-site

Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agoMerge pull request #29267 from smithfarm/wip-40128-mimic
Yuri Weinstein [Tue, 6 Aug 2019 21:18:30 +0000 (14:18 -0700)]
Merge pull request #29267 from smithfarm/wip-40128-mimic

mimic: rgw: Swift interface: server side copy fails if object name contains '?'

Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agoMerge pull request #29268 from smithfarm/wip-40136-mimic
Yuri Weinstein [Tue, 6 Aug 2019 21:18:07 +0000 (14:18 -0700)]
Merge pull request #29268 from smithfarm/wip-40136-mimic

mimic: rgw: the Multi-Object Delete operation of S3 API wrongly handles the Code response element

Reviewed-by: Matt Benjamin <mbenjami@redhat.com>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agoMerge pull request #29270 from smithfarm/wip-40141-mimic
Yuri Weinstein [Tue, 6 Aug 2019 21:17:35 +0000 (14:17 -0700)]
Merge pull request #29270 from smithfarm/wip-40141-mimic

mimic: rgw: multisite: 'radosgw-admin bucket sync status' should call syncs_from(source.name) instead of id

Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agoMerge pull request #29273 from smithfarm/wip-40144-mimic
Yuri Weinstein [Tue, 6 Aug 2019 21:16:18 +0000 (14:16 -0700)]
Merge pull request #29273 from smithfarm/wip-40144-mimic

mimic: rgw: Multisite sync corruption for large multipart obj

Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agoMerge pull request #29277 from smithfarm/wip-40225-mimic
Yuri Weinstein [Tue, 6 Aug 2019 21:15:35 +0000 (14:15 -0700)]
Merge pull request #29277 from smithfarm/wip-40225-mimic

mimic: rgw_file: include tenant when hashing bucket names

Reviewed-by: Matt Benjamin <mbenjami@redhat.com>
5 years agoMerge pull request #29279 from smithfarm/wip-40351-mimic
Yuri Weinstein [Tue, 6 Aug 2019 21:15:06 +0000 (14:15 -0700)]
Merge pull request #29279 from smithfarm/wip-40351-mimic

mimic: rgw/OutputDataSocket: append_output(buffer::list&) says it will (but does not) discard output at data_max_backlog

Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agoMerge pull request #29284 from smithfarm/wip-40354-mimic
Yuri Weinstein [Tue, 6 Aug 2019 21:14:44 +0000 (14:14 -0700)]
Merge pull request #29284 from smithfarm/wip-40354-mimic

mimic: rgw: multisite: RGWListBucketIndexesCR for data full sync needs pagination

Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agoMerge pull request #29285 from smithfarm/wip-40357-mimic
Yuri Weinstein [Tue, 6 Aug 2019 21:14:21 +0000 (14:14 -0700)]
Merge pull request #29285 from smithfarm/wip-40357-mimic

mimic: rgw: provide admin-friendly reshard status output

Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agoMerge pull request #29288 from smithfarm/wip-40360-mimic
Yuri Weinstein [Tue, 6 Aug 2019 21:13:54 +0000 (14:13 -0700)]
Merge pull request #29288 from smithfarm/wip-40360-mimic

mimic: rgw: set null version object issues

Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agomimic: ceph-volume broken assertion errors after pytest changes 29417/head
Jan Fajerski [Tue, 6 Aug 2019 13:34:12 +0000 (15:34 +0200)]
mimic: ceph-volume broken assertion errors after pytest changes

This fixes a backported test that was not fixed on a backport. Original
fix: https://github.com/ceph/ceph/pull/28948. Backport:
https://github.com/ceph/ceph/pull/29243.

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
5 years agoMerge pull request #29463 from jan--f/wip-41056-mimic
Alfredo Deza [Mon, 5 Aug 2019 20:17:53 +0000 (16:17 -0400)]
Merge pull request #29463 from jan--f/wip-41056-mimic

mimic: ceph-volume does not recognize wal/db partitions created by ceph-disk

Reviewed-by: Alfredo Deza <adeza@redhat.com>
5 years agoceph-volume: fall back to PARTTYPE if PARTLABEL is empty 29463/head
Jan Fajerski [Tue, 30 Jul 2019 15:32:06 +0000 (17:32 +0200)]
ceph-volume: fall back to PARTTYPE if PARTLABEL is empty

In some cases ceph-disk does not populate PARTLABEL for wal and db
partitions. This commit adds the assumption that the empty string is a
valid label and falls back to identifying those disks by PARTTYPE.

Fixes: https://tracker.ceph.com/issues/40917
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit 82d2ae7ffdf62ca93c7848fb62e506db4cda893c)

5 years agoceph-volume: adjust tests for empty PARTLABEL fields
Jan Fajerski [Tue, 30 Jul 2019 15:29:09 +0000 (17:29 +0200)]
ceph-volume: adjust tests for empty PARTLABEL fields

It seems like ceph-disk sometimes creates OSDs where the wal and db
partitions have no PARTLABEL set. This commit alters tests so that the
empty string is considered a valid label.

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit bb29110c3c6e081568231131c70522dee6d12bb5)

5 years agoceph-volume: refactor ceph-disk_member unittests
Jan Fajerski [Tue, 30 Jul 2019 11:29:22 +0000 (13:29 +0200)]
ceph-volume: refactor ceph-disk_member unittests

This adds a parameterized fixture as input to the tests. Should make
writing new tests easier since only fixture parameters need to be added.
In the future we should be able to reuse the fixtures to build other
fixtures and reuse the parametrization.

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit f42287c3416ad09c112e64756f5051c5c13aa344)

5 years agoceph-volume tests: ensure that better heuristics exist for objectstore detection
Alfredo Deza [Mon, 29 Jul 2019 19:50:14 +0000 (15:50 -0400)]
ceph-volume tests: ensure that better heuristics exist for objectstore detection

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit e48ad3ab26fdab72755bc933781db3bfc6001a30)

5 years agoceph-volume simple.activate better detect bluestore/filestore when type is not found
Alfredo Deza [Mon, 29 Jul 2019 19:46:48 +0000 (15:46 -0400)]
ceph-volume simple.activate better detect bluestore/filestore when type is not found

Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit b6a449e2e3241aaa2c0eb8fa9f74b5d939c97852)

5 years agoMerge pull request #29029 from liewegas/wip-mgr-crash-py3-mimic
Yuri Weinstein [Tue, 30 Jul 2019 16:11:43 +0000 (09:11 -0700)]
Merge pull request #29029 from liewegas/wip-mgr-crash-py3-mimic

mimic: mgr/crash: fix python3 invalid syntax problems

Reviewed-by: Nathan Cutler <ncutler@suse.com>
5 years agoMerge pull request #29150 from pdvian/wip-40269-mimic
Yuri Weinstein [Tue, 30 Jul 2019 16:11:12 +0000 (09:11 -0700)]
Merge pull request #29150 from pdvian/wip-40269-mimic

mimic: build/ops: make "patch" build dependency explicit

Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #29197 from smithfarm/wip-38963-mimic
Yuri Weinstein [Tue, 30 Jul 2019 16:10:43 +0000 (09:10 -0700)]
Merge pull request #29197 from smithfarm/wip-38963-mimic

mimic: mgr: DaemonServer::handle_conf_change - broken locking

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Mykola Golub <mgolub@mirantis.com>
5 years agoMerge pull request #29201 from smithfarm/wip-40268-mimic
Yuri Weinstein [Tue, 30 Jul 2019 16:09:58 +0000 (09:09 -0700)]
Merge pull request #29201 from smithfarm/wip-40268-mimic

mimic: common: data race in OutputDataSocket

Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agoMerge pull request #29217 from smithfarm/wip-39692-mimic
Yuri Weinstein [Tue, 30 Jul 2019 16:09:25 +0000 (09:09 -0700)]
Merge pull request #29217 from smithfarm/wip-39692-mimic

mimic: bluestore: _txc_add_transaction error (39) Directory not empty not handled on operation 21 (op 1, counting from 0)

Reviewed-by: Igor Fedotov <ifedotov@suse.com>
5 years agoMerge pull request #29243 from jan--f/mimic-c-v-extend-batch
Jan Fajerski [Mon, 29 Jul 2019 15:57:41 +0000 (17:57 +0200)]
Merge pull request #29243 from jan--f/mimic-c-v-extend-batch

mimic: c-v extend batch

5 years agoceph-volume: create two NVME drives for testing 29243/head
Andrew Schoen [Tue, 27 Nov 2018 23:34:10 +0000 (17:34 -0600)]
ceph-volume: create two NVME drives for testing

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
Resolves: bz#1650306
(cherry picked from commit 893b61b256bcff142dbd90b777b2c9df9e032e9d)

5 years agoceph-volume: set block_db_size to 9GB in centos7 mixed type test
Andrew Schoen [Wed, 28 Nov 2018 16:10:24 +0000 (10:10 -0600)]
ceph-volume: set block_db_size to 9GB in centos7 mixed type test

This is to enable testing of the --block-db-size flag

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit eab962c6ef68c588674bdac6fc4a86c84714f300)

5 years agoceph-volume: use two NVME drives in centos7 mixed_type tests
Andrew Schoen [Wed, 28 Nov 2018 16:05:45 +0000 (10:05 -0600)]
ceph-volume: use two NVME drives in centos7 mixed_type tests

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit 934c32acb318aac9aff3c800cdbf99bbdee04d06)

6 years agoMerge pull request #29350 from jan--f/wip-40977-mimic
Alfredo Deza [Fri, 26 Jul 2019 18:33:21 +0000 (14:33 -0400)]
Merge pull request #29350 from jan--f/wip-40977-mimic

mimic: ceph-volume: missing string substitution when reporting mounts

Reviewed-by: Alfredo Deza <adeza@redhat.com>
6 years agoceph-volume:util: Use proper param substition 29350/head
Shyukri Shyukriev [Fri, 7 Jun 2019 12:09:19 +0000 (12:09 +0000)]
ceph-volume:util: Use proper param substition

Fixes: https://tracker.ceph.com/issues/25030
Signed-off-by: Shyukri Shyukriev <shshyukriev@suse.com>
(cherry picked from commit 654660cd89fe9d93087d390805651c860bf4e862)

6 years agoMerge pull request #26991 from ceph/backport-mimic-26957
Alfredo Deza [Thu, 25 Jul 2019 15:54:37 +0000 (11:54 -0400)]
Merge pull request #26991 from ceph/backport-mimic-26957

mimic: ceph-volume: look for rotational data in lsblk

Reviewed-by: Alfredo Deza <adeza@redhat.com>
6 years agoceph-volume: look for rotational data in lsblk 26991/head
Andrew Schoen [Thu, 14 Mar 2019 20:14:40 +0000 (15:14 -0500)]
ceph-volume: look for rotational data in lsblk

Also ask lsblk if a device is rotational if no information
is found in /sys/block, default to True if nothing is found.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1666822

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit de748f9aef894b247622ee5dc49c1fbc31097ad0)

6 years agoMerge pull request #28918 from smithfarm/wip-40222-mimic
Yuri Weinstein [Thu, 25 Jul 2019 14:37:25 +0000 (07:37 -0700)]
Merge pull request #28918 from smithfarm/wip-40222-mimic

mimic: mds: reset heartbeat during long-running loops in recovery

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
6 years agoMerge pull request #29187 from xiaoxichen/wip-40875-mimic
Yuri Weinstein [Thu, 25 Jul 2019 14:36:55 +0000 (07:36 -0700)]
Merge pull request #29187 from xiaoxichen/wip-40875-mimic

mimic: cephfs: client: bump ll_ref from int32 to uint64_t

Reviewed-by: Venky Shankar <vshankar@redhat.com>
6 years agoMerge pull request #29200 from smithfarm/wip-39685-mimic
Yuri Weinstein [Thu, 25 Jul 2019 14:36:25 +0000 (07:36 -0700)]
Merge pull request #29200 from smithfarm/wip-39685-mimic

mimic: cephfs: ceph-fuse: client hang because its bad session PipeConnection to mds

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
6 years agoMerge pull request #29208 from smithfarm/wip-40317-mimic
Yuri Weinstein [Thu, 25 Jul 2019 14:35:41 +0000 (07:35 -0700)]
Merge pull request #29208 from smithfarm/wip-40317-mimic

mimic: tests: test_volume_client: print python version correctly

Reviewed-by: Venky Shankar <vshankar@redhat.com>
6 years agoMerge pull request #29210 from smithfarm/wip-38099-mimic
Yuri Weinstein [Thu, 25 Jul 2019 14:35:08 +0000 (07:35 -0700)]
Merge pull request #29210 from smithfarm/wip-38099-mimic

mimic: mds: remove cache drop admin socket command

Reviewed-by: Venky Shankar <vshankar@redhat.com>
6 years agoMerge pull request #29211 from smithfarm/wip-38687-mimic
Yuri Weinstein [Thu, 25 Jul 2019 14:34:17 +0000 (07:34 -0700)]
Merge pull request #29211 from smithfarm/wip-38687-mimic

mimic: kcephfs TestClientLimits.test_client_pin fails with client caps fell below min

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
6 years agoMerge pull request #27028 from mrandybu/mimic-alt
Yuri Weinstein [Wed, 24 Jul 2019 23:06:01 +0000 (16:06 -0700)]
Merge pull request #27028 from mrandybu/mimic-alt

mimic: ceph_detect_init: Add support for ALT Linux

Reviewed-by: Yuri Weinstein <yweinste@redhat.com>
6 years agoMerge pull request #28210 from votdev/fix_rgw_issue
Yuri Weinstein [Wed, 24 Jul 2019 23:04:23 +0000 (16:04 -0700)]
Merge pull request #28210 from votdev/fix_rgw_issue

mimic: mgr/dashboard: Fix various RGW issues

Reviewed-by:  Tiago Melo <tmelo@suse.com>

6 years agoMerge pull request #28911 from bk201/wip-40660-mimic
Yuri Weinstein [Wed, 24 Jul 2019 23:03:24 +0000 (16:03 -0700)]
Merge pull request #28911 from bk201/wip-40660-mimic

mimic: mgr/dashboard: cephfs multimds graphs stack together

Reviewed-by: Ricardo Dias <rdias@suse.com>
6 years agoMerge pull request #29024 from ifed01/wip-ifed-fix-len0-mimic
Yuri Weinstein [Wed, 24 Jul 2019 23:02:19 +0000 (16:02 -0700)]
Merge pull request #29024 from ifed01/wip-ifed-fix-len0-mimic

mimic: os/bluestore: avoid length overflow in extents returned by Stupid Allocator

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
6 years agoMerge pull request #29174 from neha-ojha/wip-40583-mimic
Yuri Weinstein [Wed, 24 Jul 2019 23:00:55 +0000 (16:00 -0700)]
Merge pull request #29174 from neha-ojha/wip-40583-mimic

mimic: common/options.cc: Lower the default value of osd_deep_scrub_large_omap_object_key_threshold

Reviewed-by: David Zafman <dzafman@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
6 years agoMerge pull request #29189 from badone/wip-mimic-lazy-omap-stats-backport-tracker...
Yuri Weinstein [Wed, 24 Jul 2019 22:59:50 +0000 (15:59 -0700)]
Merge pull request #29189 from badone/wip-mimic-lazy-omap-stats-backport-tracker-38552

mimic: core: lazy omap stat collection

Reviewed-by: Neha Ojha <nojha@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
6 years agoMerge pull request #29196 from smithfarm/wip-37749-mimic
Yuri Weinstein [Wed, 24 Jul 2019 22:58:23 +0000 (15:58 -0700)]
Merge pull request #29196 from smithfarm/wip-37749-mimic

mimic: tools: Add clear-data-digest command to objectstore tool

Reviewed-by: David Zafman <dzafman@redhat.com>
6 years agotest/rgw: test truncated reads in RGWHTTPManager 29273/head
Casey Bodley [Mon, 3 Jun 2019 14:59:00 +0000 (10:59 -0400)]
test/rgw: test truncated reads in RGWHTTPManager

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit c669cf293f02b3c68a4c539d7accf7ddf35cb1ee)

Conflicts:
    src/test/rgw/test_http_manager.cc
- RGWHTTP::process() only takes one argument in mimic

6 years agorgw: set null version object acl issues 29288/head
Tianshan Qu [Sun, 11 Nov 2018 11:56:51 +0000 (19:56 +0800)]
rgw: set null version object acl issues

1.set null version object acl will create empty index
RGWRados::set_attrs did not clear instance, so index prepare, complete got instance=null,
which lead to empty index 1000_<obj>_i_null.
there is no harm to create empty index, but listomapkeys to find that key.

2.if object is exist with versioned key, we can set none exists null version object
order:
1) enable bucket version
2) put obj
3) disable bucket version
4) set versoned_id=null acl will succeed which should not

Fixes: http://tracker.ceph.com/issues/36763
Signed-off-by: Tianshan Qu <tianshan@xsky.com>
(cherry picked from commit ca6e5c89e8d6da498da15f0eea4bcd4d271b44e9)

6 years agorgw: provide admin friendly reshard status output 29285/head
Mark Kogan [Sun, 12 May 2019 13:45:30 +0000 (09:45 -0400)]
rgw: provide admin friendly reshard status output

Signed-off-by: Mark Kogan <mkogan@redhat.com>
(cherry picked from commit ba4167c2f30fbb868482d48aaada6388f58de920)

6 years agorgw: update the "radosgw-admin reshard status"
Mark Kogan [Tue, 11 Dec 2018 17:43:32 +0000 (12:43 -0500)]
rgw: update the "radosgw-admin reshard status"
command documentation with expected output examples

Fixes: http://tracker.ceph.com/issues/37615
Signed-off-by: Mark Kogan <mkogan@redhat.com>
(cherry picked from commit 8565ec0db69223ae71766ba000eecc0d2f7d14c2)

6 years agorgw/multisite:RGWListBucketIndexesCR for data full sync pagination 29284/head
Shilpa Jagannath [Thu, 16 May 2019 09:15:46 +0000 (14:45 +0530)]
rgw/multisite:RGWListBucketIndexesCR for data full sync pagination

RGWListBucketIndexesCR uses the 'marker' from remote zone's RGWOp_Metadata_List
admin api to list all keys for data sync.

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

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
(cherry picked from commit 708ba6dcc90525c8c4316760e01ee9b1e6da21b7)

Conflicts:
src/rgw/rgw_data_sync.cc
- trivial

6 years agoMerge pull request #29016 from ivancich/mimic-abort-multipart-fix
Yuri Weinstein [Wed, 24 Jul 2019 15:26:33 +0000 (08:26 -0700)]
Merge pull request #29016 from ivancich/mimic-abort-multipart-fix

mimic: rgw: abort multipart fix

Reviewed-by: Casey Bodley <cbodley@redhat.com>
6 years agoMerge pull request #29021 from smithfarm/wip-39074-mimic
Yuri Weinstein [Wed, 24 Jul 2019 15:26:07 +0000 (08:26 -0700)]
Merge pull request #29021 from smithfarm/wip-39074-mimic

mimic: rgw: multisite: data sync loops back to the start of the datalog after reaching the end

Reviewed-by: Casey Bodley <cbodley@redhat.com>
6 years agoMerge pull request #29139 from ivancich/mimic-fix-resharding-race
Yuri Weinstein [Wed, 24 Jul 2019 15:25:38 +0000 (08:25 -0700)]
Merge pull request #29139 from ivancich/mimic-fix-resharding-race

mimic: rgw: fix race b/w bucket reshard and ops waiting on reshard completion

Reviewed-by: Casey Bodley <cbodley@redhat.com>
6 years agoMerge pull request #29017 from smithfarm/wip-38080-mimic
Yuri Weinstein [Wed, 24 Jul 2019 15:22:59 +0000 (08:22 -0700)]
Merge pull request #29017 from smithfarm/wip-38080-mimic

mimic: multisite: overwrites in versioning-suspended buckets fail to sync

Reviewed-by: Casey Bodley <cbodley@redhat.com>
6 years agorgw/OutputDataSocket: actually discard data on full buffer 29279/head
Matt Benjamin [Wed, 5 Jun 2019 17:25:32 +0000 (13:25 -0400)]
rgw/OutputDataSocket: actually discard data on full buffer

A dout message in OutputDataSocket::append_output() states that
data will be dropped when appending would cause data_max_backlog
to be exceeded--but the method appends it anyway.

Log output discards at level 0, as messages will be lost.  Suppress
repeated warnings mod 100.  Switch to vector.

Fixes: http://tracker.ceph.com/issues/40178
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit c806b825dae649829de8847d36cb21ffd2bbee8e)

Conflicts:
src/common/OutputDataSocket.cc
src/common/OutputDataSocket.h

6 years agorgw_file: pretty-print fh_key 29277/head
Matt Benjamin [Wed, 5 Jun 2019 14:40:08 +0000 (10:40 -0400)]
rgw_file: pretty-print fh_key

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 84a2c22108a3d15b836680894ba750b637e49cd2)

6 years agorgw_file: include tenant in hashes of object
Matt Benjamin [Wed, 5 Jun 2019 11:25:35 +0000 (07:25 -0400)]
rgw_file: include tenant in hashes of object

Because bucket names are taken as object names in the top
of an export.  Make hashing by tenant general to avoid disjoint
hashing of bucket.

Fixes: http://tracker.ceph.com/issues/40118
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 8e0fd5fbfa7c770f6b668e79b772179946027bce)

6 years agorgw_file: include tenant when hashing bucket names
Matt Benjamin [Wed, 15 May 2019 19:53:32 +0000 (15:53 -0400)]
rgw_file: include tenant when hashing bucket names

Prevent identical paths from distinct tenants from colliding in
RGW NFS handle cache.

Fixes: http://tracker.ceph.com/issues/40118
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit b800a9de83dff23a150ed7d236cb61c8b7d971ae)

Conflicts:
src/rgw/rgw_file.cc
- ceph_assert

6 years agorgw: fix miss handle curl error return
Tianshan Qu [Fri, 31 May 2019 10:37:44 +0000 (18:37 +0800)]
rgw: fix miss handle curl error return

if meet tcp packet loss, curl return will be result=18(CURLE_PARTIAL_FILE)
and http_status=200, so sync will continue and cause content miss match.

Fixes: https://tracker.ceph.com/issues/39992
Signed-off-by: Tianshan Qu <tianshan@xsky.com>
(cherry picked from commit 9b7025857026c64cf076e82d762556ac2bcd2625)

6 years agoceph-volume: add explicit mixed-type functional tests
Jan Fajerski [Wed, 16 Jan 2019 12:48:25 +0000 (13:48 +0100)]
ceph-volume: add explicit mixed-type functional tests

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit bea35c63c83fc2ab87fc983774ed8181cbe74e5b)

6 years agorgw: fetch_remote_obj() compares expected object size
Casey Bodley [Wed, 29 May 2019 21:11:13 +0000 (17:11 -0400)]
rgw: fetch_remote_obj() compares expected object size

if the size of object data received doesn't match the value returned in
the Rgwx-Object-Size header, fail with -EIO

Fixes: https://tracker.ceph.com/issues/39992
Signed-off-by: Xiaoxi CHEN <xiaoxchen@ebay.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit c6c4c5639ea34c49329719c2725886e740acd0b3)

6 years agoradosgw-admin: fix syncs_from in 'bucket sync status' 29270/head
Casey Bodley [Fri, 24 May 2019 20:59:34 +0000 (16:59 -0400)]
radosgw-admin: fix syncs_from in 'bucket sync status'

If a zone is set up with sync_from_all=false, the bucket sync status
command will incorrectly report "not in sync_from" because it's calling
'zone.syncs_from(source.id)', where syncs_from() expects a zone name
instead of id

Fixes: http://tracker.ceph.com/issues/40022
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 9da888686c3a8880976cd604bdafc4361068c985)

Conflicts:
src/rgw/rgw_zone.h
- in mimic, this code is in src/rgw/rgw_rados.h - made the change there instead

6 years agorgw: dump s3_code as the Code response element in RGWDeleteMultiObj_ObjStore_S3. 29268/head
Radoslaw Zarzynski [Tue, 13 Dec 2016 16:19:56 +0000 (17:19 +0100)]
rgw: dump s3_code as the Code response element in RGWDeleteMultiObj_ObjStore_S3.

Fixes: http://tracker.ceph.com/issues/18241
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
(cherry picked from commit 8406083fb14042cb461a3aaa84b82fd78df5168f)

6 years agoceph-volume: add tests for Device.lvm_size
Andrew Schoen [Thu, 6 Dec 2018 18:45:10 +0000 (12:45 -0600)]
ceph-volume: add tests for Device.lvm_size

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit 01185fb32479f271beeb14dcf94e32b1401ad2d9)

6 years agoceph-volume: adds a lvm_size property to util.Device
Andrew Schoen [Wed, 5 Dec 2018 15:43:28 +0000 (09:43 -0600)]
ceph-volume: adds a lvm_size property to util.Device

This will give us the size lvm should report because it takes into
account the 1GB physical extent size we set.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit 5197c16b44fcf344862201549777dc2935fc19a3)

6 years agorgw: parse_copy_location defers url-decode 29267/head
Casey Bodley [Tue, 11 Dec 2018 21:13:58 +0000 (16:13 -0500)]
rgw: parse_copy_location defers url-decode

don't url-decode until after we search for the ?, or we'll truncate
object names that contain a url-encoded ?

Fixes: http://tracker.ceph.com/issues/27217
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 804bb853f1c7b5ce546c100d61c6fc526838c134)

6 years agoceph-volume: functional tests, add libvirt customization
Jan Fajerski [Thu, 20 Dec 2018 12:53:41 +0000 (13:53 +0100)]
ceph-volume: functional tests, add libvirt customization

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit c330a4758755e3815b30e4f00a4a00e8319db399)

6 years agorgw: delete_obj_index() takes mtime for bilog 29262/head
Casey Bodley [Mon, 6 May 2019 19:01:07 +0000 (15:01 -0400)]
rgw: delete_obj_index() takes mtime for bilog

writing an empty timestamp to the bilog prevents other zones from
applying the delete. this means that the --bypass-gc flag for
'radosgw-admin bucket rm' doesn't work in multisite

Fixes: http://tracker.ceph.com/issues/24991
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 0316a81875ae93a06841d532bf3548c81370296e)

6 years agorgw: RGWPeriodPusher uses zone system key for inter-zonegroup messages 29256/head
Casey Bodley [Sat, 13 Apr 2019 15:34:21 +0000 (11:34 -0400)]
rgw: RGWPeriodPusher uses zone system key for inter-zonegroup messages

RGWPeriodPusher was using an empty RGWAccessKey for inter-zonegroup
messages, which were rejected as an anonymous user with 403 Forbidden.
this prevented multi-zonegroup configurations from converging on the
same period configuration

Fixes: http://tracker.ceph.com/issues/39287
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit f97be8cb6e025442607042d9defc01542049d472)

Conflicts:
src/rgw/rgw_period_pusher.cc
- mimic has store where master has store->svc.zone (in the argument list)

6 years agorgw: Evaluating bucket policies also while reading permissions for an object that... 29255/head
Pritha Srivastava [Mon, 1 Apr 2019 15:39:22 +0000 (21:09 +0530)]
rgw: Evaluating bucket policies also while reading permissions for an object that is non-existent.

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

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
(cherry picked from commit 5eb50b7d10da51db72f705807c87775562b79b63)

Conflicts:
src/rgw/rgw_op.cc
- bucket_policy.verify_permission() takes different arguments in mimic

6 years agoos/bluestore: be verbose about objects that existing on rmcoll 29217/head
Sage Weil [Thu, 2 May 2019 16:39:31 +0000 (11:39 -0500)]
os/bluestore: be verbose about objects that existing on rmcoll

This is always a bug (OSD doesn't try to remove a collection unless it
thinks it is empty), and not seeing it at default debug levels makes it
hard to track down.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit e387cbc45037db78db5dfbb01483b8d76e1c276f)

Conflicts:
src/os/bluestore/BlueStore.cc
- mimic does not have 87e8231d3fa61bc95ea0cda4d731e30f3d4de9d5

6 years agoosd/PrimaryLogPG: disallow ops on objects with an empty name
Sage Weil [Thu, 2 May 2019 16:30:09 +0000 (11:30 -0500)]
osd/PrimaryLogPG: disallow ops on objects with an empty name

These may conflict with pgmeta objects.  And are going to cause other
problems later (e.g., https://tracker.ceph.com/issues/38724).

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit bf6e8a4a4db8b7d7101ca80b844ee953aa4580b2)

6 years agoosd/PG: fix cleanup of pgmeta-like objects on PG deletion
Sage Weil [Thu, 18 Jul 2019 16:09:47 +0000 (11:09 -0500)]
osd/PG: fix cleanup of pgmeta-like objects on PG deletion

If an object has an empty 'name' field, it "looks" like a pgmeta object,
and the PG cleanup code was skipping it.  However, we were letting these
objects get created.

Fix by only skipping *our* pgmeta object.  If there are other pgmeta-like
objects in the PG collection, clean them up.

Fixes: https://tracker.ceph.com/issues/38724
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit a0f48db5cbfc48761eeac0daa259fecbaa573969)

# Conflicts:
# src/osd/PG.cc
- location of this code is do_delete_work in master, _delete_some in n

6 years agocommon: OutputDataSocket retakes mutex on error path 29201/head
Casey Bodley [Thu, 6 Jun 2019 13:48:42 +0000 (09:48 -0400)]
common: OutputDataSocket retakes mutex on error path

the list of buffers is protected by mutex m_lock. when dump_data() fails
and puts unwritten buffers back into the list, it needs to reaquire the
lock

Fixes: http://tracker.ceph.com/issues/40188
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 8645e24dd4fb3ecc9f02b34a1be916620b5f71b1)

Conflicts:
    src/common/OutputDataSocket.cc
- use Mutex::Locker instead of std::scoped_lock

6 years agomgr/DaemonServer: handle_conf_change - fix broken locking 29197/head
xie xingguo [Tue, 26 Mar 2019 08:08:43 +0000 (16:08 +0800)]
mgr/DaemonServer: handle_conf_change - fix broken locking

The is_locked_by_me() is only meant to be safe if you know
you hold the lock. It's meant to be used in an assertion.

Fixes: http://tracker.ceph.com/issues/38899
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit a929a5a01508e661fc7f3cea52822320d39983d2)

Conflicts:
    src/mgr/DaemonServer.cc
- use Mutex::Locker instead of std::lock_guard

6 years agotools: Add clear-data-digest command to objectstore tool. 29196/head
liyichao [Wed, 5 Dec 2018 04:22:20 +0000 (12:22 +0800)]
tools: Add clear-data-digest command to objectstore tool.

There may be a situation where data digest in object info is
inconsistent with that computed from object data, then deep-scrub
will fail even though all three repicas have the same object data.

Fixes: https://tracker.ceph.com/issues/37935
Signed-off-by: Li Yichao <liyichao.good@gmail.com>
(cherry picked from commit da5832b2b49be4ab23f7ffc5ba1ba630168b886f)

Conflicts:
    src/tools/ceph_objectstore_tool.cc
- change cbegin() to begin() to get it to build

6 years agoqa/cephfs: relax min_caps_per_client check 29211/head
Yan, Zheng [Thu, 7 Mar 2019 13:12:28 +0000 (21:12 +0800)]
qa/cephfs: relax min_caps_per_client check

new kernel client proactively release caps. caps count can go below
mds_min_caps_per_client

Fixes: http://tracker.ceph.com/issues/38270
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit 8e81bd74c59259a06f587bb425d58bf2b2176341)

Conflicts:
qa/tasks/cephfs/test_client_limits.py
- mimic TestClientLimits does not have expected_caps method at all

6 years agomds: remove cache drop asok command 29210/head
Patrick Donnelly [Wed, 23 Jan 2019 02:26:38 +0000 (18:26 -0800)]
mds: remove cache drop asok command

`cache drop` is a long running command that will block the asok interface
(while the tell version does not). Attempting to abort the command with ^C or
equivalents will simply cause the `ceph` command to exit but won't stop the
asok command handler from waiting for the cache drop operation to complete.

Instead, just allow the tell version.

Fixes: http://tracker.ceph.com/issues/38020
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 7fa1e3c37f8c7fb709ae9e070a3154a7084c0584)

Conflicts:
PendingReleaseNotes
qa/tasks/cephfs/test_misc.py
src/mds/MDSDaemon.cc

6 years agoqa/tasks/cephfs/test_volume_client: print py2 or py3 which the test case runs 29208/head
Lianne [Tue, 11 Jun 2019 10:27:06 +0000 (18:27 +0800)]
qa/tasks/cephfs/test_volume_client: print py2 or py3 which the test case runs

Fixes: http://tracker.ceph.com/issues/40184
Signed-off-by: Lianne <liyan.wang@xtaotech.com>
(cherry picked from commit 7c7c7870d38902a0df83a0fdecaa56baad556d82)

6 years agoclient: fix fuse client hang because its bad session PipeConnection 29200/head
IvanGuan [Wed, 17 Apr 2019 02:21:54 +0000 (10:21 +0800)]
client: fix fuse client hang because its bad session PipeConnection
to mds.

There still has a risk client will hang all the time and which
happened in my enviroment a few days ago. Well konw, the start
of mds will go through four stages at least(replay, reconnect,
rejoin, active). According to current logic, we recived
replay mdsmap and marked down pipe will return directly and if
we miss the next reconnect mdsmap the client may hang all the
time becuase we lost the opportunity due to old_inc equal to
new_inc. So we shuold judge if we have lost MDSMap::reconnect
by comparing newstate and oldstate.

Fixes: http://tracker.ceph.com/issues/39305
Signed-off-by: Guan yunfei <yunfei.guan@xtaotech.com>
(cherry picked from commit 51c9f5cf9af61fe317259ac79a503ef8a7139622)

Conflicts:
src/client/Client.cc
- mimic has "kick_maxsize_requests(session); wake_inode_waiters(session);"
  where master has just "wake_up_session_caps(session, true)

6 years agomimic: osd: Modify lazy omap stats to only show one copy 29189/head
Brad Hubbard [Tue, 9 Jul 2019 05:03:24 +0000 (15:03 +1000)]
mimic: osd: Modify lazy omap stats to only show one copy

Only show stats from the primary to get more in line with other pg stats
representations.

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit 490829c8eaf14f41de978ac0f93ecda3df8bcdef)

6 years agomimic: tests: Add test for lazy omap stat collection
Brad Hubbard [Mon, 4 Mar 2019 08:12:27 +0000 (18:12 +1000)]
mimic: tests: Add test for lazy omap stat collection

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit 88e9ca58a06ba572ff4c6f6125a8ba7f8e0a7795)

6 years agomimic: osd: Implement lazy omap usage statistics
Brad Hubbard [Tue, 11 Dec 2018 04:00:35 +0000 (14:00 +1000)]
mimic: osd: Implement lazy omap usage statistics

Opportunistic gathering of omap statistics during deep scrub.

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit 9e21ef0e40ff89b10dfdf857c703336496b3171f)

 Conflicts:
doc/dev/placement-group.rst: Trivial
src/osd/osd_types.h: Trivial

6 years agoClient: bump ll_ref from int32 to uint64_t 29187/head
Xiaoxi CHEN [Fri, 19 Jul 2019 15:31:24 +0000 (08:31 -0700)]
Client: bump ll_ref from int32 to uint64_t

ll_ref can surge up if application repeatly lookup same dentry
and finally cause overflow.

https://tracker.ceph.com/issues/40775 is an example.

in kernel fuse driver and libfuse, uint64_t is used, update
ceph-fuse side to match.

Fixes: https://tracker.ceph.com/issues/40775
Signed-off-by: Xiaoxi CHEN <xiaoxchen@ebay.com>
(cherry picked from commit bb46de885336a8cd2adc9c0507e543c6832346e7)

 Conflicts:
src/client/Client.h
        use new code, skip all non-toched changes.
src/client/Inode.h
        use new code.

6 years agocommon/options.cc: Lower the default value of osd_deep_scrub_large_omap_object_key_th... 29174/head
Neha Ojha [Fri, 28 Jun 2019 16:31:35 +0000 (09:31 -0700)]
common/options.cc: Lower the default value of osd_deep_scrub_large_omap_object_key_threshold

Warning when there are already 2M omap keys does not help, reduce this
threshold so that preemptive measures can be taken based on this.

Fixes: https://tracker.ceph.com/issues/40583
Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit 1ec948409ab547effbd5c656af8f0c9565f1717a)

6 years agorgw: add RGWRados::repair_olh() to reconstruct olh attrs 29017/head
Casey Bodley [Fri, 25 Jan 2019 21:44:03 +0000 (16:44 -0500)]
rgw: add RGWRados::repair_olh() to reconstruct olh attrs

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 1309e2d50ee8118afe1138cd6677d84438edb55a)

Conflicts:
    src/rgw/rgw_rados.cc
- no rgw_bl_str() in mimic
- mimic does not have a4d3977cfacc5eb0de16618f2c957bb417505597

6 years agorgw: add RGWRados::bi_get_olh() to read/decode olh entry
Casey Bodley [Fri, 25 Jan 2019 21:43:36 +0000 (16:43 -0500)]
rgw: add RGWRados::bi_get_olh() to read/decode olh entry

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit b8d7f0ad1f882b999e0fd7f3e45f8579599714cf)

Conflicts:
    src/rgw/rgw_rados.cc
- bufferlist::cbegin()

6 years agorgw: bi_get() takes bucket_info
Casey Bodley [Fri, 25 Jan 2019 21:42:50 +0000 (16:42 -0500)]
rgw: bi_get() takes bucket_info

and calls the bucket_info overload of BucketShard::init() to avoid
reading the bucket info again

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit a15e8736340c916120fef1f3a5ff1b982cf7c837)

6 years agorgw: add BucketShard::init overload for bucket_info,obj
Casey Bodley [Fri, 25 Jan 2019 21:17:19 +0000 (16:17 -0500)]
rgw: add BucketShard::init overload for bucket_info,obj

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit c6c445f6074df113a28adcae89248b909d031f8e)

6 years agotest/rgw: add multisite test_version_suspended_incremental_sync
Casey Bodley [Wed, 2 Jan 2019 16:24:45 +0000 (11:24 -0500)]
test/rgw: add multisite test_version_suspended_incremental_sync

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 81fa354c1dadf4f957592f20fe9e02acd70671e0)

Conflicts:
src/test/rgw/rgw_multi/tests.py

6 years agorgw: fetch_remote_obj filters out olh attrs
Casey Bodley [Fri, 4 Jan 2019 20:53:34 +0000 (15:53 -0500)]
rgw: fetch_remote_obj filters out olh attrs

each zone manages its own olh log, so we don't want any of the source
zone's olh attributes. in one case (sync of an object overwrite in a
versioning-suspended bucket), these olh attributes were being written
directly to the head object and leading to link_olh errors due to the
olh_tag mismatch

Fixes: http://tracker.ceph.com/issues/37792
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit a4195fc55fb76f0a2576d5ff0b2c99ad12fd7a49)

6 years agoMerge pull request #29020 from smithfarm/wip-39047-mimic
Nathan Cutler [Mon, 22 Jul 2019 09:19:00 +0000 (11:19 +0200)]
Merge pull request #29020 from smithfarm/wip-39047-mimic

mimic: rgw: update resharding documentation

Reviewed-by: J. Eric Ivancich <ivancich@redhat.com>
6 years agoMerge pull request #29014 from smithfarm/wip-37891-mimic
Nathan Cutler [Mon, 22 Jul 2019 08:53:54 +0000 (10:53 +0200)]
Merge pull request #29014 from smithfarm/wip-37891-mimic

mimic: doc: wrong value of usage log default in logging section

Reviewed-by: Casey Bodley <cbodley@redhat.com>
6 years agobuild/ops: make "patch" build dependency explicit 29150/head
Nathan Cutler [Wed, 5 Jun 2019 15:30:30 +0000 (17:30 +0200)]
build/ops: make "patch" build dependency explicit

This commit adds "patch" as an explicit build dependency. Before, the RPM
build was installing it in the build environment via some mechanism that I
don't entirely understand.

The "patch" command is used by the BuildBoost cmake module.

Fixes: http://tracker.ceph.com/issues/40175
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit fe632e2d886791e2168ee6200b5bf1bfe8c88d0e)

6 years agorgw: fix race b/w bucket reshard and ops waiting on reshard completion 29139/head
J. Eric Ivancich [Mon, 1 Apr 2019 14:59:51 +0000 (10:59 -0400)]
rgw: fix race b/w bucket reshard and ops waiting on reshard completion

A previous commit (f84f70d4) added functionality to clean up old
bucket instances and bucket shards once sharding completed
successfully. However the existing code that allowed a bucket
operation to wait until resharding completed was relying on a field in
the old bucket instance to know the bucket instance id of the new
bucket instance. This created a race condition as to whether the
clean-up or read of the bucket instance id would occur first.

This solution rereads the bucket entry point object when resharding
completes to determine the bucket instance id of the new bucket
thereby avoiding the race.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 26b793680805721cac86f64cdd234b273bf33be4)

Conflicts:
        src/rgw/rgw_rados.cc: equivalent changes made to rgw_reshard.cc