Commit Graph

11762 Commits

Author SHA1 Message Date
Sage Weil
51b6a863a8 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.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-06 21:00:51 -07:00
Sage Weil
eb0a60d024 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!

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-06 21:00:46 -07:00
Sage Weil
a582345c57 Merge branch 'mix_stale' into unstable 2010-11-05 17:08:10 -07:00
Sage Weil
4126d1ce36 mds: add more verify_scatter asserts
For catchings fragstat errors sooner.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-05 17:06:10 -07:00
Sage Weil
ae670c3387 mds: fix version check on resyncing stale rstat in predirty_journal_parents
We're resyncing rstat, so check the rstat version (not fragstat!)

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-05 15:24:53 -07:00
Greg Farnum
4cee6ead7b mds: Fix bad inode deref.
Accidentally trying to print out the CInode after removing it in trim_non_auth!
Move the print to before it's been unlinked/removed/etc.
2010-11-05 12:45:45 -07:00
Colin Patrick McCabe
93344fb28e Revisit std::multimap decoder
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>
2010-11-05 12:20:38 -07:00
Colin Patrick McCabe
f015c9894a autogen.sh: check for pkg-config
To avoid seeing confusing errors later in the configure process, in
autogen.sh, check to make sure the pkg-config program is installed.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-11-05 11:34:11 -07:00
Sage Weil
989fa67d43 mds: preserve version when recovering rstat from dirfrag in predirty_journal_parents
We don't want to screw up the version here.  This aligns the code with
other instances of this check.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-05 10:38:35 -07:00
Sage Weil
9586e9052c mds: restructure finish_scatter_gather_update()
Separate behavior into two dimensions: whether or not we are updating
the dirfrag, and whether or not the dirfrag is stale.

Change the various helpers to NOT implicitly update accounted_*, as the
caller doesn't always want that, notably when we are non-stale but frozen.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-04 23:20:33 -07:00
Sage Weil
669a8afaa4 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.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-04 23:15:06 -07:00
Sage Weil
663b470f91 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.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-04 22:48:09 -07:00
Sage Weil
63c1ad84d2 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.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-04 22:44:01 -07:00
Sage Weil
9b6d96e9aa 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.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-04 22:19:53 -07:00
Colin Patrick McCabe
62716aa7c9 PGMonitor::update_from_paxos: check for bad input
Be more robust against bad data coming in from the network.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-11-04 16:22:21 -07:00
Colin Patrick McCabe
8f3672dc48 Replace sprintf with snprintf
Replace sprintf with snprintf. This is especially critical when the
format string includes "%s".

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-11-04 14:33:48 -07:00
Colin Patrick McCabe
56179d12f8 start_profiler/enable_profiler_options:fix memleak
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-11-04 14:26:08 -07:00
Colin Patrick McCabe
e6a751bda5 Set HEAP_PROFILE_INUSE_INTERVAL based on conf
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-11-04 14:11:41 -07:00
Colin Patrick McCabe
8c8bfdb3e2 CInode::make_path_string: don't coerce ino
CInode::make_path_string: don't coerce the inode number to 32-bits.
Everyone else is treating it as 64 bits; this function should too.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-11-04 14:09:32 -07:00
Sage Weil
53f6ed163b mds: mds debug scatterstat to print out projected rstat/fragstat
Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-04 13:17:48 -07:00
Sage Weil
f23ba003d7 mds: verify single frag rstat on projection too
Currently we do a sanity check on gather; do the same check in
project_rstat_frag_to_inode().

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-04 13:17:48 -07:00
Greg Farnum
4df92adea4 Merge branch 'dumpjournal' into unstable 2010-11-04 11:58:30 -07:00
Greg Farnum
d3c2b9cb2b cmds: Include journal dumper functionality. 2010-11-04 11:41:26 -07:00
Greg Farnum
e0a5de25c1 dumper: Add new Dumper class.
This lets you dump an MDS journal to a file.
2010-11-04 11:41:21 -07:00
Sage Weil
28f956ae31 mds: fix optional frag asserts
We want these to trigger when mds_verify_scatter is true.  Only one !.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-04 11:33:49 -07:00
Greg Farnum
86d6e51e8b objecter: add new wait_for_osd_map function. 2010-11-04 11:28:52 -07:00
Sage Weil
8a41d096c7 osd: clean up active <-> booting state transitions
Among other things, get rid of the 'wrongly marked down' log message on
normal startup.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-04 11:13:31 -07:00
Colin Patrick McCabe
f917df7942 TestEncoding: count number of ctor invocations
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-11-04 10:24:52 -07:00
Sage Weil
0d1bfe06b3 client: print useful max_size waiting message
Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 16:41:29 -07:00
Sage Weil
fc9059e527 Merge branch 'mix_stale' into unstable 2010-11-03 16:40:19 -07:00
Sage Weil
4f24fcbc8a debian: add gtk build-depends
For ceph -g.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 16:40:13 -07:00
Sage Weil
d0c29d7d2c mds: add 'mds verify scatter' and re-add some scatter asserts
Check on ifile and inest gather that stats match single-frag dirs.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 14:47:32 -07:00
Sage Weil
fd57f4de21 mds: fix put_xlock() assert for slave masters
If we are a master of a slave, the state will be LOCK.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 14:47:32 -07:00
Sage Weil
a98812f913 mds: rename 'mix stale' => 'mix_stale'
For unambigous debug output

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 14:47:31 -07:00
Sage Weil
4d669c8cfc mds: request unscatter when MIX_STALE on replica
This means implementing REQUNSCATTER.

