Venky Shankar [Wed, 20 Nov 2019 14:11:17 +0000 (09:11 -0500)]
mgr/volumes: tie everything together to implement versioned subvolumes
apart from the new way of provisioning subvolumes, this makes heavy
use of context manager for volumes, groups and subvolumes.
this change classifies volumes, groups and subvolumes to be treated
as filesystem dentries and inodes. a "volume" can be thought as a
dentry with "groups" as it's entries (inodes). likewise, a "group"
is a dentry again with "subvolumes" as entries (inodes). this is
built into the access mechanism as follows:
with open_volume(...) as fs_handle:
with open_gorup(fs_handle, ...) as group:
with open_subvolume(group, ...) as subvolume:
# call subvolume object API
path = subvolume.getpath()
this way, lot of redundant checks such as verifying if a volume or
group exist before accessing a subvolume is built right into the
access mechanism, plus, an added bonus of simple error handling.
Venky Shankar [Wed, 20 Nov 2019 14:02:53 +0000 (09:02 -0500)]
mgr/volumes: provide subvolume create/remove/open APIs
create_subvolume() creates a subvolume with the max version known
to the plugin. open_subvolume() performs version discovery by
using loader stub and returns a subvoule object.
Venky Shankar [Wed, 20 Nov 2019 13:45:44 +0000 (08:45 -0500)]
mgr/volumes: implement subvolume based on subvolume template
subvolume base class implements common routines/helpers and
initializes a metadata manager. later, when v2 subvolume version
is implemented, the metadata manager would be used to persist
subvolume metadata in ceph filesystem. this would allow flexible
metadata management when complex subvolume features are added.
typically, a subvolume would be implemented by subclassing the
subvolume base class and the subvolume template -- instantiating
this would be called a "subvolume object".
with this commit, current subvolume topology is maintained. but
we introduce the concept of subvolume versions. a loader stub
loads available "versions" of subvolumes. right now, the only
available version is v1. since backward compatibility needs to
be maintained for existing subvolumes, the loader API allows
version discovery w/ auto upgradation to the most recent version.
unlike existing subvolume specification, this is just a
minimal set of globally available configurations. bulk
of other configurations will be moved to the respective
entity modules (subsequent commits).
Kefu Chai [Thu, 9 Jan 2020 07:35:57 +0000 (15:35 +0800)]
cmake: let vstart depend on radosgwd
in f528f173, in cmake, the target of executable "radosgw" is renamed
to "radosgwd", and the static library of "radosgw_a" was renamed to
"radosgw". this broke the tests which expected radosgw to be available
if "tests" was built.
in this change, both "vstart" and "tests" now depend on "radosgwd"
instead of "radosgw".
* refs/pull/30802/head:
cephfs-shell: Modify Quota Test
cephfs-shell: Fix permission errors on quota tests
cephfs-shell: Add tests for quota
cephfs-shell: Print max_bytes and max_files as string on get Quota
cephfs-shell: Remove extra length argument passed to setxattr()
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com> Reviewed-by: Rishabh Dave <ridave@redhat.com>
* refs/pull/32347/head:
cephfs-shell: set shell.exit_code to 1 when reading conf fails
cephfs-shell: cephfs-shell breaks when conf_get() returns None
cephfs-shell: use libcephfs for exceptions
cephfs-shell: fix incorrect use of str.strip
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
* refs/pull/32459/head:
qa/tasks: Nothing to clean up if the volume was not created
mgr/volumes: drop obsolete comment in _cmd_fs_volume_create
mgr/volumes: cleanup on fs create error
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Tatjana Dehler [Thu, 2 Jan 2020 12:22:48 +0000 (13:22 +0100)]
mgr/dashboard: fix failing user tests
Choose another future_date_1 date (9 days instead of 10) to
make sure the expiration date will be between future_date_1
and future_date_2. Otherwise the expiration date might be
equal to future_date_1.
Also wait for 10 seconds before the password refresh in
test_pwd_expiration_date_update to prevent date equality.
Fixes: https://tracker.ceph.com/issues/43431 Signed-off-by: Tatjana Dehler <tdehler@suse.com>
Ronen Friedman [Mon, 6 Jan 2020 07:46:49 +0000 (09:46 +0200)]
crimson: fix lambda captures of non-variables
One cannot just capture a structured binding "non-variable".
(From the C++ standard, $8.4.5.2:
"If a lambda-expression [...] captures a structured binding (explicitly or implicitly),
the program is ill-formed.")
Kefu Chai [Tue, 7 Jan 2020 07:36:52 +0000 (15:36 +0800)]
mon: should not take non-tell commands as tell ones
this change addresses a regression introduced by a2c34794dc. in which, a
new flag, 'FLAG_TELL' was added. and it's used to check if a command is
"TELL" command. if it is, it's added to the tell/asok command registry
and monitor will handle the commands in this registry using asok hooks.
but there are some commands whose flag is "HIDDEN". and after a2c34794dc, is_tell() takes HIDDEN commands as TELL command. that's why
`ceph_test_admin_socket_output --all` fails. because, "mds freeze" is
now wrongly considered as a TELL command. but monitor is not able to
handle is using the asok hooks.
after this change, is_tell() will not mistake "mds freeze" as a TELL
command anymore.
* refs/pull/31494/head:
qa: force creation of fs with EC default data pool
qa: add tests for adding EC data pools
mon/MDSMonitor: warn when creating fs with default EC data pool
Reviewed-by: Greg Farnum <gfarnum@redhat.com> Reviewed-by: Sage Weil <sage@redhat.com>
Ilya Dryomov [Thu, 19 Dec 2019 18:02:18 +0000 (19:02 +0100)]
qa: krbd_exclusive_option.sh: fixup for json.tool ordering change
In Python 3.5 json.tool was changed to produce unsorted output and
--sort-keys option was added to compensate. This wasn't caught by 4fe245cc2f2d ("qa: update krbd tests for python3") because it raced
with 50933b863a1d ("qa: krbd_exclusive_option.sh: update for recent
kernel changes").
Ilya Dryomov [Wed, 18 Dec 2019 13:32:11 +0000 (14:32 +0100)]
test/librbd/fsx: don't disable features for krbd
rbd_default_features is set in krbd suite, no need to hard-code this in
fsx (especially now when object-map, fast-diff and deep-flatten are all
supported).
Ronen Friedman [Sun, 5 Jan 2020 06:23:58 +0000 (08:23 +0200)]
crimson: fix non-standard C++ constructs in errorator.h
Fixing use patterns accepted by gcc, but frowned upon by Clang:
Put noexcept specifier after attributes specifiers (as
per the C++ standard $11.3.5)
Limit the use of a not-completely-defined class names to
within function bodies, per the standard ("A class is considered
a completely-defined object type (or complete type) at the
closing } of the class-specifier.
Within the class member-specification, the class is regarded as
complete within function bodies, default arguments, noexcept-specifiers,
and default member initializers (including such things in nested classes).
Otherwise it is regarded as incomplete within its own class member-specification.")
Kefu Chai [Sun, 5 Jan 2020 14:17:42 +0000 (22:17 +0800)]
crimson: do not use auto in param list of function prototype
src/crimson/net/Socket.cc:114:57: error: 'auto' not allowed in function
prototype
static inline seastar::future<> close_and_handle_errors(auto& out) {
^~~~
Kefu Chai [Sun, 5 Jan 2020 14:15:24 +0000 (22:15 +0800)]
crimson: do not capture unused variables
to silence warnings like
src/crimson/net/Socket.cc:93:41: warning: lambda capture 'this' is not
used [-Wunused-lambda-capture]
return in.read_exactly(bytes).then([this](auto buf) {
^~~~
Bernd Zeimetz [Sun, 5 Jan 2020 13:30:54 +0000 (14:30 +0100)]
os/bluestore/Blue(FS|Store): uint64_t alloc_size
Compiling on Debian's 32bit architectures failed with
<<PKGBUILDDIR>>/src/os/bluestore/BlueStore.cc:5539:37: error: no matching function for call to ‘p2align(size_t&, uint64_t&)’
5539 | total += p2align(len, alloc_size);
| ^
In file included from /<<PKGBUILDDIR>>/src/include/denc.h:42,
from /<<PKGBUILDDIR>>/src/include/encoding.h:40,
from /<<PKGBUILDDIR>>/src/include/compact_map.h:16,
from /<<PKGBUILDDIR>>/src/include/mempool.h:32,
from /<<PKGBUILDDIR>>/src/os/bluestore/BlueStore.h:36,
from /<<PKGBUILDDIR>>/src/os/bluestore/BlueStore.cc:25:
/<<PKGBUILDDIR>>/src/include/intarith.h:57:20: note: candidate: ‘template<class T> constexpr T p2align(T, T)’
57 | constexpr inline T p2align(T x, T align) {
| ^~~~~~~
/<<PKGBUILDDIR>>/src/include/intarith.h:57:20: note: template argument deduction/substitution failed:
/<<PKGBUILDDIR>>/src/os/bluestore/BlueStore.cc:5539:37: note: deduced conflicting types for parameter ‘T’ (‘unsigned int’ and ‘long long unsigned int’)
5539 | total += p2align(len, alloc_size);
As far as I understand it the available_freespace should at least be
able to return the same number as alloc_size, so we should use uint64_t
instead of size_t here, similar to 10a953afc8f803e50c96354470fb114b33e62599