Commit Graph

70745 Commits

Author SHA1 Message Date
Patrick Donnelly
383d521af3
mds: handle export pin on unjournaled directory
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-05-05 19:10:27 -04:00
Patrick Donnelly
9552efde4a
qa: improve time handling for test_exports test
Also catches corner-case found by Zheng where an unjournaled directory will
cause export pinning to fail because it cannot be made a subtree until its
parent is stable.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-05-05 19:07:05 -04:00
Patrick Donnelly
3880c6d1e6
mds: do not try to export pin special directories
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-05-04 17:22:10 -04:00
Patrick Donnelly
41a44ae964
mds: remove unnecessary check for parent pins
With Zheng's help, now that the code has captured all the paths where an inode
should be checked for export pins, we don't need to look at parents anymore.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-05-04 12:59:43 -04:00
Patrick Donnelly
4cd4782da8
mds: check export_pin on dirfrag load
Zheng's suggestion: "[maybe_export_pin is called by MDCache::add_inode() and
Migrator. For the first case, inode has no dirfrag (I think it's better to call
this function in CInode::get_or_open_dirfrag)"

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-05-03 22:37:19 -04:00
Patrick Donnelly
63cbe330b7
qa: remove errant mount requirement
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-05-02 18:29:08 -04:00
Patrick Donnelly
9755119ef8
mds: cleanup aux subtree pin debug
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-05-02 16:28:32 -04:00
Patrick Donnelly
f1508caa65
mds: use clearer name for export pin cont
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-05-02 16:11:59 -04:00
Patrick Donnelly
9ac8e2a427
mds: handle imported directory that is pinned
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-05-02 00:31:22 -04:00
Patrick Donnelly
6bd58fefb7
mds: use aux subtrees for export pinned inodes
Idea here is that a pinned inode should not be exported when its parent is.
Setting the pinned inode's dirfrags to aux subtrees prevents them from being
merged with a parent subtree.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-05-02 00:30:35 -04:00
Patrick Donnelly
7a76ea50b5
Revert "mds: prevent export of pinned inodes"
This reverts commit df340e820d.

Going to use Zheng's aux subtrees instead.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-28 13:45:17 -04:00
Yan, Zheng
649b38edb3
mds: simplify auxiliary subtrees when sending subtree resolve
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
2017-04-28 10:00:00 -04:00
Yan, Zheng
0d6d3205ef
mds: create auxiliary subtree inside auth subtree
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
2017-04-28 09:59:51 -04:00
Patrick Donnelly
91952aaf58
mds: break ancestor walk if node is export_pinned
i.e. don't keep walking the parents after adding the ancestor (or the node
itself) to the export_pin_queue.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-25 11:14:21 -04:00
Patrick Donnelly
aebc1caee8
mds: use projected parent to avoid unsafe access
Add-on to: 26a08f31f7

Credit to Zheng for noticing.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-24 10:05:37 -04:00
Patrick Donnelly
df340e820d
mds: prevent export of pinned inodes
This adds a chain of linked lists to CInode which can be followed to CInodes
that are export pinned to this rank.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-19 18:21:40 -04:00
Patrick Donnelly
0b420be7e9
mds: add export_pin feature
This allows the client/admin to pin a directory tree to a particular rank,
preventing its export by the dynamic balancer.

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

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-19 18:21:19 -04:00
Patrick Donnelly
082e86c58f
mds: unify export_targets handling for all exports
This commit moves the MDSMap export_targets updates/handling to MDSRank.  It is
necessary to wait for export_targets to be updated prior to doing any exports
as clients must have sessions open with targets of exports before any export
can be performed. Before this commit, this handling was only done for
migrations initiated by the balancer and not for manual migrations done by the
admin socket.

This fix and refactoring does the following:

o MDSRank now manages export_targets via a map of ranks with DecayCounters.
  MDSRank::hit_export_target enables the Migrator/MDBalancer to hit a rank to
  indicate migration is either desired or in progress. Importantly, updating
  export_targets is now no longer tied to the previous MDBalancer cycle.

o mds_bal_target_removal_min and mds_bal_target_removal_max are removed in
  favor of a DecayRate, via mds_bal_target_decay, which is independent of the
  tick rate.

o Certain balancing state has been pulled out of the MDBalancer into a stack
  variable type (balance_state_t). This is to avoid unnecessary persistence
  of my_targets, imported, and exported maps which made the code confusing.

o try_rebalance is no longer called on MDSMap updates. This was done before
  export target checking was part of the balancer, in 3e36d3202.

o The Migrator now hits a rank in export_targets via MDSRank::hit_export_target
  proportional to how much is being exported and periodically during the
  course of the export. In my testing, one "default" hit (-1) will at least
  keep the target in the export map for about 2 minutes.

o The Migrator will wait until a target is in the export_targets before
  it actually does the export, or abort the export if the target is not
  added in a timely manner.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-18 16:50:00 -04:00
