Commit Graph

73122 Commits

Author SHA1 Message Date
Sage Weil
aac073dc2a mon: add 'osd last-stat-seq <osd>' command
Return the latest seq for the osd reflected in the mon's digest stats.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:45 -04:00
Sage Weil
fa70d0e81c mon/PGMap: coalesce last osd stat seq in the PGMapDigest
This is, strictly speaking, redundant, since the osd_stat is also in the
digest, but we plan to remove that.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:45 -04:00
Sage Weil
85b17ba18b osd: report a seq from flush_pg_stats command
Report a sequence number when we flush_pg_stats.  Combine the up_from and
a per-boot seq number to get a monotonically increasing value across OSD
restarts (we assume less than 4 billion stats reports in a single epoch).

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:45 -04:00
Sage Weil
38ddb686b6 osd: include up_from, seq in osd_stat_t
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:44 -04:00
Sage Weil
3c96f2f7ce mon/PGMonitor: clear PGMap data when require_luminous is set
Once the OSDMap flag is set there is no going back. Zero out the on-disk
PGMap data, and clear the in-memory PGMap to free up memory and make
bugs easier to spot.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:44 -04:00
Sage Weil
1e3f1fcc82 kv/RocksDBStore: make rmkeys_by_prefix efficient
This matches what rm_range_keys does.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:44 -04:00
Sage Weil
1e9c95ac97 mon/OSDMonitor: limit number of concurrently creating pgs
There is overhead for PGs we are creating because the mon has to track
which OSD each one current maps to.  This can be problematic on a very
large cluster.  Limit the overhead by setting a cap on the number of PGs
we are creating at once; leave the rest in a persistent queue.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:44 -04:00
Sage Weil
960a8d6f6d mon/MgrStatMonitor: fix digest vs pending digest
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:43 -04:00
Sage Weil
5a700a4699 mon/OSDMonitor: fix bad update_pending_pgs call
We are not persisiting the updated creating_pgs here; this is bad!  I'm
not sure why it was there to begin with?

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:43 -04:00
Sage Weil
58bf4a88fa mon/PGMonitor: disable when REQUIRE_LUMINOUS is set
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:43 -04:00
Kefu Chai
62d1960cb9 test: pass mon_pg_warn_min_per_osd=3 to mgr also
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-02 13:02:43 -04:00
Kefu Chai
3109da269f mon: move dump_info() to PGStatService
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-02 13:02:43 -04:00
Kefu Chai
063ad5aa2d mon: more constness to PGStatService
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-02 13:02:42 -04:00
Kefu Chai
53c96f2260 mon/OSDMonitor: do not reference pgservice if quorum not formed
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-02 13:02:42 -04:00
Sage Weil
a20c5e3cfe test/cephtool-test-*: enable mgr
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:42 -04:00
Sage Weil
a2fdede8ff mon/PGMap: add to mempool
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:42 -04:00
Sage Weil
66bf355811 mon/PGMap: use auto
I'm not rewriting this to use range iterator syntax because I'm in a
hurry. This just lets me change the types without touching all this code
again.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:39 -04:00
Sage Weil
07ddeb24c7 qa/workunites/ceph-helpers.sh: do not bail when num_pg==0
Right after the cluster is created when the first mgr report hasn't come
in yet we will report 0 pgs.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:11 -04:00
Sage Weil
6d7e1c100f test/osd/osd-dup.sh: run mgr with test
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:11 -04:00
Sage Weil
27bd39cd05 mgr/ClusterState: report health about pgs
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:10 -04:00
Sage Weil
daa0793c39 mon/PGMonitor: move most of get_health into PGMap
Leave the legacy full/nearfull stuff in PGMonitor (although we'll still
need to clean out the PGMap fields too).

