Currently we only refresh required_features on Elector::start(). This
does not prevent an old peer from calling an election (even though they
won't succeed in joining the resulting quorum).
Fix this by updating the elector's features when they change. This way we
don't allow a useless election cycle just to trigger that update in
start().
Signed-off-by: Sage Weil <sage@inktank.com>
If an old peer gets a PROPOSE from us, we need to be sure to ignore their
ACK. Ignoring their PROPOSEs isn't sufficient to keep them out of a
quorum.
Fixes: #8042
Signed-off-by: Sage Weil <sage@inktank.com>
Wake up umount waiter if receiving session open message while
umounting. The umount waiter will re-close the session.
Fixes: #8004
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Zero-length writes would hang because the completion was never
called. Reads would hit an assert about zero length in
Striper::file_to_exents().
Fix all of these cases by skipping zero-length extents. The completion
is created and finished when finish_adding_requests() is called. This
is slightly different from usual completions since it comes from the
same thread as the one scheduling the request, but zero-length aio
requests should never happen from things that might care about this,
like QEMU.
Writes and discards have had this bug since the beginning of
librbd. Reads might have avoided it until stripingv2 was added.
Fixes: #5469
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
We observed a sequence like:
- replay journal
- sets JournalingObjectStore applied_op_seq
- umount
- mount
- initiate commit with prevous applied_op_seq
- replay journal
- commit finishes
- on replay commit, we fail assert op > committed_seq
Although strictly speaking the assert failure is harmless here, in general
we should not let state leak through from a previous mount into this
mount or else assertions are in general more difficult to reason about.
Fixes: #8019
Signed-off-by: Sage Weil <sage@inktank.com>
This makes is to that ./init-ceph restart osd.0 won't modify the CRUSH
tree. And in any case, the localhost/localrack thing we were doing before
was pretty useless.
Signed-off-by: Sage Weil <sage@inktank.com>
erasure-code: thread-safe initialization of gf-complete
This looks like a good interim solution until gf-complete exposes a simpler init function
that hides this.
Reviewed-by: Sage Weil <sage@inktank.com>
The main change is use shared_ptr instead of weak_ptr to define
active request map. The reason is that slave request needs to be
preserved until master explicitly finishes it.
Fixes: #8026
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Instead of relying on an implicit initialization happening during
encoding/decoding with galois.c:galois_init_default_field, call
gf.c:gf_init_easy for each w values when the plugin is loaded.
Loading the plugin is protected against race conditions by a lock.
It does not cover all possible uses of gf-complete but it is enough for
the ceph jerasure plugin.
http://tracker.ceph.com/issues/7914fixes#7914
Signed-off-by: Loic Dachary <loic@dachary.org>
Sadly, you can't implicitly convert non-const references to shared pointers, so avoid the atomic ops necessary when copying a shared_ptr.
Signed-off-by: Greg Farnum <greg@inktank.com>
If the previous clone is evicted, we shouldn't adjust the stats to
account for its new clone_overlap value.
Fixes: #7964
Signed-off-by: Samuel Just <sam.just@inktank.com>