]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: unify export_targets handling for all exports
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 18 Apr 2017 02:39:19 +0000 (22:39 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 18 Apr 2017 20:50:00 +0000 (16:50 -0400)
commit082e86c58f5abb93e2a912e603d86f12bc47972c
treea101c86b9febde525abf0d31f7201d9aceaf3482
parent89e990b608f0019dc0e0226add9bb40aae20a1e0
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>
src/common/config_opts.h
src/mds/MDBalancer.cc
src/mds/MDBalancer.h
src/mds/MDCache.cc
src/mds/MDSRank.cc
src/mds/MDSRank.h
src/mds/Migrator.cc
src/mds/Migrator.h