Patrick Donnelly [Fri, 31 Jul 2020 21:11:27 +0000 (14:11 -0700)]
Merge PR #35647 into master
* refs/pull/35647/head:
mgr/volumes: Add documentation regarding --retain-snapshots option
mgr/volumes: Avoid trashing retained subvolume on create errors
mgr/volumes: Add subvolume v2 test cases
mgr/volumes: Derive v2 from v1 to leverage common methods
mgr/volumes: Introduce v2 subvolumes
mgr/volumes: Use operation type during subvolume open
Reviewed-by: Ramana Raja <rraja@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Patrick Donnelly <pdonnell@redhat.com> Reviewed-by: Kotresh Hiremath Ravishankar <khiremat@redhat.com>
Patrick Donnelly [Fri, 31 Jul 2020 21:08:41 +0000 (14:08 -0700)]
Merge PR #32120 into master
* refs/pull/32120/head:
client: periodically forward metrics to session MDSs
client: track cap hits and misses globally
client: minor cleanup to MetaSession class
Reviewed-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
* extract get_ragweed_branch() out of download() task, for better
readablity.
* use a loop for retry when the first clone fails
* drop the `raise ValueError()` clause as it never happens. we could use
an assert() here, but i don't think it is necessary anyway.
* use sh() instead of run() for better readablity.
* always set ragweed_repo. before this change this variable is
unbounded if `force-branch` is set.
MOSDScrub2 is sent from mgr for serving "ceph pg
{scrub|deep-scrub|repair}' commands when it's talking to a mimic and newer OSD.
ceph task checks if all pgs are scrubbed by looking at the `last_scrub_stamp` fields
in the `ceph pg dump` output. and it request the not-yet-scrubbed pgs a
deep scrub to ensure they are scrub before timeout.
in this change, crimson handles MOSDScrub2 by starting a remote peering
request, and the underlying peering_state will notify the corresponding
PG to start scrub. to get the test pass, a minimal implmentation is
added to update the scrub timestamp to `now` upon request of
peering_state.
we will need to add the correct scrubbing support later. but this is
enough for passing the thrasher test and for preparing for more tests
which uses the "ceph" task.
FreeBSD/Clang/lib complains:
/home/jenkins/workspace/ceph-master/src/test/librados_test_stub/TestRadosClient.cc:295:55: error: reference to '_1' is ambiguous
&TestRadosClient::finish_aio_completion, this, c, _1));
^
/usr/local/include/boost/bind/placeholders.hpp:46:38: note: candidate found by name lookup is 'boost::placeholders::_1'
BOOST_STATIC_CONSTEXPR boost::arg<1> _1;
^
/usr/include/c++/v1/functional:2448:46: note: candidate found by name lookup is 'std::__1::placeholders::_1'
/* _LIBCPP_INLINE_VAR */ constexpr __ph<1> _1{};
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
monclient: use "is_connected" check when scheduling tick
When schedule_tick is called for the first time (in init) we are
still not in hunting mode so mon_client_ping_interval and
mon_client_log_interval were used to schedule the tick.
Matthew Oliver [Thu, 30 Jul 2020 03:18:48 +0000 (13:18 +1000)]
cephadm: add unwrap_ipv6 helper method
When we pass in a mon-ip that is ipv6 we want it wrapped, this is so it
can be properly inserted into the mon_addrv address.
But there are times we need to unwrap it to test it's a valid ipv6
address.
This patch adds a helper method `unwrap_ipv6` which takes a string and
returns it either unwrapped or as it is, so it's harmless to other types
of ips.
This allows us to check a wrapped ipv6 base_ip with the networks on the
host.
Patrick Donnelly [Tue, 14 Jul 2020 02:50:00 +0000 (19:50 -0700)]
script/ptl-tool: page through github response
This fixes the script to go through the response pages from GitHub.
Previously it would only look at the first page and potentially miss
some reviews/comments.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
mgr/volumes: Avoid trashing retained subvolume on create errors
On any create or create_clone errors the entire subvolume was being
removed. This should be conditional and remove only the incarnation
if the subvolume was in the retained state.
Following support is added,
- Ability to retain snapshots on subvolume deletion
- Modify directory where snapshot is created to the subvolume
- "features" supported to subvolume info output, specifically ability
for a subvolume to retain snashots
- Current state of subvolume in info output
- Auto upgrade to v2 from eligible v1 subvolumes
- Adjust other functions as needed to support the changes
mgr/volumes: Use operation type during subvolume open
Subvolume open currently takes in 2 optional parameters to
denote desired state and type. This enables the open to
allow the operation to suceed based on the (type, state)
tuple.
Instead, pass an operation type to be performed on a subvolume
during open, and decide internal to a subvolume version if the
operation is allowed based on its state and type.
Also modifies the state machine code, to be more amenable to
modifications and improves redability.
Patrick Donnelly [Wed, 29 Jul 2020 18:05:02 +0000 (11:05 -0700)]
Merge PR #24068 into master
* refs/pull/24068/head:
mds: rename {CDir,Migrator}::cache to mdcache
mds: make MDSCacheObject::is_ambiguous_auth() virtual
mds: make sure rename old inode's parent dirfrag is projected.
mds: track projected inode/fnode in Mutation
mds: use smart pointer to manager CDir::fnode
mds: use smart pointer to manage CInode::{inode,xattrs,old_inodes}
osdc/Filer: make layout pointer const
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Stephan Müller [Wed, 22 Jul 2020 14:00:32 +0000 (16:00 +0200)]
mgr/dashboard: Fix regression on table error handling
The regression was introduced by #35290 through the use of the new tab module
the pools and host listing got wrapped into the new usage, however they needed
to use the table as Viewchild and the table was static before, but it's now
dynamic. This resulted in an empty variable that wasn't filled with the
right table object. The calling of the ".reset()" was not possible
during an error case and produced an error in console trying to access
"reset" of undefined, by not calling "reset" the table get's stuck with an
rotating reload symbol.
Fixes: https://tracker.ceph.com/issues/46660 Signed-off-by: Stephan Müller <smueller@suse.com>
Yan, Zheng [Thu, 7 May 2020 02:33:12 +0000 (10:33 +0800)]
mds: make sure rename old inode's parent dirfrag is projected.
if rename dest dentry is remote dentry, Server::_rename_prepare() only
pre dirty old inode, but does not project fnode for old inode's parent
dirfrag. This will trigger a assertion (introduced by previous commit)
in CDir::mark_dirty().
Or Ozeri [Tue, 28 Jul 2020 09:08:30 +0000 (12:08 +0300)]
test/librados_test_stub: handle exclusive create
The exclusive boolean of the create method was unused so far.
This commit adds the proper handling by checking if an object already exists, and returning EEXISTS appropriately.
Jason Dillaman [Wed, 29 Jul 2020 11:30:28 +0000 (07:30 -0400)]
librbd: potentially delay completion of image dispatcher spec
If an AioCompletion is being completed for an external API user, ensure
that the completion of image dispatcher finalizer does not race with the
potential to close the image.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
client: expose ceph.quota.max_bytes xattr within snapshots
For directories within snapshots, expose the ceph.quota.max_bytes
extended attribute information. This enables fetching quota
information when the snapshot was taken and is particularly useful
when cloning subvolume snapshots, to enforce the quota on the
clone subvolume as well.
Ceph status still reports slow requests on the OSD which is already out.
When orignal PG monitor handled PGSTATS msg, it wouldn't update osd stat
if this OSD is not in OSD map, but current MGR had no checks on that.
we should not remove an element while iterating it in a map, as erasing
the element invalidates the iterator, which causes segmfault when we are
advancing it after erasing the dereferenced element.
in this change, an iterator is used for walking through the map, in
comparision with creating a to-be-removed list, this one is more
efficient and more idiomatic.