Commit Graph

92700 Commits

Author SHA1 Message Date
xie xingguo
4181aa8690 mon: auto clean up stale upmap items
See https://www.spinics.net/lists/ceph-users/msg49518.html

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
2018-11-28 16:14:40 +08:00
Kefu Chai
57160722b4
Merge pull request #25280 from tchaikov/wip-ceph-py3
ceph.in: write bytes to stdout in raw_write()

Reviewed-by: Alfredo Deza <adeza@redhat.com>
2018-11-28 13:14:19 +08:00
Kefu Chai
3fb560a422
Merge pull request #25261 from sebastian-philipp/mgr-handle-command-result
mgr: Add `HandleCommandResult` namedtuple
2018-11-28 13:12:05 +08:00
Kefu Chai
73e92ab7fa
Merge pull request #25255 from tchaikov/wip-ceph-dencoder-without-cephfs
tools/ceph-dencoder: conditionally link against mds
2018-11-28 13:10:05 +08:00
Kefu Chai
1c97ce4aad
Merge pull request #25244 from trociny/wip-crash-procname
mgr/crash: add process name to crash metadata

Reviewed-by: Kefu Chai <kchai@redhat.com>
2018-11-28 13:08:53 +08:00
Kefu Chai
56142dfb23
Merge pull request #24990 from dragonylffly/wip-fix-bench
tools/rados: always call rados.shutdown() before exit()

Reviewed-by: Kefu Chai <kchai@redhat.com>
2018-11-28 13:07:59 +08:00
Kefu Chai
2a6d98127d
Merge pull request #24939 from marcosps/simplify_examples
examples/librados: Remove not needed else clauses

Reviewed-by: Kefu Chai <kchai@redhat.com>
2018-11-28 13:04:07 +08:00
Sage Weil
cdcc5b4521 Merge PR #24502 into master
* refs/pull/24502/head:
	crushtool: implement --rebuild-class-roots command
	crushtool: make --reweight re-sum choose_args weight-sets too
	crushtool: --reweight should only reweight nonshadow roots
	crush/CrushWrapper: reclassify: use default parent for created buckets
	crush/CrushWrapper: reclassify: handle to-be-created buckets that we need twice
	test/cli/crushtool/reclassify: add second gabe test case
	crushtool: add --set-subtree-class; do not set class via --reclassify-root
	test/cli/crushtool/reclassify: add reclassify test cases
	doc/rados/operations/crush*: document reclassify
	doc/rados/operations/crush: remove instructions for separate crush trees for ssd
	crushtool: add --compare command
	crushtool: implement --reclassify
	crush/CrushCompiler: fix id scan to include class ids

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2018-11-27 21:32:04 -06:00
Sage Weil
6fe1ea0dd5 crushtool: implement --rebuild-class-roots command
This simply rebuilds the class roots.  Normally this should create no
change in the map since whatever was making changes to the map before
should have rebuild the shadow roots at that point.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-11-27 20:36:43 -06:00
Sage Weil
0f6a36e1e4 crushtool: make --reweight re-sum choose_args weight-sets too
This ensures that the weights add us for each weight-set (and each
position).  Note that since we don't have anything that actually
creates positional weight-sets, the behavior here might not be what we
want in the end, but for the compat weight-sets (no position), we *do*
keep the weights as a properly summing tree.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-11-27 20:36:43 -06:00
Sage Weil
c9921dc7e9 crushtool: --reweight should only reweight nonshadow roots
The shadow roots will be then be rebuilt accordingly.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-11-27 20:36:43 -06:00
Sage Weil
dec38c69cb crush/CrushWrapper: reclassify: use default parent for created buckets
Note that these last 2 fixes also fix the 'h' test case.  \o/

Signed-off-by: Sage Weil <sage@redhat.com>
2018-11-27 20:36:43 -06:00
Sage Weil
c2211e851d crush/CrushWrapper: reclassify: handle to-be-created buckets that we need twice
Signed-off-by: Sage Weil <sage@redhat.com>
2018-11-27 20:36:43 -06:00
Sage Weil
1028bf832a test/cli/crushtool/reclassify: add second gabe test case
New adjusted test map from Dan.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-11-27 20:36:43 -06:00
Sage Weil
7a80f993f4 crushtool: add --set-subtree-class; do not set class via --reclassify-root
Sometimes we don't want the --reclassify-root to set the class of every
device because a small number of them are (correctly) a different class.
Allow both behaviors by adding a new, separate command to set the class
of all devices beneath a point in the hierarchy and do not implicitly do
that relabeling as part of --reclassify-root.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-11-27 20:36:43 -06:00
Sage Weil
cb327b8f42 test/cli/crushtool/reclassify: add reclassify test cases
Signed-off-by: Sage Weil <sage@redhat.com>
2018-11-27 20:36:43 -06:00
Sage Weil
505050befd doc/rados/operations/crush*: document reclassify
Signed-off-by: Sage Weil <sage@redhat.com>
2018-11-27 20:36:43 -06:00
Zack Cerza
50b7d42fe5 mgr/dashboard: Replace dashboard service
This splits out the collection of health and log data from the
/api/dashboard/health controller into /api/health/{full,minimal} and
/api/logs/all.