This is cut and paste, some stripping of pg_map., g_conf -> cct->_conf,
and a bit of whitespace cleanup.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:10 -04:00
Sage Weil
71cbc2b793 mon: accept health summary and detail messages from mgr
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:10 -04:00
Kefu Chai
1c7b4be209 mon/PGMapStatService: various updates
* add override specifier
* s/parent/pgmap/
* remove unnecessary forward declarations
* make `pg_map` and `pgservice` private member variables.
* formatting changes: wrap at 80, for example.
* define maybe_add_creating_pgs() instead of get_pg_stat()
* use unique_ptr<PGMapStatService> for holding the pointer.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-02 13:02:10 -04:00
Kefu Chai
ba5c5f3f15 mon/PGStatService: define maybe_trim_creating_pgs() method
replace get_pg_stat() with maybe_trim_creating_pgs(), so it is more
symmetric: maybe_add_creating_pgs() versus maybe_trim_creating_pgs().
and we don't need to return a pointer which is always valid. a const
reference is a better fit in this case.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-02 13:02:10 -04:00
Kefu Chai
8e16c68b67 mon/MgrStatMonitor: add override specifier for virtual methods
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-02 13:02:09 -04:00
Kefu Chai
b306e9e0ac osd: stop sending pgstat if luminous
we don't send pgstat to mon from osd once we set
CEPH_OSDMAP_REQUIRE_LUMINOUS. and cleanup the pgstat queue when we
do the switch.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-02 13:02:09 -04:00
Kefu Chai
0647610325 mon/PGMonitor: reindent maybe_add_creating_pgs()
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-02 13:02:09 -04:00
Sage Weil
8c0c09cd75 mon: move mgr report handling into separate MgrStatMonitor
We don't want this is MgrMonitor or else the MgrMap epoch will roll over
every few seconds when we get a mgr report.  Also, it's nice to keep this
service separate from the unrelated MgrMap management.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:09 -04:00
Sage Weil
7df32d1159 mon/PGMonitor: link PGStatService to the actual PGMap
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:09 -04:00
Sage Weil
db1b98157a mon: adjust pgservice based on OSDMap require_luminous flag
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:08 -04:00
Kefu Chai
fe40e26337 mon: remove last trace of PGMap from MgrMonitor
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-02 13:02:08 -04:00
Sage Weil
b73e437414 mgr: send PGMapDigest instead of PGMap to mon
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:08 -04:00
Sage Weil
fb3405d0d3 mon/OSDMonitor: avoid pulling pgmap ratio on mkfs
If this is the first osdmap epoch there is nothing to be learned from
the PGMap.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:08 -04:00
Sage Weil
17b699d99d mon/PGStatService: implement pre-luminous methods in parent
Many of these are only needed to support PGMonitor.  Implement those
in the parent and make them ceph_abort() so that the new child can avoid
the clutter.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:07 -04:00
Sage Weil
8f2521617e mon/PGMap: move summary information into parent PGMapDigest object
Everything summary-ish that we need to send to the mon is moved into a
parent class.  The child PGMap retains the detail.

The parent gets its own encode(), and PGMap::encode_digest() will call it
to encode just the summary info.

Squashed in here is a new num_pg_by_osd that could have been done
in a preceding patch but I did things in the wrong order.  :(

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:05 -04:00
Sage Weil
0e598d965a mon/OSDMonitor: condition PGMap->creating priming on !luminous
Once we set the luminous flag we shouldn't need this anymore.  In fact,
we should stop needing this immediately after we set the monitor
luminous flag.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:01:11 -04:00
Sage Weil
08bd81fa10 mon/PGMap: use num_pg where available
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:01:08 -04:00
Sage Weil
39d524a433 mon/PGMap: remove version from summary
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:00:41 -04:00
Greg Farnum
504c7b8e2b mon: give PGMonitor and MgrMonitor their own PGStatService implementations
Right now they pretty much just copy the PGMapStatService, but it'll
let us slim down the MgrMonitor's one more easily.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:59:43 -04:00
Greg Farnum
ed1af717aa mon: move the PGStatService lifecycle into the MgrMon/PGMon
I remain lazy enough that we just use the MgrMon right now for easier
testing.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:59:43 -04:00
Greg Farnum
9b03a163e9 mon: pgstats: move some creating_pgs maintenance into the PGStatService
And remove get_pg_map() now that there are no users!

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:59:43 -04:00
Greg Farnum
5e0cbdf3f8 mon: pgstat: remove unneeded StatIter functions
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:59:42 -04:00
Greg Farnum
e7830b95d6 mon: pgstat: expose the full pg_stat map to remove a get_pg_map() call
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:59:42 -04:00
Greg Farnum
02f7a189b8 mon: pgstat: expose the full osd_stat map to remove a get_pg_map() call
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:59:42 -04:00
Greg Farnum
f8af069a77 mon: subclass PGStatService into PGMapStatService
Here we begin moving chunks into more appropriate locations.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:59:42 -04:00
Greg Farnum
2148386d53 mon: give PGStatService a reweight_by_utilization indirection
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:59:42 -04:00
Greg Farnum
a6e669c4d5 mon: give PGStatService a process_pg_command indirection
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:59:41 -04:00
Greg Farnum
1ca47d752d mon: use a pointer to PGStatService instead of putting it in Monitor
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:59:38 -04:00
Greg Farnum
8e9b1093c2 mon: kill direct references to pgmon from OSDMonitor
The only one left now is where the OSDMonitor triggers
PGMonitor::check_osd_map() and that's going to die post-Luminous,
so no need to do anything fancy with it.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:59:14 -04:00
Greg Farnum
d8cd3190cd mon: get the OSDMonitor's pg info dump functions away from using PGMap
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:59:14 -04:00