Commit Graph

11497 Commits

Author SHA1 Message Date
Greg Farnum
79d18933d1 mds: zero out the layout in handle_client_setlayout
Could have led to an invalid layout by mistake.
2010-10-04 10:42:36 -07:00
Greg Farnum
54e95fed28 mds: Look for and make use of directory tree default layouts, if existent. 2010-10-04 10:42:21 -07:00
Sage Weil
01ae1be288 filestore: make list_collections() list all dirs
coll_t is now unstructured; list all dirs besides '.' and '..'.

The old coll_t::parse() was broken.  Remove it.  Fixes
a4138c9050.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-10-04 08:50:31 -07:00
Sage Weil
940354b986 osd: make load_pgs verbose
Show what it's skipping any why.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-10-04 08:44:38 -07:00
Greg Farnum
0b7c1afc43 mds: fix setlayout truncation check.
The trunc_seq is initialized to 1 in prepare_new_inode.
2010-10-01 16:22:56 -07:00
Greg Farnum
c9e695598d mds: zero out the layout in handle_client_setlayout
Could have led to an invalid layout by mistake.
2010-10-01 16:21:50 -07:00
Greg Farnum
8a5008b813 mds: remove unused CompatSet mds_features.
All the MDS features are stored in the MDSMap::mdsmap_compat
2010-10-01 16:21:44 -07:00
Sage Weil
f389afc9a8 mon: add 'mds fail N' command
Manually mark an mds rank as failed.  The daemon should kill itself when
it finds out.

Note that this doesn't do any sanity checks, so it can also be used to
adjust state in an otherwise inconsistent mdsmap due to other bugs (one
where, say, an mds in up but has no info, or not up but not in the failed
set.)

Signed-off-by: Sage Weil <sage@newdream.net>
2010-10-01 15:55:03 -07:00
Colin Patrick McCabe
cdf43d543e buffer::list::copy: complain about invalid strings
Raise an exception when someone feeds us a "string" that has embedded
NULL characters.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-10-01 14:12:19 -07:00
Sage Weil
e87f751b3d mds: fix and use add_replica_stray() helper for handle_dentry_unlink
Eliminate duplicate code by using (and fixing) the helper.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-10-01 12:52:43 -07:00
Sage Weil
e18001c11b mds: fix stray replica push on _rename_prepare_witness()
We need to push all parents of the straydn to the target.  This changed
a while back with the mdsdir stuff but this bit of code wasn't updated.
Updated to mirror send_dentry_unlink().

This fixes a crash like:
mds/MDCache.cc: In function 'void MDCache::adjust_subtree_auth(CDir*, std::pair<int, int>, bool)':
mds/MDCache.cc:644: FAILED assert(root)
 ceph version 0.22~rc (0e67718a36)
 1: (MDCache::add_replica_dir(ceph::buffer::list::iterator&, CInode*, int, std::list<Context*, std::allocator<Context*> >&)+0x1c1) [0x536a91]
 2: (MDCache::add_replica_stray(ceph::buffer::list&, int)+0xdb) [0x536fab]
 3: (Server::handle_slave_rename_prep(MDRequest*)+0x1113) [0x4d5c33]
 4: (Server::dispatch_slave_request(MDRequest*)+0x21b) [0x4de80b]
 5: (Server::handle_slave_request(MMDSSlaveRequest*)+0x145) [0x4e1955]
 6: (MDS::_dispatch(Message*)+0x2598) [0x49e038]
...

Signed-off-by: Sage Weil <sage@newdream.net>
2010-10-01 12:52:43 -07:00
Sage Weil
26511cf7a5 osd: revamp forgetting lost objects
The old forget lost objects rewrote history in the PG log, which is asking
for all kinds of trouble.  Instead, add new logs events to indicate that
an object is LOST (deleted) or LOST_REVERTed (reverted to an older
version).

