Commit Graph

34770 Commits

Author SHA1 Message Date
Sage Weil
2c28548e5d msgr: remove Messenger::mark_disposable()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:37:07 -07:00
Sage Weil
8b49b3a3d1 mds: use Connection::mark_disposable()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:37:07 -07:00
Sage Weil
2970396d46 msgr: add Connection::mark_disposable()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:37:07 -07:00
Sage Weil
3ca533e4f8 msgr: kill mark_down_on_empty()
No users!

Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:37:07 -07:00
Sage Weil
637ada2da9 msgr: kill addr-based send_keepalive()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:37:06 -07:00
Sage Weil
322908b952 msg: drop Messenger::mark_down() and send_keepalive() con-based calls
All users must stick to the Connection-based calls.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:37:06 -07:00
Sage Weil
f04810251d osdc/Objecter: use Connection::mark_down()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:37:06 -07:00
Sage Weil
841d5ac836 osd: use Connection::mark_down()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:37:06 -07:00
Sage Weil
774481bb1f mon/MonClient: use Connection::send_keepalive()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:37:06 -07:00
Sage Weil
c42922acea mon/MonClient: use Connection::mark_down()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:37:06 -07:00
Sage Weil
92c46a7d29 mon: use Connection::mark_down()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:37:06 -07:00
Sage Weil
54eca56695 mds: use Connection::mark_down()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:07 -07:00
Sage Weil
d60e8a2d28 client: use Connection::mark_down()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:07 -07:00
Sage Weil
f0fef0777b mon: use send_message instead of lazy_send_message
We only use this for sending things to non-mons, and all of those Policy's
are server, so we will never initiate a connection.  This duplicates the
'lazy' semantics we were after.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:06 -07:00
Sage Weil
e184ef8e97 msgr: remove Messsenger::send_message(..., Connection*)
Instead, make the Connection method pure virtual and implement it in the
PipeConnection specialization (which is specific to SimpleMessenger).

Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:06 -07:00
Sage Weil
2bb9ab23ce osdc/Objecter: use Connection::send_message()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:06 -07:00
Sage Weil
05bf6cf978 mds: use Connection::send_message()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:06 -07:00
Sage Weil
aeee097726 client: use Connection::send_message()
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:06 -07:00
Sage Weil
f413bc8639 mon: use Connection::send_message()
At least in the obvious places.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:06 -07:00
Sage Weil
3d57e39c80 osd: use Connection::send_message
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:06 -07:00
Sage Weil
531073f82e msgr: add convenience Connection methods
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:06 -07:00
Sage Weil
afb4c37fc2 msg: factor policy handling out of SimpleMessenger
Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:06 -07:00
Sage Weil
6597c2080a mon: clean up ref counting for forwarded messages' sessions
Carry the refs across the duration of the session.  Explicitly pass
ownership to the MonSession.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:06 -07:00
Sage Weil
29e04c8502 msgr: move PipeConnection out of Connection.h; make anon
Remove last reference to PipeConnection outside of SimpleeMessenger by
creating a create_anon_connection() method for Messenger.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-07-24 11:33:06 -07:00
Matt Benjamin
ea14d7b6d6 Refactor Messenger class family.
In preparation for XioMessenger and other new transports,
reorganize Messenger class family to remove SimpleMessenger
details the interface.

This change moves Connection to its own header, and moves Pipe
details to a new PipeConnection descdendant class, among other
changes.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
2014-07-24 11:26:55 -07:00
Sage Weil
63abf11390 osd/ReplicatedPG: observe INCOMPLETE_CLONES in is_present_clone()
We cannot assume that just because cache_mode is NONE that we will have
all clones present; check for the absense of the INCOMPLETE_CLONES flag
here too.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-24 10:07:33 -07:00
Sage Weil
41364711a6 osd/ReplicatedPG: observed INCOMPLETE_CLONES when doing clone subsets
During recovery, we can clone subsets if we know that all clones will be
present.  We skip this on caching pools because they may not be; do the
same when INCOMPLETE_CLONES is set.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-24 10:07:33 -07:00
Sage Weil
956f28721d osd/ReplicatedPG: do not complain about missing clones when INCOMPLETE_CLONES is set
When scrubbing, do not complain about missing cloens when we are in a
caching mode *or* when the INCOMPLETE_CLONES flag is set.  Both are
indicators that we may be missing clones and that that is okay.