/health/full contains all the data (minus logs) that /dashboard/health
did, whereas /health/minimal contains only what is needed for the health
component to function. /logs/all contains exactly what the logs portion
of /dashboard/health did.

By using /health/minimal, on a vstart cluster we pull ~1.4KB of data
every 5s, where we used to pull ~6KB; those numbers would get larger
with larger clusters. Once we split out log data, that will drop to
~0.4KB.

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

Signed-off-by: Zack Cerza <zack@redhat.com>
2018-11-27 16:08:53 -07:00
Patrick Donnelly
54640f7cd8
Merge PR #24923 into master
* refs/pull/24923/head:
	mds: properly update freeze_tree_state when fragmenting dirfrags

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2018-11-27 14:47:03 -08:00
Noah Watkins
9b125b087a mgr/dashboard: use dedicated tox working dir
Avoids conflicting with other test environments.

Fixes: https://tracker.ceph.com/issues/37405

Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-11-27 14:28:47 -08:00
Patrick Donnelly
3358e3a2d6
Merge PR #24849 into master
* refs/pull/24849/head:
	client: remove redundant abort logic during dentry invalidation test

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Zheng Yan <zyan@redhat.com>
2018-11-27 14:23:20 -08:00
Patrick Donnelly
b76f14569d
Merge PR #24886 into master
* refs/pull/24886/head:
	qa: fix delay type config name

Reviewed-by: Zheng Yan <zyan@redhat.com>
2018-11-27 13:58:26 -08:00
Patrick Donnelly
302e4f4af2
Merge PR #24839 into master
* refs/pull/24839/head:
	ceph-volume-client: allow setting mode of CephFS volumes

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2018-11-27 13:53:50 -08:00
Zack Cerza
a90b5ac7c7 Allow specifying a schema for unknown JObj keys
Signed-off-by: Zack Cerza <zack@redhat.com>
2018-11-27 12:47:26 -07:00
Sage Weil
9e23ac6532 vstart.sh: create default fs via 'fs volume create'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-11-27 13:14:07 -06:00
Sage Weil
e5c15e5952 mgr/volumes: fix oremote
Signed-off-by: Sage Weil <sage@redhat.com>
2018-11-27 13:00:45 -06:00
Sage Weil
84eac7a146 mon/MgrMonitor: enable volumes module by default
Signed-off-by: Sage Weil <sage@redhat.com>
2018-11-27 13:00:45 -06:00
John Spray
db29db5d06 mgr: create volumes module
This encapsulates and extends ceph_volume_client, providing
similar functionality as a service from ceph-mgr.

We used to call CephFS namespaces "filesystems", and the
ceph_volume_client-created directories "volumes".  That
terminology changes in this module: namespaces are now "volumes",
and the directory-based entity is a "subvolume".

External systems can use librados to access the command
interface provided by this module, instead of using
ceph_volume_client directly.

Signed-off-by: John Spray <john.spray@redhat.com>
2018-11-27 13:00:45 -06:00
Patrick Donnelly
c7607f6371
Merge PR #25020 into master
* refs/pull/25020/head:
	script/ceph-backport.sh: adjust to change in github API

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2018-11-27 10:36:03 -08:00
Casey Bodley
9a35b610bc rgw: RADOS::Obj::operate takes optional_yield
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-11-27 12:30:25 -05:00
Casey Bodley
a25e48c0cf rgw: add is_asio_thread to warn on blocking librados calls
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-11-27 12:30:25 -05:00
Casey Bodley
9ecd2a4a41 rgw: link boost context/coroutines regardless of beast frontend
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-11-27 12:30:25 -05:00
Casey Bodley
42921b98d1 rgw: add rgw_rados_operate() to wrap optionally-async operate
calls IoCtx::operate() when given an empty optional_yield, or
librados::async_operate() when non-empty. calling async_operate()
with a yield_context behaves just like a synchronous call to
IoCtx::operate(), except that the stackful coroutine is suspended and
resumed on completion instead of blocking the calling thread

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-11-27 12:30:25 -05:00
Casey Bodley
20220e7087 common: add optional_yield wrapper
adds a wrapper type that may or may not contain a yield_context
that represents a boost::asio stackful coroutine, along with a
'null_yield' token to designate an empty one

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-11-27 12:30:25 -05:00
Lenz Grimmer
55e2ee34f0
Merge pull request #25235 from sebastian-philipp/dashboard-fix-type-annotation-error
qa/mgr/dashboard: Fix type annotation error.

Reviewed-by: Tatjana Dehler <tdehler@suse.com>
2018-11-27 18:19:27 +01:00
Sebastian Wagner
4eadada5c6 mgr: Add HandleCommandResult namedtuple
Mostly a documentation improvement to make it obvious
what `handle_command` is supposed to return .

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2018-11-27 17:36:04 +01:00
Kefu Chai
a3fa7d0d1e denc: consolidate denc_traits for basic_string
we can reuse decode_nohead() in decode()

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-11-28 00:33:53 +08:00
Kefu Chai
8a0bf61c5a denc: only shallow_copy large-enough chunk for decoding
if the bl being decoded is not continous, shallow_copy() will do deep
copy under the hood. this introduces internal fragmentation when
decoding small objects in large non-contiguous bufferlist.

