Sage Weil [Mon, 23 Nov 2009 22:45:00 +0000 (14:45 -0800)]
mon: avoid mds state update when clearing laggy flag
Do not clear laggy flag (or otherwise get into prepare_update) if the mds
hasn't seen the latest map. Previously we could go to clear laggy and also
revert to an old mds state.
Sage Weil [Sat, 21 Nov 2009 05:42:04 +0000 (21:42 -0800)]
mds: do not eval subtree root during rename_prepare
The eval may lead to a scatter_writebehind, which screws up the journal
ordering. Since the inode is also locked, we will end up evaling it
later anyway, so don't worry about it.
I'm a bit unsure about the adjust_subtree_after_rename... that is during
the rename_apply stage (after the log entry committed), so i think it's
safe to do a scatter_writebehind here.. since we're not between a predirty
and submit_entry.
Sage Weil [Sat, 21 Nov 2009 00:20:02 +0000 (16:20 -0800)]
mds: fix client purge crash
set_state moves the session to the per-session lists; do
this _before_ remove_session (which removes the session
entirely). Otherwise we fail an assert when deleting
the session:
mds/SessionMap.h: In function 'virtual Session::~Session()':
mds/SessionMap.h:141: FAILED assert(!session_list_item.is_on_xlist())
1: ./cmds(_Z18__ceph_assert_failPKcS0_iS0_+0x36) [0x97fc87]
2: ./cmds(_ZN7SessionD0Ev+0x47) [0x73d817]
3: ./cmds(_ZN16RefCountedObject3putEv+0xdb) [0x712c3b]
4: ./cmds(_ZN10ConnectionD0Ev+0x3a) [0x713f88]
5: ./cmds(_ZN10Connection3putEv+0x3d) [0x71294b]
6: ./cmds(_ZN15SimpleMessenger4PipeD1Ev+0x7f) [0x7130e1]
7: ./cmds(_ZN15SimpleMessenger6reaperEv+0x228) [0x7048ba]
8: ./cmds(_ZN15SimpleMessenger4waitEv+0x28) [0x7059dc]
9: ./cmds(main+0x305) [0x6f9345]
10: /lib/libc.so.6(__libc_start_main+0xe6) [0x7f2091e715c6]
11: ./cmds [0x6f8e39]
NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.
Sage Weil [Fri, 20 Nov 2009 21:03:41 +0000 (13:03 -0800)]
mds: fix reconnect race
Don't ignore client replay or session msgs if we are
moving to reconnect state. The client may get the mdsmap
before us and send things our way, so take them if we
are reconnect, or if we want reconnect.
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.