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.
Signed-off-by: Kefu Chai <kchai@redhat.com>
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>
Among other things, this prevents a mgr activation stall if it
happens to request config-keys from a mon that is out of
quorum.
Signed-off-by: Sage Weil <sage@redhat.com>
This is mostly because I couldn't debug a weird state where
it kept updating but it appeared the addr was not changing
(always '-').
Signed-off-by: Sage Weil <sage@redhat.com>
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.
Signed-off-by: Sage Weil <sage@redhat.com>
"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.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
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.
Signed-off-by: Kefu Chai <kchai@redhat.com>
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.
Signed-off-by: Kefu Chai <kchai@redhat.com>
add a new message type MPGCreated. osd is supposed to send this message
to monitor to inform that any pg(s) is created and activated.
Signed-off-by: Kefu Chai <kchai@redhat.com>
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.
Signed-off-by: Kefu Chai <kchai@redhat.com>
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.
Signed-off-by: Kefu Chai <kchai@redhat.com>
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.
Signed-off-by: Kefu Chai <kchai@redhat.com>