to alleviate this problem, we try to copy less if the object being
decoded is bounded.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-11-28 00:33:53 +08:00
Kefu Chai
8b2b83867e denc: add non-contiguous decode_nohead() for bl,string
bufferlist's denc traits claims to be need_contiguous=false, so
it should implement all all functions to work with
buffer::list::const_iterator. we already have decode(), the missing
puzzle is decode_nohead().

in this change, decode_nohead(size_t len, bufferlist& v,
                              buffer::list::const_iterator& p) is implemented.

same applies to basic_string.

ideally, we should allow decode buffer::list::iterator as well. but
let's leave it for another change in future when it's needed.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-11-28 00:33:51 +08:00
Kefu Chai
1c5834be57 buffer: fix the traits of list::iterator
before this change, the constness of value, pointer, etc traits of
list::iterator was wrong.  also, because std::iterator is deprecated
in C++17, we need to define the traits manually. so, do this change.

these traits could be potentially used anywhere in the source tree.
but a noteworthy user is is_const_iterator<> in denc.h.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-11-28 00:26:02 +08:00
Kefu Chai
719758a0d4 denc: do not always copy before decoding
before this change, if the caller calls into ::decode_nohead(),
we will try to copy the memory chunk to be decoded before decoding it,
but if the buffer in the buffer list is not the last one, we will *deep*
copy the remaining part in the buffer list into a new contiguous memory
chunk and decode it instead. if we are decoding a map<int, buffer::ptr>
with lots of items in it, and the buffer::ptrs in it  are very small,
we will end up suffering from a serious internal fragmentation.

we could use the same strategy of decode(), where we compare the
size of remaining part with CEPH_PAGE_SIZE, and only copy it if
it's small enough. this requires that the decoded type supports
both variant of decoding contiguous and non-contiguous.
quite a few MDS types do not support both of them. for instance,
snapid_t only supports contiguous decoding.

so, instead of conditioning on size, in this change, we condition
on the traits::need_contiguous. probably we can condition on both
of them in a follow-up change.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-11-28 00:26:02 +08:00
Kefu Chai
c4544d1514 denc: enable decode basic_string<>
we have

buffer::list::iterator_impl<is_const>::copy(unsigned len,
std::string &dest)

but we don't have the templatized version of it. so, if we
plugin a different allocator to basic_string<>, the new string won't
decode with buffer::list::const_iterator. this decode variant is used if
the caller only has a (probably non-contiguous) buffer::list in hand.

in this change, copy(unsigned, char*) is used as an alternative.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-11-28 00:26:00 +08:00
Kefu Chai
9c0141caae
Merge pull request #25268 from smithfarm/wip-37392
qa/workunits/rados/test_librados_build.sh: grab files from explicit git branch

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2018-11-27 23:22:51 +08:00
Kefu Chai
ffd8795805
Merge pull request #25129 from rzarzynski/wip-common-annotate
common: avoid the overhead of ANNOTATE_HAPPENS_* in NDEBUG builds.

Reviewed-by: Kefu Chai <kchai@redhat.com>
2018-11-27 23:18:48 +08:00
Abhishek Lekshmanan
fb9c049762 rgw: batch and process bucket instances
Sort through and batch bucket instances so that multiple calls to reading
current bucket info and locking can be avoided. For the most trivial case when
the bucket is already deleted we exit early with all the stale instances. When
the bucket reshard is in progress we only process the stale entries with status
done, if the bucket is available for locking then we lock down and mark the
other instances as well.

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
2018-11-27 16:15:51 +01:00
Abhishek Lekshmanan
bf8f885016 cli: use rgw-admin reshard stale-instances list/delete
Add a delete command as well that clears the resharded instances. We print out
the json status to indicate success or error state

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
2018-11-27 16:15:51 +01:00
Alfredo Deza
b284bcc626
Merge pull request #25224 from sebastian-philipp/ceph-volume-fix-json
ceph-volume: fix JSON output in `inventory`

Reviewed-by: Alfredo Deza <adeza@redhat.com>
2018-11-27 10:05:31 -05:00
Casey Bodley
d8968a45e5 librados_cxx: document which nobjects interfaces throw
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-11-27 09:47:25 -05:00
Casey Bodley
50f7ae52f1 PendingReleaseNotes: changed librados::NObjectIterator exceptions
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-11-27 09:45:19 -05:00
Kefu Chai
44a4422d2e
Merge pull request #25256 from tchaikov/wip-kv-bench-cleanup
ceph_kvstorebench: include <errno.h> not asm-generic/errno.h

Reviewed-by: Willem Jan Withagen <wjw@digiware.nl>
2018-11-27 22:32:53 +08:00