Sage Weil [Wed, 12 May 2010 04:14:39 +0000 (21:14 -0700)]
msgr: tolerate incoming seq #'s that skip ahead
This is necessary because the kclient may pull messages out of the out/sent
queues, and we can't renumber previously sent (and possibly received)
messages without breaking things entirely.
Sage Weil [Fri, 7 May 2010 21:33:42 +0000 (14:33 -0700)]
types: standardize on uint64_t
The problem is that on some platforms __u64 == uint64_t (x86_64), and on
others it's doesn't (ppc64). Which means we don't know whether to define
different versions of overloaded functions for both types or just one.
So, standardize on uint64_t. This plays nicer with STL, which defines
hash<uint64_t> on 64 bit arches but not 32 bit. Which means we can't
standarzie on __u64 or else hash<__u64> won't work. Bah!
Sage Weil [Fri, 7 May 2010 20:45:00 +0000 (13:45 -0700)]
endian: simplify __le* type hackery
Instead of preventing linux/types.h from being included, instead name
our types ceph_le*, and remap using #define _only_ when including the
shared kernel/userspace headers.
Also redefine some templates for both __u64 and uint64_t, which are
apparently not the same on x86_64.
Sage Weil [Fri, 7 May 2010 18:53:03 +0000 (11:53 -0700)]
osd: remove bad assert in get_object_context()
This has always been fishy, and it's original purpose isn't quite clear.
The '!obc->obs.ssc' is clearly the create case, but the head_exists check
is only the case if we are getting the context for a _head, which in
many cases we're not. In parituclarly, it fails for a snapped object
where the head doesn't exist. We _do_ have teh ssc (from the _snapdir
object) but there is no head.
Just remove the assert entirely.. it's not clear what it's really catching.
Sage Weil [Fri, 7 May 2010 18:58:16 +0000 (11:58 -0700)]
mds: always release snap cap after flushsnap
The old condition makes no sense. It appears to have been broken since
2008, commit a5d5e679? Yikes.
The problem is that a flushsnap will 'release' the caps, but still leave
an open Capability on the CInode. Then, CInode::encode_inodestat() would
& issued() when issuing caps, and a client ceph_open() would get no
caps. The kclient is fixed up to at least not crash in that case, but even
with the fix it deadlocked.
Sage Weil [Mon, 3 May 2010 22:04:16 +0000 (15:04 -0700)]
mds: acquire anchor_create locks in caller
We're not allowed to call acquire_locks again once we've completed locking.
Do it in the caller. Add a helper that will also take an rdlock to ensure
the anchor doesn't go away due to a racing operation.
Sage Weil [Mon, 3 May 2010 21:00:28 +0000 (14:00 -0700)]
mds: fix lock->sync rdlock rule
Observed symptom was touch foo on one node, and missing from ls on another
node.
Since auth rdlock isn't allowed for LOCk, it clearly shouldn't be for
LOCK->SYNC while e.g. wrlock modifications are still being flushed to the
journal and aren't yet applied.
Sage Weil [Fri, 30 Apr 2010 18:05:39 +0000 (11:05 -0700)]
mds: fix trim_dentry on dentry under unlinked dir
We can get a dentry that is trimmable (e.g. null) under a new unlinked dir,
which has no subtree. This will only happen on the auth. In that case,
having no container is harmless--it's only needed for replicas.
This fixes the following crash:
mds/MDCache.cc: In function 'void MDCache::trim_dentry(CDentry*, std::map<int, MCacheExpire*, std::less<int>, std::allocator<std::pair<const int, MCacheExpire*> > >&)':
mds/MDCache.cc:4797: FAILED assert(con)
1: (MDCache::trim(int)+0x214) [0x4ffbc4]
2: (MDS::tick()+0x4c1) [0x48f3b1]
3: (SafeTimer::EventWrapper::finish(int)+0x269) [0x683a89]
4: (Timer::timer_entry()+0x819) [0x685909]
5: (Timer::TimerThread::entry()+0xd) [0x47528d]
6: (Thread::_entry_func(void*)+0x7) [0x48a8a7]
7: /lib/libpthread.so.0 [0x7ffe62356fc7]
8: (clone()+0x6d) [0x7ffe615835ad]
NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.
Sage Weil [Fri, 30 Apr 2010 17:46:17 +0000 (10:46 -0700)]
osd: fix pg_to_acting_osds() calculation to consider pg_temp
The OSD was using pg_to_up_acting, the client uses pg_to_acting, and their
calculations of 'acting' weren't consistent because the latter did not
consider pg_temp.
Sage Weil [Fri, 30 Apr 2010 18:05:39 +0000 (11:05 -0700)]
mds: fix trim_dentry on dentry under unlinked dir
We can get a dentry that is trimmable (e.g. null) under a new unlinked dir,
which has no subtree. This will only happen on the auth. In that case,
having no container is harmless--it's only needed for replicas.
This fixes the following crash:
mds/MDCache.cc: In function 'void MDCache::trim_dentry(CDentry*, std::map<int, MCacheExpire*, std::less<int>, std::allocator<std::pair<const int, MCacheExpire*> > >&)':
mds/MDCache.cc:4797: FAILED assert(con)
1: (MDCache::trim(int)+0x214) [0x4ffbc4]
2: (MDS::tick()+0x4c1) [0x48f3b1]
3: (SafeTimer::EventWrapper::finish(int)+0x269) [0x683a89]
4: (Timer::timer_entry()+0x819) [0x685909]
5: (Timer::TimerThread::entry()+0xd) [0x47528d]
6: (Thread::_entry_func(void*)+0x7) [0x48a8a7]
7: /lib/libpthread.so.0 [0x7ffe62356fc7]
8: (clone()+0x6d) [0x7ffe615835ad]
NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.
Sage Weil [Fri, 30 Apr 2010 17:46:17 +0000 (10:46 -0700)]
osd: fix pg_to_acting_osds() calculation to consider pg_temp
The OSD was using pg_to_up_acting, the client uses pg_to_acting, and their
calculations of 'acting' weren't consistent because the latter did not
consider pg_temp.
Sage Weil [Thu, 29 Apr 2010 17:27:02 +0000 (10:27 -0700)]
mon: m->get_session() may return null if session has closed
because the session close clears connection->priv. We need to check at
each site anyway, either for null session, or for session->closed. So
check for null session.
Sage Weil [Thu, 29 Apr 2010 17:22:13 +0000 (10:22 -0700)]
mon: m->get_session() may return null if session has closed
because the session close clears connection->priv. We need to check at
each site anyway, either for null session, or for session->closed. So
check for null session.