The LOST_REVERT case means we may need to recover the old version from
another node and rewrite the version number.  This isn't implemented yet;
for now we just assert.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-10-01 12:34:00 -07:00
Sage Weil
36067ea129 osd: revamp forgetting lost objects
The old forget lost objects rewrote history in the PG log, which is asking
for all kinds of trouble.  Instead, add new logs events to indicate that
an object is LOST (deleted) or LOST_REVERTed (reverted to an older
version).

The LOST_REVERT case means we may need to recover the old version from
another node and rewrite the version number.  This isn't implemented yet;
for now we just assert.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-10-01 12:32:59 -07:00
Colin Patrick McCabe
5e450300df osd: move PG::Info::coll to PG::coll
It's best not to have data members in PG::Info that are not serialized
and sent over the wire. Cache coll directly inside PG instead.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-10-01 11:56:42 -07:00
Colin P. McCabe
e305ea017d osd: cache coll_t in PG
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-10-01 10:27:51 -07:00
Sage Weil
5b798a3d47 osd: fix recovery_primary loop on local clone
When we take the clone branch, we update the missing map.  This invalidates
our current iterator, which can cause badness.  Instead, increment the
iterator near the top of the loop so we don't have to worry about it.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-30 22:00:06 -07:00
Colin P. McCabe
aaa58f5df4 gitignore: Ignore cscope and vim temporary files
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-09-30 18:13:44 -07:00
Colin Patrick McCabe
a4138c9050 osd: generalize coll_t to a string
coll_t is now a string. META_COLL and TEMP_COLL are just constants now.

Now there is a constructor that takes pgid_t and snapid_t, rather than
factory methods. It's clear what that constructor does, so wrapping it
in factory methods should be unecessary.

Bump coll_t serialization version to 3. Implement decoding for the old
versions.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-09-30 17:52:53 -07:00
Sage Weil
0e67718a36 mds: drop bad assert
Introduced by f1921c3a95.  Should probably
audit this code.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-30 10:54:58 -07:00
Sage Weil
ea6286ac24 Makefile: add missing include
Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-30 10:54:58 -07:00
Colin McCabe
7657a6d5b3 interval_set: hide data members
This change makes interval_set::m and interval_set::_size private data
members in interval_set, instead of public. This change also creates a
non-const iterator. Using this iterator, users can modify the length of
an interval. So now, all users can use the iterators rather than
interacting with the class internals directly.
2010-09-29 19:03:36 -07:00
Sage Weil
b9f2816b47 Makefile: add missing include
Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-29 12:02:30 -07:00
Greg Farnum
548df8ec13 mon: Fix issue first addressed in 2c5a3d99aa.
We were properly falling out of the while loop when we reached end(), but
not checking for it in the following if-else. Now we do!
Reported-by: Henry C Chang <henry_c_chang@tcloudcomputing.com>
2010-09-29 11:32:01 -07:00
Sage Weil
0523ce102f osd: do not request backlog from peers with empty pg
This avoids stalling out peering, because the peer just responds with
another 'empty' PG::Info in response (which we already have).

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-29 08:45:06 -07:00
Sage Weil
aa04c8fbbd osd: try to object from other replica(s) on EOF
If during recovery we are unable to pull from a replica due to reaching
EOF (e.g., zeroed out object), pull from the next available replica (if
any).

Eventually this should be extended to do the same when a checksum fails.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-29 08:45:06 -07:00
Colin Patrick McCabe
3bab6ac16a Add the setup-chroot.sh script
The setup-chroot.sh script is very handy for building the server in a
chroot environment. I thought I would share it here in case anyone else
finds it useful.
2010-09-28 19:25:10 -07:00
Sage Weil
2223b22dfc osd: clarify comment in recovery code
Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-28 12:31:09 -07:00
Greg Farnum
ab62aabf1f msgr: Don't take over old pipes if they're lossy.
Fixes bug #443.
2010-09-28 11:45:43 -07:00
Colin Patrick McCabe
d8f595e62f Implement interval_set::const_iterator 2010-09-27 14:47:18 -07:00
Colin Patrick McCabe
fb41b8f823 Rename interval_set::begin and end
Rename interval_set::begin and end to interval_set::range_begin and
interval_set::range_end, respectively.
2010-09-27 12:48:57 -07:00
Yehuda Sadeh
5a9a5e74df rgw: send 100-continue response only if requested 2010-09-27 10:01:47 -07:00
Sage Weil
da41f66fa8 mds: set PREXLOCK next state to LOCK
This really shouldn't happen (!), but if it does, at least avoid getting
the primary state out of sync with the replicas.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-27 08:33:27 -07:00
Sage Weil
f1921c3a95 mds: don't block request on freezing if we're already auth_pinned.
If we already auth_pinned, we're past the gates; don't stop on freezable.

