Sage Weil [Wed, 18 Nov 2009 00:26:33 +0000 (16:26 -0800)]
osd: eval access mode before try_*
The problem is the try_* functions may change the mode, but a start_write
may not follow if the op doesn't execute (for any number of reasons). So
the next time we come around, we may need to reset back to IDLE if
num_wr == 0. Be careful about the wake flag.
This fixes osd op hangs (particularly after mds restart, and lots of
failed stats on objects during file size/mtime recovery).
Sage Weil [Wed, 18 Nov 2009 00:30:36 +0000 (16:30 -0800)]
msgr: fix possible use-after-free by taking pipe lock during reap
This ensures that whoever called stop() (mark_down, in particular) finished
with the pipe (unlocked it) before we go and free it. Otherwise we might
call p->lock.Unlock() after the reaper deleted the Pipe, mucking up some
other memory.
I don't think this was actually triggerd, tho, since we would have seen
the assert(nlock == 0) in ~Mutex???
Sage Weil [Fri, 13 Nov 2009 23:06:31 +0000 (15:06 -0800)]
mds: journal open_files based on is_any_caps_wanted(), not is_any_caps()
Actually we're a bit conservative in a few places since the wanted check
is a bit more expensive. We always do a full check in try_to_expire, so
much of the time we can do the quick check only.
Sage Weil [Fri, 13 Nov 2009 22:57:39 +0000 (14:57 -0800)]
mds: don't rejournal files with caps that are unwanted
If they're unwanted, it's no biggie to fail to reconnect the cap. And
Locker::adjust_cap_wanted() already adjusts the open_file logseg lists in
this way, so let's just totally consistent.
Sage Weil [Fri, 13 Nov 2009 22:44:22 +0000 (14:44 -0800)]
mds: don't croak on open_files without caps
We can get a capless inode here if we replay an open file, the client
fails to reconnect it, but does REPLAY an open request (that adds it
to the logseg). AFAICS it's ok for the client to replay an open on a
file it doesn't have in it's cache anymore.
Sage Weil [Thu, 12 Nov 2009 22:54:22 +0000 (14:54 -0800)]
mds: recommit after commit if waiting for newer version
If there are waiters for a later version of the dir to hit
disk, then we need to recommit as soon as the prior commit
completes. We auth_pin on adding the first waiter, and do
not unpin until removing the last waiter, so this doesn't
break auth_pin rules.
Previously we could stall because we didn't finish the
waiter (on the later version) but also never started the
commit. Sometimes we would get lucky and someone else would
ask for a commit, but sometimes not. We would then see old
LogSegments that would never get fully expired.
Sage Weil [Wed, 11 Nov 2009 23:47:28 +0000 (15:47 -0800)]
mds: force rdlock on any snapped inodes
When the client has an excl lock on an inode, and it's
stating a snapped version of it, we can't expect it to
put 2 and 2 together and look at it's head metadata. If
the cap does not follow the snapid we're trying to stat, do
the full rdlock to force the snapped values back to the
mds so we can do the cow.
If there is nothing cow, the cap will get reissued with an
accurate follows value, and we won't have to do this again.
Sage Weil [Wed, 11 Nov 2009 00:26:44 +0000 (16:26 -0800)]
mds: underwater is function of _loaded_ version, not in core version
We may load a dir version off disk that is older than the
in-core version (because we got newer data from the
journal, say). When marking underwater items clean, do
so based on the _loaded_ version, not out in-core version.
Sage Weil [Tue, 10 Nov 2009 22:51:20 +0000 (14:51 -0800)]
osd: do not apply_transaction in finish_recovery
finish_recovery needs to set up a callback for when the current set of
changes commit to disk (to kickstart cleanup of strya replicas etc). We
can't call apply_transaction this deep inside the call chain without
causing problems. So, pass a list of completion contexts all the way down
so that we can set up the completion callback.
Sage Weil [Tue, 10 Nov 2009 05:31:51 +0000 (21:31 -0800)]
mon: ignore MAuth message when connection has no session
This happens if hte message is delayed, and the session meanwhile
is closed. We need similar checks any time we take a Session
from the message->get_connection()....