Sage Weil [Sun, 7 Nov 2010 03:17:32 +0000 (20:17 -0700)]
mds: don't use helper for rename srcdn
The rdlock_path_xlock_dentry helper works for _auth_ dentries that we
create locally in an auth dirfrag. For the srcdn, we need to discover an
_existing_ dentry that is not necessarily auth.
Call path_traverse ourselves, but be careful to take the appropriate locks
on the resulting dn, dir, and ancestors.
Sage Weil [Sat, 6 Nov 2010 18:02:13 +0000 (11:02 -0700)]
mds: never complete a gather on a flushing lock
The scatter_writebehind() takes a wrlock, but that may still allow the lock
to complete a gather to LOCK and even move to say MIX before the data is
committed. Bad news!
Previously I changed the std::multimap decoder to minimize the number of
constructor invocations. However, it could be much more expensive to
copy an initialized (decoded) val_t than to copy an empty one. For
example, if we are decoding std::multimap < int, std::set <int> >. So
change the code to insert a non-decoded val_t again.
However, this still saves two constructor invocations over the original.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
Sage Weil [Fri, 5 Nov 2010 06:15:06 +0000 (23:15 -0700)]
mds: do not bump scatter stat lock in predirty_journal_parents
If we're in the MIX state, we clearly can't touch this without screwing up
the delicate scatter/gather behavior. If we're in, say, LOCK, there is
still no reason to update it. One frag at least is local and auth if we
are in this code, but there may be other frags on other nodes. This would
just make them appear stale when they are not.
Sage Weil [Fri, 5 Nov 2010 05:48:09 +0000 (22:48 -0700)]
mds: mark scatterlock stale on import of stale frag scatter stat
When the lock scattered, if we didn't have an auth frag that was frozen,
we go into MIX state. Later, we may import a stale dirfrag. We need to
move to MIX_STALE at that point, and/or mark the lock stale so that any
subsequent transition does so.
Sage Weil [Fri, 5 Nov 2010 05:44:01 +0000 (22:44 -0700)]
mds: match bottom half of assilate_dirty_rstat_inodes with a dir flag
We only do the assimilate_dirty_rstat_inodes if we do an update AND the
frag rstat was non-stale, but the bottom half (_finish) doesn't have the
same info to know whether we did it because the top half updates the
fragstat version. Use a flag to indicate we've updated the dirfrag so
the bottom half will only run when needed.
Sage Weil [Fri, 5 Nov 2010 05:19:53 +0000 (22:19 -0700)]
mds: fix inode version used for inest in decode_lock_state
We need to pass the inode rstat's version into finish_scatter_update, not
the shadowed local variable. Otherwise we don't update the dirfrag when
we should.
Sage Weil [Wed, 3 Nov 2010 20:08:06 +0000 (13:08 -0700)]
mds: use helper for scatter dirfrag update; use on local dirfrags
Any time we scatter is an opportunity to update the dirfrag with the
accounted scatter stat if it is out of date. We should use that
opportunity even when the dirfrag is on the same node as the inode (i.e.,
not just through decode_lock_state).
Fix a compiler warning about an uninitialized variable. Basically, we
used to insert uninitialized values into a std::multimap and then fix
them later. Rather than doing that, just insert the value we want
directly into the map.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
TestEncoding: add a templated encode-then-decode fn that can be used to
test encoding followed by decoding of any type. Test encoding and
decoding of a std::multimap.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
Sage Weil [Wed, 3 Nov 2010 04:51:15 +0000 (21:51 -0700)]
mds: mark scatterlock stale if any auth dirfrags appear stale
The auth needs to move to MIX_STALE for the same reasons a replica does:
if, on scatter, any dirfrags have an old accounted_*stat, the lock needs to
be marked stale (or updated... TODO!).
Sage Weil [Tue, 2 Nov 2010 18:10:38 +0000 (11:10 -0700)]
filestore: disable 'filestore btrfs snap' when SNAP_DESTROY is missing
We want to enable the new snap stuff by default. But we also want to work
with the default configuration on old kernels.
The only downside here is that someone might explicitly enable it, only to
have it disabled on started because their kernel is old. They'll get a
bright yellow warning in that case, at least.
The three modes each get an explicit config option that defaults to false.
You can choose one explicitly by enabling one of those. Otherwise, we
will choose an appropriate mode automatically based on detected btrfs
ioctls.
* Fix VPATH builds (i.e., builds where srcdir != builddir).
Don't assume that we can get a source files named blah with ./blah.
Use $(srcdir)/blah instead.
* When doing "make dist", inject the .git_version file directly into the
ceph tarball
* Add tools/gui_resources.h to noinst_HEADERS
* Add ceph_tool_gui_DATA to all_sources
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
Sage Weil [Fri, 29 Oct 2010 22:28:37 +0000 (15:28 -0700)]
osd: write potentially large pg info to object, not xattr [format change]
Write past_intervals and snap_collections to a separate object instead of
an attr on the collection directory. This avoids exceeding the underlying
filesystem xattr limits during thrashing recovery. The struct_v on the
small info xattr is used to indicate the format of the biginfo object.
Also fixed pg deletion to clean out log and biginfo objects.
Sage Weil [Fri, 29 Oct 2010 20:06:49 +0000 (13:06 -0700)]
mds: auth_pin head/snap pairs for all need_snapflush entries
This ensures that when snap metadata is flushed, we will be auth on both
inodes and be able to do the update properly. This isn't the nicest
solution ever, since it can make migrations laggy, but it's the simplest.
Make install now installs the gui resource files into
/usr/share/cephtool/gui_resources (or wherever we configure it to go
using configure). We also support grabbing the resources out of the
local source tree, for when we're running the program from there.
run_gui: catch exceptions and explain what they are, rather than letting
them go to the top level.
GuiMonitor::open_icon: const cleanup.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>