Greg Farnum [Tue, 28 Jun 2011 00:03:42 +0000 (17:03 -0700)]
mds: Explicitly initialize layout fields, and to the correct values.
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.)
Sage Weil [Fri, 24 Jun 2011 18:19:48 +0000 (11:19 -0700)]
client: fix trim_caps
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.
Sage Weil [Fri, 24 Jun 2011 17:46:32 +0000 (10:46 -0700)]
client: prefer auth cap in caps_issued_mask()
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.
Sage Weil [Fri, 24 Jun 2011 17:45:46 +0000 (10:45 -0700)]
client: touch cap on lookup even if we use the dentry lease
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.
Sage Weil [Thu, 23 Jun 2011 21:26:34 +0000 (14:26 -0700)]
osd: instrument readable latency too
Time before a write is readable (not necessarily on disk). Note that if we
get the commit first (e.g. writeahead journal) this value isn't calculated
or logged.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Tommi Virtanen [Wed, 22 Jun 2011 22:23:14 +0000 (15:23 -0700)]
run-cli-tests: Pass through CCACHE_DIR and such env vars.
Commit 7cd50f29d5cbf8deb64d00318b39c281119c0e03 makes the binaries
use libtool's "executable wrappers", which will transparently relink
the executables if they think that's needed. The test for that is
somewhat flawed: if the mtimes match, the binary might or might not
get relinked. In practise, this causes relinks on gitbuilder all the
time.
As of earlier commit 5a0bc6b78f2e40ec9255a1ea49f77ef9ea4690a6, we
started sanitizing the environment passed to the clitests. This meant
we also stripped away CCACHE_DIR and other settings, needed to
properly relink the binaries. Re-add CCACHE_DIR, CC, CXX to clitests
environment.
To handle the case where CCACHE_DIR etc are not set in the first
place, we need an extra wrapper script. Otherwise, ccache might see an
empty string as the env value, and naturally couldn't access a
directory by that name.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
Sage Weil [Wed, 22 Jun 2011 19:45:35 +0000 (12:45 -0700)]
client: always use get_snap_context() accessor
There were a few places where we were using the member directly and not the
accessor, which rebuilds the internal value when needed. This caused
inconsistent behavior based on whether debugging was enabled or not, since
we used the accessor to print the regenerated value.
Greg Farnum [Tue, 21 Jun 2011 00:55:54 +0000 (17:55 -0700)]
AnchorServer: overwrite old Anchor backpointers when proper.
Sometimes when we do an AnchorTable update, it's because the inode
in question got moved. However, if the inode had multiple references,
its Anchor wasn't removed by decrementing its count, and so the add
function simply noted that it already had the Anchor and returned.
This obviously wasn't the proper behavior in cases where the inode
was getting moved -- we want to update its back pointer! So do so.
Greg Farnum [Mon, 20 Jun 2011 19:17:24 +0000 (12:17 -0700)]
uclient: Update statfs to match the kernel client and its block sizing.
Make it better match the kernel client, and its scheme to use a large
block size so we don't overflow 32-bit systems. This isn't presently
a serious concern since FUSE doesn't work on 32-bit systems anyway,
but the output of df should match even so.
Greg Farnum [Fri, 17 Jun 2011 18:52:13 +0000 (11:52 -0700)]
uclient: fix flush_caps(Inode*,int)
This function was just broken before. You need to be setting
flushing_cap_tids for the caps you're actually flushing, which
in this case is in->dirty_caps, not the horribly-named "flush"
variable.
Also, rename "flush" to "retain" since that's what it actually is!
Greg Farnum [Fri, 17 Jun 2011 18:08:26 +0000 (11:08 -0700)]
uclient: only change the auth_cap if the mseq is newer
Previously we just trusted the MDS' reported auth status, which meant
that even if the MDS was always right it could encode the stat while
auth, then export, and then have us decode the stat after getting
an IMPORT and set the auth cap right back!
Ensure that the signal waits for us to call sigsuspend, rather than
getting delievered to another thread. We do this by using SIGPIPE as our
signal of choice. SIGPIPE is blocked in all Ceph threads by default.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>