Saw an OSD that was up in the map, but the address didn't match. Caused
all kinds of strange behavior. I'm not sure what I had in mind when the
original test only checked for down AND same address before moving to boot
state, since having the wrong address is clearly bad news.
Signed-off-by: Sage Weil <sage@newdream.net>
We were truncating if we were in log_per_instance mode. But normally those
logs don't exist. And if they do, we probably don't want to truncate
them. This is particularly true if we respawn ourselves (e.g. after being
marked down) and restart with the same pid.
Signed-off-by: Sage Weil <sage@newdream.net>
This was causing a lot of slowdowns.
Additionally, pin the inode when exporting caps -- otherwise it could
disappear out from under a cap ack. This was probably just exposed
by fixing the lock check.
If peering screws up and the primary mistakenly tries to pull an object
from us we don't have, log an error instead of crashing. This will still
throw off recovery (it will hang), but that's better than crashing
outright.
We can't error out if we don't get everything we want in one go now that
we support pushing objects in pieces. Remove this check entirely, since
we don't have a good error handling case anyway.
Since we cancel deletion on pg change, we will only receive these from
old primaries, so we can safely ignore.
Signed-off-by: Sage Weil <sage@newdream.net>
If the primary changes, cancel deletion so that the new primary has the
benefit of considering whether they need anything we have. Before we were
only canceling if our role changed, but that makes little sense.
Signed-off-by: Sage Weil <sage@newdream.net>
If we can't create the mon0/magic file, show an error message rather
than calling assert(). These cases are probably cluster configuration
problems.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
These aren't used for anything.
Also rename the default_dir_layout to _log_, since that's all that we now
use it for.
Signed-off-by: Sage Weil <sage@newdream.net>
Initializing to 0 was causing file_to_extents to get called on every inode
since the MDS initializes truncate_seq to 1 and truncate_length to -1.
This revealed itself as a crash on directory inodes, which have their
layouts zeroed since merging the file_layouts branch.
To make clearer, assert that anything being truncated is a file inode.