Previously we only filled in IPs if they were set by the config file
(at startup) or after we connected to the monitor. Unfortunately this
could lead to conditions where the OSD connected to itself without
knowing that's what it was doing, because the cluster_addr IP wasn't
filled in until much too late. We've provided a mechanism for filling
in the IP and do so in OSD::boot_start.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
The snaprealm root directory inode belongs to the snaprealm, at least
currently. This make split_at() consistent with the non-directory case
at the top of the method, and prevents a crash later down the line when we
try to tear down the parent snaprealm and we aren't part of it.
Fixes: #1238
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
This causes all kinds of trouble if it occurs because most of the
code isn't prepared for it. So prevent that from happening except
on messages that were explicitly created that way.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Previously we ignored them, except for printing them out. This could
lead to bad things like creating new journals for non-existent MDSes
if you entered an invalid rank during --reset-journal.
Also assert that the stripe unit is valid
before using it as a divisor.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Previously, some old objects could escape removal during a log merge.
This patch also simplifies merge_log somewhat.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Previously, we would assume that we had an object at the prior_version
in the log event if we encounter it but don't see the object in missing.
Now, if prior_version < log_tail, we assume that we do not have the
object.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
We were previously encoding an fl_pg_preferred of 0, which did
horrible things to the kernel client since 0 is a valid osd to ask for!
To make such things easier to track down in the future, explicitly
fill in defaults when memsetting the struct here.
(There remain other places that memset the struct to zero without
a lot of checks. But we definitely don't want to force them all
to fill in the individual fields, as that's fragile, and since they
don't seem to be breaking anything yet I'm inclined to leave them as
they are.)
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
This tests the file layout functionality. Right now you need to
check the comparisons yourself. Expect that to change shortly.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
We can't blindly remove caps from inodes because we need at least one cap
for any inode in our cache. Try to trim non-essential caps (when there's
>1), otherwise try to drop referring dentries and indirectly release caps
that way.
Signed-off-by: Sage Weil <sage@newdream.net>
If we have an auth cap, prefer to touch that one. This helps consolidate
caps on a single mds and allows mds replicas to eventually recall their
state.
Signed-off-by: Sage Weil <sage@newdream.net>
Touch the dir cap for the lease's mds even if we use the lease to traverse.
This makes the trim_caps() behave better because it keeps the dentry and
session cap LRUs in sync.
Signed-off-by: Sage Weil <sage@newdream.net>