Clean up the code to mirror the _to case.
Previously we would not mark down an old _from that is still a _to but with
a new address. Now we do.
Share a map while we're at it, just to be nice!
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If a peer remains a _to target but their address changes, we still want
to mark down the old connection.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
This could conceivably screw up ordering, and priority doesn't matter
anyway when this is the first message we send to this peer.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Consider peer P.
- P does down in, say, epoch 60, and back up in epoch 70
- P and requests a heartbeat, as_of 70
- We update to map 50, and coincidentally add the same peer as a target
- We set the heartbeat_to[P] = 50 and start sending to the _old_ address
- P marks us down because we stop sending to the new addr
- We eventually get map 70, but it's too late!
Make sure we preserve any _to targets _and_ their epoch+inst.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
We can't blinding ask for everything since last_epoch_started because that
may mean we get some fragment of a backlog. Look at the peer's log
ranges and request the correct thing. Also, in fulfill_log, infer what
the primary should have asked for if they make a bad request.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
We weren't accounting for the case where we have
(foo,foo]+backlog
i.e., everything is backlog, and rbegin().version != log.head.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If the peer log is empty, and we break out of the loop on the first pass,
then clearly last_update has not been adjusted.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
I'm hitting a case where the primary is compensating for a replica's
last_complete < log.tail by sending a log+backlog, but the replica
isn't smart enough to take advantage. In this case,
replica: log(781'26629,781'26631]
from primary: log(781'26629,781'26631]+backlog
result: log(781'26629,781'26631]
Doh!
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If the peer has a last_complete below their tail, we can get by with our
log (without backlog) if our tail if _before_ their last_complete, not
after. Otherwise, we need a backlog!
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
This fixes a bug where we were excluding up (but not acting) nodes from
past intervals, which in turn was triggering a nasty choose_acting loop
(because we _do_ already include acting but !up from the current
interval).
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Check them before entering the state machine so we can
safely enter the Crashed state on unexpected messages
from the current interval.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
So says dpkg-gencontrol, at least:
warning: dpkg-gencontrol: Depends field of package librados-dev: unknown substitution variable ${shlibs:Depends}
...
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
We may block in the write path because we've reached out dirty data limit.
Hold a reference to the FILE_BUFFER cap during that interval so we don't
lose the cap and put new dirty buffers into the objectcacher out of turn.
(We could also recheck our ability to take the ref after blocking, but I
think this is cleaner.)
Signed-off-by: Sage Weil <sage@newdream.net>
Have _flush return true if there are no dirty buffers. Clean up some
redundant conditionals in the callers
Signed-off-by: Sage Weil <sage@newdream.net>
We should never arrive in _flush() and not have a reference to the inode
in question, because the presence of dirty buffers pins the inode. This
condition was introduced forever ago; clean it out.
Signed-off-by: Sage Weil <sage@newdream.net>
We should either hold a ref or not; whether we release one can't depend on
whether one is held because we can't assume the ref belongs to us.
This changes the fix in cf6b1de4 so that the ObjectCacher just calls the
flush callback if it happens to trim all dirty buffers.
We also drop the (bogus) assert about the number of refs held.
Signed-off-by: Sage Weil <sage@newdream.net>
If there are no FILE_BUFFER cap_refs, then we can bail out early.
Otherwise we will end up dropping refs we don't have.
Signed-off-by: Sage Weil <sage@newdream.net>
Without preferring an OSD with a backlog, PGs would get stuck in the
active state when acting != up and the backlog was on an OSD with the
same last_update but a lower number or log_tail.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
We already hold the lock from a few frames up the stack (ms_dispatch).
Reported-by: Simon Tian <aixt2006@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>