Eventually this should use TEMPSYNC, but that isn't fully implemented yet.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 14:47:31 -07:00
Sage Weil
8b9342c7b1 mds: disable tempsync
Tempsync is not implemented in the filelock state machine.  Never use it,
at lesat for now!

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 14:47:31 -07:00
Sage Weil
563a9ba669 mds: finish_scatter_update on auth dirfrags too
We can update the dirfrag accounted on auth dirfrags at scatter time too.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 14:47:31 -07:00
Sage Weil
0e079bc85d 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).

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 13:08:06 -07:00
Colin Patrick McCabe
77ec378d14 Add the ps-ceph.sh tool
This allows you to see at a glance which ceph programs and tools you
have running.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-11-03 12:52:49 -07:00
Colin Patrick McCabe
4e586dd073 encoding.h: fix compiler warning
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>
2010-11-03 12:19:05 -07:00
Colin Patrick McCabe
c98b0268fd TestEncoding: add templated encode-then-decode fn
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>
2010-11-03 12:19:03 -07:00
Colin Patrick McCabe
84e2da8dd4 Create TestEncoding to test serialization code
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-11-03 12:18:56 -07:00
Sage Weil
60c59aed15 mds: add some scatterlock notes
Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 11:07:40 -07:00
Sage Weil
0dc75a94ce ceph: remove bad assert for old frag stat
It's normal for old fragstat info to be mismatched (stat !=
accounted_stat).

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 11:03:37 -07:00
Sage Weil
3413518534 mds: match conditions in finish_scatter_gather_update_accounted
This needs to match the frozen check in finish_scatter_gather_update.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 10:51:42 -07:00
Sage Weil
33268e20e9 mds: handle MIX_STALE on auth too
Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 10:12:35 -07:00
Sage Weil
14f4d22cde mds: scatter_info_t ancestor for nest_info_t and frag_info_t
This will facilitate using generic code for the inest and ifile
scatterlocks.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 09:51:15 -07:00
Sage Weil
cbacc1d490 mds: only mark auth dirfrags stale in start_scatter
Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-03 09:47:23 -07:00
Sage Weil
44574e86bb 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!).

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-02 21:51:15 -07:00
Sage Weil
4a0f731262 mds: do not update accounted_*stat if auth and frozen
The auth can't update a frozen dirfrag for the same reason a replica
can't.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-11-02 21:49:45 -07:00