This screws up xlock: the lock moves to PREXLOCK state, but the request
that would normally xlock it gets deferred because of a racing freezing
of the tree.  Then the PREXLOCK gather kicks in and badness happens.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-27 08:31:34 -07:00
Yehuda Sadeh
569d96bb80 rgw: fix meta attr setting when doing copy operation 2010-09-25 18:12:59 -07:00
Sage Weil
ead92c4fbe mds: block request is freezing
This prevents a deadlock where:

 - client request releases caps
 - caps release deferred (freezing)
 - request proceeds (freezing)
 - can't revoke caps because they're released (but deferred)
 deadlock!

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-25 14:44:50 -07:00
Sage Weil
2ae0172b06 osd: add coll_t::is_pg() method
This makes the interface a bit more adaptable for a situation where it has
a simple string representation instead of the strict structure it has now.
Eventually this function can simply attempt a pg_t parse.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-24 20:10:08 -07:00
Sage Weil
afa2d2fea1 mds: fix ESessions event type
Using the singular event type meant trying to decode as an ESession (and
failing!).

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-24 16:27:45 -07:00
Sage Weil
44587aaf5c mds: fix xlock state asserts for LocalLock
The LocalLock (versionlocks) allow xlocking but have only a single state
(LOCK_LOCK).

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-24 16:27:45 -07:00
Sage Weil
1d7eb8a082 mds: fix locallock rule (missing column)
The fwr column was missing, leading to a 0 for xlock, which broke slave
xlocks.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-24 15:22:18 -07:00
Sage Weil
f4114cf27e mds: add rename failure hooks 2010-09-24 15:15:12 -07:00
Sage Weil
87d5df1b79 osd: fix pull completion tests, again
op->complete==false is inconclusive.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-24 14:50:05 -07:00
Sage Weil
0a719d515e ceph: make version in backtrace look nice
match debug log
include .h, not .c
2010-09-24 14:01:52 -07:00
Sage Weil
27f712a5e2 osd: clean out redundant (and wrong) complete calculation
Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-24 13:57:00 -07:00
Greg Farnum
574fc5a1f3 mds: Create struct default_file_layout and encoder/decoder functions.
Also enable the state transfer when lock state changes.

Still to do: make anything actually create these.
2010-09-24 11:45:02 -07:00
Sage Weil
eb0a3fa679 osd: make sparse data/clone push behave with partial object push
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.
2010-09-24 11:44:23 -07:00
Sage Weil
7ca8e38c5d mds: defer MExportDirDiscover until we have root inode open
Otherwise we can't traverse or do anything useful.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-24 11:44:22 -07:00
Sage Weil
ea49ea65e2 mds: alloc auth xlock on versionlock/LocalLock
This is done when we do a slave xlock in order do avoid pipelining updates
to the inode, making rollback of complex operations like rename/link
safe.
2010-09-24 11:44:22 -07:00
Sage Weil
63bc150fe9 mds: defer cap release and update consistently when frozen
We need to preserve the order of processing of cap release and writeback
messages across handle_client_caps() and process_request_cap_release().
Use a helper with the appropriate condition, and defer the release
processing as needed.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-09-24 11:44:22 -07:00
Sage Weil
7f329dfe46 mds: refactor process_cap_update a bit
Fewer args
2010-09-24 11:44:22 -07:00
Sage Weil
82e52b4c45 mds: drop old/incorrect comment 2010-09-24 11:44:22 -07:00