from the man page:
The pthread_cond_broadcast() or pthread_cond_signal() functions may be
called by a thread whether or not it currently owns the mutex that
threads calling pthread_cond_wait() or pthread_cond_timedwait() have
associated with the condition variable during their waits.
The man page goes on to suggest that sometimes you might want to hold
the lock when signalling. This would be the case if you had some
other variable that could only change when the lock was held, and you
wanted to ensure that that variable did not change prior to the waiter
being woken. That is not the case here, so it's irrelevant.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
We were recalculating the migrator locks at the beginning and end of
export, but we were getting inconsistent sets at the end point, causing us
to unlock the wrong set of bounds. Instead, calculate the set when we
first start and again once we're frozen and things are set in stone. When
we're done, unlock that same set. Cleanup up the set as needed.
Signed-off-by: Sage Weil <sage@newdream.net>
Formerly we only allowed "ceph mds fail <rank>", and also failed to
check if rank was correctly parsed.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
When there are laggy MDSes, we should set health to WARN. Failed MDSes
should set health to FAIL. Stopped MDSes should not affect health.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
We need to specify pgp_bits as well or else we get the default (which makes
no sense when it's way bigger than pg_bits).
Signed-off-by: Sage Weil <sage@newdream.net>
This reverts commit cfd87ceefb.
The client side behavior here is correct: we should feed the raw pg into
osdmap->pg_to_acting_osds. The real problem is(was!) that pgp_num > pg_num
in current maps, which is illegal.
Signed-off-by: Sage Weil <sage@newdream.net>
We want to make sure we ignore any messages sent to us before we moved
back to the boot state (after being wrongly marked down). This is only
a problem currently while we are in the BOOT state and waiting to be
re-added to the map, because we may then call _share_map_incoming and
send something on the new rebound messenger to an old peer. Also assert
that we are !booting there to be sure.
Signed-off-by: Sage Weil <sage@newdream.net>
Before it only depended on the previous rotating secret (which was
always bigger than g_clock.now()). Since the tickets rotation is
never being done exactly when the old ticket expires (probably takes
a few seconds after that), then we ended up having tickets that expire
much sooner than we expected.
This reverts commit 77f90978dc.
Unit tests should not parse the normal "-c ceph.conf" command line
arguments, they should not read config files, etc. If something
needs initializing for a specific unit tests, we'll either fix it
to not need it, initialize it just for that, or figure some nicer
way of doing this.
The commit also broke "make distcheck".
An optional argument points can tell it where to put
generated files (in this case, virtualenv). Provide
the argument in Makefile.am.
Options are still passed to cram, so you can say
"./src/test/run-cli-tests -i".
It was using get_num(), which now reports the number created.
This probably wouldn't have worked previously except that
~C_Gather::C_GatherSub was inappropriately calling rm_sub().
Signed-off-by: Greg Farnum <gregf@hq.newdream.net>
This way when we're confident it works right, we can
remove the set<Context*> and just rely on ref counting.
Further optimizations would include using a spinlock
rather than a mutex, or possibly even just switching
sub_[created|existing]_count to be atomics.
Signed-off-by: Greg Farnum <gregf@hq.newdream.net>
Previously, C_Gather wasn't thread safe at all,
and there was an issue with creating subs while some
subs were being finished.
These issues are now fixed.
Signed-off-by: Greg Farnum <gregf@hq.newdream.net>