Patrick Donnelly
89e990b608
common: assoc. DecayRate with DecayCounter
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-17 22:58:22 -04:00
Patrick Donnelly
3cfd46f0af
mds: dispatch export request
Funnel dispatch through MDCache::dispatch_request so we have only one call site
for Migrator::dispatch_export_dir.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-17 22:57:50 -04:00
Patrick Donnelly
26a08f31f7
mds: check projected parent to avoid unsafe access
An anonymous inode may not have a stable parent so immediate migration would
cause a segfault when checking for strays.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-17 22:57:46 -04:00
Patrick Donnelly
b2f53b85c3
common/DecayCounter: add delta to value for ::get
This resolves a bug where getting the DecayCounter value before one second has
elapsed will result in 0 always being returned. This is because ::hit will add
to the delta, not the value. The delta is added to the value only in the decay
function which only processes changes after 1 second has elapsed since the last
decay.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-17 22:57:34 -04:00
Patrick Donnelly
5f49379afb
common/DecayCounter: remove redundant qualifiers
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-17 22:56:55 -04:00
Patrick Donnelly
efb11c6c92
mds: use uint64_t for sum of exported inodes
An int is too likely to overflow.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-17 22:56:51 -04:00
Patrick Donnelly
615f342069
mds: organize headers
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-17 22:56:46 -04:00
Patrick Donnelly
4bc458cf20
messages: add missing header to MMDSLoadTargets
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-17 22:56:41 -04:00
Patrick Donnelly
9285b029a8
mds: add comment for subtrees MDCache member
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-12 23:17:49 -04:00
Patrick Donnelly
2d2b387372
mds: simplify loops to range-for
No functional change.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-12 23:17:31 -04:00
Patrick Donnelly
36f3bc067f
mds: organize Migrator headers
This follows the coding style guidelines:

https://google.github.io/styleguide/cppguide.html#Declaration_Order

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-11 16:01:36 -04:00
Patrick Donnelly
a10cd1fa45
mds: remove unimplemented function
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-11 16:01:36 -04:00
Patrick Donnelly
c3e0aba808
mds: order MDBalancer header
This follows the coding style guidelines:

https://google.github.io/styleguide/cppguide.html#Declaration_Order

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2017-04-11 16:01:36 -04:00
Josh Durgin
000629f743 Merge pull request #14461 from dmick/master
stop.sh: boilerplate error (don't stop mon when stopping mgr)

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2017-04-11 12:35:48 -07:00
Dan Mick
54e6680c8b stop.sh: boilerplate error (don't stop mon when stopping mgr)
Signed-off-by: Dan Mick <dan.mick@redhat.com>
2017-04-11 10:42:56 -07:00
Orit Wasserman
8c25738f4b Merge pull request #14376 from cbodley/wip-rgw-forward-canned-acl
rgw: fix for EINVAL errors on forwarded bucket put_acl requests
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2017-04-11 20:30:33 +03:00
Jason Dillaman
d084f68b1c Merge pull request #13105 from rjfd/wip-18481
librbd: deferred image deletion

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2017-04-11 11:24:21 -04:00
Casey Bodley
179cb5262c Merge pull request #14355 from cbodley/wip-19505
rgw: allow larger payload for period commit

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2017-04-11 11:13:04 -04:00
Casey Bodley
2dc5789019 Merge pull request #14319 from cbodley/wip-19488
rgw: multisite: fixes for zonegroup redirect

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2017-04-11 11:12:44 -04:00
Casey Bodley
cde6359659 Merge pull request #14343 from Liuchang0812/wip-rgw-read-user-buckets
rgw: update is_truncated in function rgw_read_user_buckets

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2017-04-11 11:11:41 -04:00
Kefu Chai
5a00a450b7 Merge pull request #14438 from theanalyst/fix/build-doc
script: build-doc/serve-doc fixes

Reviewed-by: Loic Dachary <ldachary@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-04-11 22:10:37 +08:00
Sage Weil
b8dc3783c7 Merge pull request #14455 from optimistyzy/411_1
os/bluestore/NVMEDevice: fix the compilation issue for collect_metadata

Reviewed-by: Haomai Wang <haomai@xsky.com>
2017-04-11 08:47:40 -05:00
John Spray
93f1b90403 Merge pull request #13698 from ukernel/wip-multimds-misc
mds: miscellaneous multimds fixes

Reviewed-by: John Spray <john.spray@redhat.com>
2017-04-11 14:06:19 +01:00
Jason Dillaman
ca1a132d5a Merge pull request #14453 from trociny/wip-test_mock_InstanceWatcher
test/rbd_mirror: race in TestMockInstanceWatcher on destroy

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2017-04-11 08:10:20 -04:00
Ricardo Dias
6b54288793
pybind: librbd: added trash API to python RBD binding
Signed-off-by: Ricardo Dias <rdias@suse.com>
2017-04-11 12:09:41 +01:00
Ricardo Dias
b844f58481
qa/workunits/rbd: cli testing of rbd trash commands
Signed-off-by: Ricardo Dias <rdias@suse.com>
2017-04-11 12:09:41 +01:00
Ricardo Dias
3138bdfba3
rbd: added image-id optional to Info command
Signed-off-by: Ricardo Dias <rdias@suse.com>
2017-04-11 12:09:41 +01:00
Ricardo Dias
cad8952bed
rbd: Added image-id optional to Snap commands
Signed-off-by: Ricardo Dias <rdias@suse.com>
2017-04-11 12:09:41 +01:00
Ricardo Dias
dba8eb7e3c
rbd: added image_id param to Utils::init_and_open_image
Signed-off-by: Ricardo Dias <rdias@suse.com>
2017-04-11 12:09:41 +01:00
Ricardo Dias
46de06ebb2
rbd: added group image remove by id to CLI
Signed-off-by: Ricardo Dias <rdias@suse.com>
2017-04-11 12:09:41 +01:00
Ricardo Dias
9438ee9353
librbd: added group image remove by id to API
Signed-off-by: Ricardo Dias <rdias@suse.com>
2017-04-11 12:09:41 +01:00
Ricardo Dias
0a25ea0036
rbd: added CLI support for trash operations
Signed-off-by: Ricardo Dias <rdias@suse.com>
2017-04-11 12:09:41 +01:00