Boris Ranto [Thu, 14 Feb 2019 09:35:56 +0000 (10:35 +0100)]
restful: Fix regression when traversing leaf nodes
The commit 23b6c90 introduced a regression when traversing leaf nodes.
The issue is that it traverses the keys of a `dict` returned by
`nodes_by_id`, not the actual `items` of the node. That resulted in an
500 error because it tried to treat `str` as a `dict` and failed.
zouaiguo [Fri, 30 Mar 2018 08:20:22 +0000 (16:20 +0800)]
mgr/restful: fix py got exception when get osd info
when we create pool by device class, then get osd info by restful,
such as https://192.7.7.36:8003/osd
browser display error, and found excetion in /var/log/ceph/ceph-mgr****.log
2018-03-30 16:07:52.756560 7feef9f17700 0 mgr[restful] Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pecan/core.py", line 570, in __call__
self.handle_request(req, resp)
File "/usr/lib/python2.7/site-packages/pecan/core.py", line 508, in handle_request
result = controller(*args, **kwargs)
File "/usr/lib64/ceph/mgr/restful/decorators.py", line 33, in decorated
return f(*args, **kwargs)
File "/usr/lib64/ceph/mgr/restful/api/osd.py", line 130, in get
return module.instance.get_osds(pool_id)
File "/usr/lib64/ceph/mgr/restful/module.py", line 543, in get_osds
pools_map = self.get_osd_pools()
File "/usr/lib64/ceph/mgr/restful/module.py", line 516, in get_osd_pools
pool_osds = common.crush_rule_osds(self.get('osd_map_tree')['nodes'], rule)
File "/usr/lib64/ceph/mgr/restful/common.py", line 149, in crush_rule_osds
osds |= _gather_osds(nodes_by_id[step['item']], rule['steps'][i + 1:])
KeyError: -8L
buckets in osd_map_crush has more infomation than nodes in osd_map_tree
so we can use buckets instead op nodes to get rule osds
Noah Watkins [Thu, 17 Jan 2019 19:16:44 +0000 (11:16 -0800)]
cli: dump osd-fsid as part of osd find <id>
Dumps the osd-fsid uuid as part of the `osd find <id>` command.
Currently this uuid is only available as part of `osd dump` but
ceph-ansible has a use case to interrogate a single osd without needing
the entire osdmap dump.
Volker Theile [Thu, 29 Nov 2018 12:48:30 +0000 (13:48 +0100)]
ceph-volume: Adapt code to support Python3
- raw_input() has been renamed to input() in Python3
- Changed signature of prompt_bool. Variables that are named like built-ins must be named like xxx_ and not _xxx
Matt Benjamin [Fri, 19 Oct 2018 19:59:29 +0000 (15:59 -0400)]
rgw: handle S3 version 2 pre-signed urls with meta-data
Add CanonicalizedAmzHeaders to the v2 signing document, as required
in https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
Also lift qs metadata into x_meta_map in RGWPutObj_ObjStore_S3::get_parms(),
so they are applied to the stored object.
Fixes: https://tracker.ceph.com/issues/23470 Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 3b0480ed136cebd3fba2322a77c7d047ef6ad5e3)
Conflicts:
src/rgw/rgw_auth_s3.cc
src/rgw/rgw_auth_s3.h
src/rgw/rgw_rest_s3.cc
- Included v4 infix in 'parse_credentials()' and removed
"session_token" param from definition, declaration and call
of 'parse_v4_credentials()'.
Mykola Golub [Thu, 13 Dec 2018 11:12:14 +0000 (13:12 +0200)]
mgr: fix crash due to multiple sessions from daemons with same name
Don't assume perf counter instances are stable. If there are
multiple sessions from daemons reporting the same name (e.g. rgws),
the instances are cleared in DaemonServer::handle_open.
If the daemons have different counter names (for counters like
"objecter-0x55b6f4f1a630.op_active") it will throw out_of_range in
DaemonPerfCounters::update when accessing the instance removed by
another session.
The regression was introduced when adding avgcount support.
ningtao [Thu, 3 Jan 2019 15:20:12 +0000 (23:20 +0800)]
mon: shutdown messenger early to avoid accessing deleted logger
In the monitor shutdown process, the MSG thread exits after the logger is released,
causing the null pointer to be accessed. So move the logger release to the MSG thread after it exits
Fixes: http://tracker.ceph.com/issues/37780 Signed-off-by: ningtao <ningtao@sangfor.com.cn>
(cherry picked from commit 47da5a0caa7edec17ff4253e363571b78372506a)
xie xingguo [Fri, 4 Jan 2019 00:39:01 +0000 (08:39 +0800)]
mon/OSDMonitor: do not populate void pg_temp into nextmap
Due to commit ea723fb, pg_temp with clean acting set are added to inc map.
The original intent was to clear out pg_temps during priming, but as
written it would set a new_pg_temp item clearing the pg_temp even if one
didn't already exist. Adding the up != acting condition in there makes us
only take that path if there is an existing pg_temp entry to remove.
Fixes: https://tracker.ceph.com/issues/37784 Signed-off-by: Aleksei Zakharov <zakharov.a.g@yandex.ru>
(cherry picked from commit b1d3ca5e78eaee509c923f06e9024c23cc6ce31a)
Alfredo Deza [Thu, 13 Dec 2018 14:49:41 +0000 (09:49 -0500)]
ceph-volume tests.functional.lvm stop all osds before activating again to test permissions
Otherwise, ``ceph-volume lvm activate --all`` will skip OSDs that are
already running. So the test that verifies that permissions are
corrected will fail because ``activate`` will simply skip them
Andrew Schoen [Wed, 12 Dec 2018 20:10:59 +0000 (14:10 -0600)]
ceph-volume: include the ceph-facts role when needed during testing
The ceph-ansible stable-3.2 branch does not have the ceph-facts role
but master does. We need to make sure to import this role only when
it's supported.
Sébastien Han [Wed, 12 Dec 2018 10:28:04 +0000 (11:28 +0100)]
spec: requires ceph base instead of common
Currently rbd-mirror and radosgw packages installation won't create the
Ceph directories in /var/lib/ceph since they depend on ceph-common
only. ceph-base is responsible for creating these directories.
Since ceph-base requires ceph-common then let's use ceph-base as a
dependency.
The patch to enforce bounds on max-keys/max-uploads/max-parts had a few
issues that would prevent us from compiling it. Instead of changing the
code provided by the submitter, we're addressing them in a separate
commit to maintain the DCO.
Signed-off-by: Joao Eduardo Luis <joao@suse.de> Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 29bc434a6a81a2e5c5b8cfc4c8d5c82ca5bf538a)
mimic specific fixes:
As the largeish change from master g_conf() isn't in mimic yet, use the g_conf
global structure, also make rgw_op use the value from req_info ceph context as
we do for all the requests
Robin H. Johnson [Fri, 21 Sep 2018 21:49:34 +0000 (14:49 -0700)]
rgw: enforce bounds on max-keys/max-uploads/max-parts
RGW S3 listing operations provided a way for authenticated users to
cause a denial of service against OMAPs holding bucket indices.
Bound the min & max values that a user could pass into the max-X
parameters, to keep the system safe. The default of 1000 is chosen to
match AWS S3 behavior.
Affected operations:
- ListBucket, via max-keys
- ListBucketVersions, via max-keys
- ListBucketMultiPartUploads, via max-uploads
- ListMultipartUploadParts, via max-parts
The Swift bucket listing codepath already enforced a limit, so is
unaffected by this issue.
Prior to this commit, the effective limit is the lower of
osd_max_omap_entries_per_request or osd_max_omap_bytes_per_request.
Backport: luminous, mimic Fixes: http://tracker.ceph.com/issues/35994 Signed-off-by: Robin H. Johnson <rjohnson@digitalocean.com>
(cherry picked from commit d79f68a1e31f4bc917eec1b6bbc8e8446377dc6b)
Conflicts:
src/common/options.cc:
Conflicts due to options from master
mon/config-key: limit caps allowed to access the store
Henceforth, we'll require explicit `allow` caps for commands, or for the
config-key service. Blanket caps are no longer allowed for the
config-key service, except for 'allow *'.
(for luminous and mimic, we're also ensuring MonCap's parser is able to
understand forward slashes '/' when parsing prefixes)