Sage Weil [Fri, 31 Mar 2017 19:22:00 +0000 (15:22 -0400)]
osd: fix beacon condition
- && should have been ||
- change this to instead not send when monmap epoch==0,
and only set last_sent_beacon if we actually send. That
way we'll send on the next tick after we get a real monmap.
Jos Collin [Fri, 31 Mar 2017 14:31:23 +0000 (20:01 +0530)]
rbd: warning, ‘devno’ may be used uninitialized in this function
The following warning appears during make. Fixed in both unmap_image() functions in krbd.cc
--
krbd.cc: In function ‘int krbd_unmap_by_spec(krbd_ctx*, const char*, const char*, const char*, const char*)’:
krbd.cc:608:65: warning: ‘devno’ may be used uninitialized in this function [-Wmaybe-uninitialized]
return do_unmap(ctx->udev, devno, build_unmap_buf(id, options));
^
krbd.cc:591:9: note: ‘devno’ was declared here
dev_t devno;
--
Kefu Chai [Fri, 31 Mar 2017 10:32:41 +0000 (18:32 +0800)]
osd/OSDMap: use _pg_to_up_acting_osds() to get_pg_acting_primary()
avoid unnecessary swap() call of vector<int> which will be dropped on
the floor after getting its first element, which can be retrieved using
another parameter using _pg_to_up_acting_osds() directly.
Kefu Chai [Thu, 30 Mar 2017 04:37:01 +0000 (12:37 +0800)]
tasks/workunit.py: specify the branch name when cloning a branch
c1309fb failed to specify a branch when cloning using --depth=1, which
by default clones the HEAD. and we can not "git checkout" a specific
sha1 if it is not HEAD, after cloning using '--depth=1', so in this
change, we dispatch "tag", "branch", "HEAD" using three Refspec classes.
Signed-off-by: Kefu Chai <kchai@redhat.com> Signed-off-by: Dan Mick <dan.mick@redhat.com>
Sage Weil [Thu, 30 Mar 2017 14:40:23 +0000 (10:40 -0400)]
mon/MgrMonitor: health warn/err if no active mgr
Start warning once mons are luminous; start erroring once
require_luminous is set in osdmap. Allow a grace period for
mgr to restart or standby to take over before we turn a warning
into an error.
Ilya Dryomov [Thu, 30 Mar 2017 16:59:08 +0000 (18:59 +0200)]
qa/vstart_runner: amend ps invocation
"ps -xwwu<id>" is parsed as BSD, because -x is not a UNIX option.
"u" is a BSD option for user-oriented format, so the <id> ends up being
parsed as an old-style "select by pid". The only reason this command
doesn't dump other user's processes is that the BSD "only yourself"
restriction is in effect.
I'm not sure what's wrong with a simple "ps xww", but if we want to
select by euid, let's do it right.
Kefu Chai [Mon, 13 Mar 2017 07:50:17 +0000 (15:50 +0800)]
mon: handle MOSDPGCreated messages
MOSDPGCreated messages are used to prune the creating_pgs_by_osd_epoch
and creating_pgs, by updating created_pools. as once a pool is created
we will not send MOSDPGCreate to its acting_primary OSD anymore.
Kefu Chai [Mon, 13 Mar 2017 07:13:03 +0000 (15:13 +0800)]
osd: send pg-created message if any pg is newly created
add an option named "osd_created_report_interval" to specify the
interval to check and send the "pg_created" mesages to mon
because pg could update its state when it is still in the pg_stat_queue,
for example, to change its state to PG_STATE_CLEAN, we cannot tell if we
have sent a "pg-created" message for it or not without introducing a new
member variable in PG.
Kefu Chai [Thu, 9 Mar 2017 04:08:29 +0000 (12:08 +0800)]
mon/OSDMonitor: add send_pg_create() to OSDMonitor
OSDMonitor will handle the pg-create subscriptions after luminous.
1. scan new pools to get the pgs to be created
2. send pg creates using the collected pgs
3. trim the creating_pgs using the "created!" messages from OSD.
please note that we need to wait for the OSDMonitor::mapping to be fully
populated, so we cannot scan the incrementa map for creating pgs until
it is applied and accepted by other monitors.
Kefu Chai [Tue, 28 Mar 2017 03:29:20 +0000 (11:29 +0800)]
mon: acquire lock when accessing mon->session_map
we will access the mon->session_map for sending the osd-pg-creates
messages when finishing osdmapping in OSDMonitor, this could happen in
another thread without the protection of Monitor::lock, or in the same
thread already guarded by Monitor::lock. so instead of changing
Monitor::lock to a recursive lock, a new lock is introduced to protect
session_map.
Kefu Chai [Sun, 19 Mar 2017 06:02:15 +0000 (14:02 +0800)]
mon/OSDMonitor: run mapping on peons also
otherwise subcriptions on peons won't get the creating_pgs notification
mapping updated. we want to send the notification from peons also. and
the notifications should be updated with the updated pg mapping.
Kefu Chai [Thu, 16 Mar 2017 09:43:19 +0000 (17:43 +0800)]
mon/OSDMonitor: mapping is not optional anymore
as pg_creatings needs mapping to get the acting_primary osd of the
creating pg, so we can send the pg-create message to it if it subscribes
to this information, mapping should always be available now.
Kefu Chai [Fri, 10 Mar 2017 17:27:59 +0000 (01:27 +0800)]
messages/MOSDBeacon: add beacon msg
osd will send beacon message to monitor periodically to inform it that
"i am still alive!", previously, monitor use the pg-stats to check the
status of OSD, but since osd will only send pg stat to mgr after
luminous, we use a dedicated msg for this purpose.
Kefu Chai [Thu, 9 Mar 2017 14:14:41 +0000 (22:14 +0800)]
mon/OSDMonitor: update comment in update_from_paxos()
this change updates the comment for 7fb3804fb, 97462a3 and e807770,
to reflect the reason why we need to fix latest_full in current code.
as the fix is not a workaround for cuttlefish anymore, it resolves the
issue where
0. mon.c has a latest_full of 5
1. mon.c is shutdown and out of sync with the quorum
2. mon.c starts sync
3. mon.c now has osdmap[31..50], and the latest_full is still 5.
Kefu Chai [Fri, 24 Feb 2017 12:38:03 +0000 (20:38 +0800)]
mon: pass const variables by const ref not pointer
* PGMapUpdater::check_down_pgs(): pass a const reference to pgmap
instead of a pointer
* PGMapUpdater::register_new_pgs(): pass a const reference to pgmap
instead of a pointer
Sage Weil [Wed, 22 Mar 2017 18:21:46 +0000 (13:21 -0500)]
mon/PGMap: set initial pg timestamp as osdmap modified stamp
Currently the PGMap may register the new pg in multiple places: the
mgr or mon, and the timestamp is when the mon or mgr gets around to
recording it into its PGMap. Make this deterministic by using the OSDMap
mtime (which is when the PG was *actually* created).
This fixes a problem where the pg create command has one timestamp (from
the mon) and the pgmap on the mgr has another, so an observer will see the
last_scrub_stamp (and other timestamps) change when nothing has actually
happened.
Sage Weil [Wed, 22 Mar 2017 16:36:01 +0000 (11:36 -0500)]
mgr/MgrClient: assume missing MgrMap means no acces to mgr at all
If we get as far as authenticating and have no MgrMap that implies the
mon didn't provide us one (despite our request) and we have no access to
the mgr at all.
Sage Weil [Fri, 10 Mar 2017 22:14:24 +0000 (17:14 -0500)]
mgr/MgrClient: cope with disappearing perf_counters
Perfcounters can go away; deal with it. This collapses
into a single loop, but it means that the mgr might
stop getting certain counters without explicit
notification.