Sage Weil [Thu, 28 Apr 2011 00:07:54 +0000 (17:07 -0700)]
mds: handle freeze completion delayed by frozen inode
We can't complete a freeze_tree if we are not a subtree and the parent
inode is frozen. If that's the case, we were just doing nothing on the
auth_unpin, but that means the freeze_tree would never complete.
Instead, retake an auth_pin (on behalf of the parent) and release it when
the parent inode unfreezes.
Sage Weil [Wed, 27 Apr 2011 23:33:21 +0000 (16:33 -0700)]
mds: fix nested_auth_pin accounting on refragment
The diri gets an auth_pin on the first frag pin when it is not a subtree
root. When we are moving dentries between frags during refragment, make
sure we use the adjust_nested_auth_pins method to have one such pin per
fragment.
Carry an auth_pin on the old fragment for the duration to ensure that the
pinning/unpinning as no side-effects.
Sage Weil [Wed, 27 Apr 2011 22:52:26 +0000 (15:52 -0700)]
mds: maintain dn pinning invariants during freezing for refragmenting
fragment_mark_and_complete aims to complete the in-cache directory,
mark+pin every dentry, then drop a final auth_pin so that the whole thing
freezes. The problem is we may not be holding the final auth_pin, and
other dentries may get added (or removed?) between the mark and freeze
stages.
Use the DNPINNEDFRAG dir state bit to maintain the invariant that that
bit is set IFF all dentries are similarly pinned and marked. Update the
add_*_dentry and remove_dentry methods to do that.
Fix the success path to assert this was true and to clean up(!). Also
fix the unwind/failure path to assert.
Sage Weil [Wed, 27 Apr 2011 22:09:35 +0000 (15:09 -0700)]
mds: freeze fragments during split/merge
Freeze the target fragment(s) before unfreezing the old fragment(s) to
avoid any weird events going off when the unfreeze unauth_pins the dir
inode (in certain cases). This makes the whole process cleaner and more
symmetrical.
Tommi Virtanen [Wed, 27 Apr 2011 19:16:52 +0000 (12:16 -0700)]
automake: Make debug targets known but not built by default in non-debug builds.
With this, "./configure --without-debug && make -C src testceph" will work.
Before this, it would use make builtin rules, and fail to compile in a
confusing manner.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
Sage Weil [Wed, 27 Apr 2011 17:59:40 +0000 (10:59 -0700)]
mds: handle discovers that race with refragmenting
Consider:
- send discover on frag X
- X refragments
- we take the waiter and rediscover on frag Y
- we get the reply for the X discover
The auth mds will correctly delay sending the reply until the refragment
completes and it unfreezes, but the reply was getting the original frag_t,
not the new one.
Jim Schutt [Tue, 26 Apr 2011 22:06:46 +0000 (15:06 -0700)]
configure.ac: check for supported compiler flags
Ancient versions of gcc, such as the gcc 4.1.2 in RHEL 5.5, don't
support some -W flags that newer versions do. Fix up configure.ac
and Makefile.am to use them if you have them.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Sage Weil [Tue, 26 Apr 2011 21:43:24 +0000 (14:43 -0700)]
mon: fix standby-replay assignment logic
Assign a standby-replay at any time based on rank, name, or no preference.
Previously this could only happen when the MDS first started, and we would
fail if the target MDS wasn't followable at that point in time.
Implement RadosStore, a storage backend which accesses librados
directly, without going through RGW (Rados GateWay).
This version is still very preliminary because ACLs aren't supported.
We need ACLs even to do things like properly create buckets.
Instead, this version has ACL_HACK, which is just for testing purposes.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Sage Weil [Tue, 26 Apr 2011 19:10:12 +0000 (12:10 -0700)]
osd: add RWORDERED osd op flag
Order this op wrt reads the same way a read-modify-write would be.
(Otherwise we may get a fast/stale read result on a not-yet-complete
write.)
This fixes a problem where the Filer was marking a probe stat as a write
to get this same effect, but the OSD would EINVAL if it was a snapped
object (which happens in certain cases where the MDS is recovering the
file size of a snapped file).
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Sage Weil [Tue, 26 Apr 2011 17:35:03 +0000 (10:35 -0700)]
osd: move ObjectState side effects out of do_osd_ops
We want to be able to handle a failure mid-way through an OSDOp
transaction and bail out with no side effects. This patch
* puts an ObjectState new_obs in the OoContext that modifications go in
* only applies if it the transaction is a success
* only does make_writeable (at the end!) if the transaction is a success
There are still side effects with the watch/notify stuff, though.
Sage Weil [Mon, 25 Apr 2011 18:44:14 +0000 (11:44 -0700)]
mds: only move the journaler expire_pos forward
We were seeing weird trim errors because expire_pos was getting moved
backwards after a standby-replay -> replay transition. Make sure the two
places that update the expire_pos only move it forward--never backward.
Fixes: #1023 Signed-off-by: Sage Weil <sage@newdream.net>