Fixes: #8882
Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-24 10:07:33 -07:00
Sage Weil
54bf055c5d osd/osd_types: add pg_pool_t FLAG_COMPLETE_CLONES
Set a flag on the pg_pool_t when we change cache_mode NONE.  This
is because object promotion may promote heads without all of the clones,
and when we switch the cache_mode back those objects may remain.  Do
this on any cache_mode change (to or from NONE) to capture legacy
pools that were set up before this flag existed.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-24 10:06:55 -07:00
Sage Weil
67d13d76f5 mon/OSDMonitor: improve no-op cache_mode set check
If we have a pending pool value but the cache_mode hasn't changed, this is
still a no-op (and we don't need to block).

Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-24 10:06:54 -07:00
Sage Weil
7d137430aa Merge remote-tracking branch 'gh/next' 2014-07-23 19:14:52 -07:00
Sage Weil
f9e885b990 Merge pull request #2127 from ceph/wip-8701
filestore: fix collection_move behavior

Reviewed-by: Greg Farnum <greg@inktank.com>
2014-07-23 19:13:55 -07:00
Sage Weil
c757fbdd7b Merge pull request #2140 from ceph/wip-8889
osd: greedily get obc write lock in some cases

Reviewed-by: Greg Farnum <greg@inktank.com>
2014-07-23 19:13:11 -07:00
Sage Weil
d4faf747b7 ceph_test_objectstore: clean up on finish of MoveRename
Otherwise, we leave collections around, and the next test fails.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-23 14:48:14 -07:00
Sage Weil
3ec9a42b47 os/LFNIndex: use FDCloser for fsync_dir
This prevents an fd leak when maybe_inject_failure() throws an exception.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-23 14:48:14 -07:00
Sage Weil
6fb3260d59 os/LFNIndex: only consider alt xattr if nlink > 1
If we are doing a lookup, the main xattr fails, we'll check if there is an
alt xattr.  If it exists, but the nlink on the inode is only 1, we will
kill the xattr.  This cleans up the mess left over by an incomplete
lfn_unlink operation.

This resolves the problem with an lfn_link to a second long name that
hashes to the same short_name: we will ignore the old name the moment the
old link goes away.

Fixes: #8701
Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-23 14:48:14 -07:00
Sage Weil
ec36f0a130 os/LFNIndex: remove alt xattr after unlink
After we unlink, if the nlink on the inode is still non-zero, remove the
alt xattr.  We can *only* do this after the rename or unlink operation
because we don't want to leave a file system link in place without the
matching xattr; hence the fsync_dir() call.

Note that this might leak an alt xattr if we happen to fail after the
rename/unlink but before the removexattr is committed.  We'll fix that
next.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-23 14:48:14 -07:00
Sage Weil
a320c260a9 os/LFNIndex: FDCloser helper
Add a helper to close fd's when we leave scope.  This is important when
injecting failures by throwing exceptions.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-23 14:48:14 -07:00
Sage Weil
b2cdfce646 os/LFNIndex: handle long object names with multiple links (i.e., rename)
When we rename an object (collection_move_rename) to a different name, and
the name is long, we run into problems because the lfn xattr can only track
a single long name linking to the inode.  For example, suppose we have

foobar -> foo_123_0 (attr: foobar) where foobar hashes to 123.

At first, collection_add could only link a file to another file in a
different collection with the same name. Allowing collection_move_rename
to rename the file, however, means that we have to convert:

col1/foobar -> foo_123_0 (attr: foobar)

to

col1/foobaz -> foo_234_0 (attr: foobaz)

This is a problem because if we link, reset xattr, unlink we end up with

col1/foobar -> foo_123_0 (attr: foobaz)

if we restart after we reset the attr.  This will cause the initial foobar
lookup to since the attr doesn't match, and the file won't be able to be
looked up.

Fix this by allow *two* (long) names to link to the same inode.  If we
lfn_link a second (different) name, move the previous name to the "alt"
xattr and set the new name.  (This works because link is always followed
by unlink.)  On lookup, check either xattr.

Don't even bother to remove the alt xattr on unlink.  This works as long
as the old name and new name don't hash to the same shortname and end up
in the same LFN chain.  (Don't worry, we'll fix that next.)

Fixes part of #8701
Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-23 14:48:14 -07:00
Sage Weil
cf98805c09 ceph_test_objectstore: fix warning
Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-23 14:48:14 -07:00
Samuel Just
6aa48a485e store_test: add long name collection_move_rename tests
Currently fails.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2014-07-23 14:48:14 -07:00
Dan Mick
c0cb56f6c8 ceph.spec.in: add bash completion file for radosgw-admin
Signed-off-by: Sandon Van Ness <sandon@inktank.com>
(cherry picked from commit b700963071)
2014-07-23 13:32:00 -07:00
Dan Mick
1ad4cd386e ceph.spec.in: rhel7-related changes:
udev rules: /lib -> /usr/lib
/sbin binaries move to /usr/sbin or %{_sbindir}

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
(cherry picked from commit 235e4c7de8)
2014-07-23 13:31:53 -07:00
Dan Mick
c57811fc4b Fix/add missing dependencies:
- rbd-fuse depends on librados2/librbd1
- ceph-devel depends on specific releases of libs and libcephfs_jni1
- librbd1 depends on librados2
- python-ceph does not depend on libcephfs1

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
(cherry picked from commit 7cf8132239)
2014-07-23 13:31:47 -07:00
Dan Mick
793e05a27a ceph.spec.in: whitespace fixes
Signed-off-by: Sandon Van Ness <sandon@inktank.com>
(cherry picked from commit ec8af52a5e)
2014-07-23 13:31:39 -07:00
Dan Mick
dae6ecbc31 ceph.spec.in: split out ceph-common as in Debian
Move files, postun scriptlet, and add dependencies on ceph-common
where appropriate

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
(cherry picked from commit e131b9d5a5)
2014-07-23 13:31:22 -07:00
Sage Weil
a05a0da3b1 common/random_cache: fix typo
Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-23 10:11:59 -07:00
Sage Weil
54ea5c13ac Merge pull request #2136 from yuyuyu101/fix-randomcache
common/RandomCache: Fix inconsistence between contents and count

Reviewed-by: Sage Weil <sage@redhat.com>
2014-07-23 09:57:59 -07:00
Haomai Wang
5efdc6236c common/RandomCache: Fix inconsistence between contents and count
The add/clear method may cause count inconsistent with the real size of
contents.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2014-07-23 11:31:46 +08:00
Sage Weil
356af4bf46 osd/ReplicatedPG: debug obc locks
Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-22 18:01:14 -07:00