Commit Graph

22752 Commits

Author SHA1 Message Date
Dan Mick
a55700cc0a librbd: hold AioCompletion lock while modifying global state
C_AioRead::finish needs to add in each chunk of a partial read
request to the 'partial' map in the AioCompletion's state
(in destriper, of type StripedReadResult).  That map is global
and must be protected from simultaneous access.  Use the
AioCompletion lock; could create a separate lock if contention is an
issue.

Fixes: #3567
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2012-12-05 17:05:18 -08:00
Dan Mick
41e16a3b40 librbd: handle parent change while async I/Os are in flight
During a test_librbd_fsx run including flatten, ImageCtx->parent
was being dereferenced while null.  Between the time the parent
overlap is calculated and the time the guard+write completes
with ENOENT and submits the copyup+write, the parent image
could have changed (by resize) or been made irrelevant (by
child flatten) such that the parent overlap is now incorrect.

Handle "no parent" by just sending the copyup+write; the copyup
part will be a no-op.  Move to WRITE_FLAT state in this case
because there's no more child to deal with.

Handle "overlap changed" by recalculating overlap before
reading parent data; if none is left, don't read, but rather
just clear m_object_image_extents, in which case the copyup
will again be a no-op because it will be of zero length.
However we still have a parent, so stay in WRITE_COPYUP state
and come back through as usual.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Fixes: #3524
2012-12-05 17:05:18 -08:00
Dan Mick
917a6f2963 Striper: use local variable inside if() that tested it
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2012-12-05 17:05:18 -08:00
Josh Durgin
2a5549cc0c qa: add script for running xfstests in a vm
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-12-05 15:54:49 -08:00
Samuel Just
a83d13a3b7 OSD: ignore queries on now deleted pools
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-12-05 11:33:26 -08:00
Greg Farnum
4cdc30b943 Merge remote-tracking branch 'origin/wip-mds' into next
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2012-12-04 16:48:19 -08:00
Sage Weil
3ef741ac2d Merge branch 'wip-filestore' into next
Reviewed-by: Sam Just <sam.just@inktank.com>
2012-12-04 15:05:18 -08:00
Sage Weil
f3bd3564fa Merge branch 'wip-msgr-delay-queue' into next 2012-12-04 14:52:22 -08:00
Yan, Zheng
727c37a712 mds: journal remote inode's projected parent
Server::_rename_prepare() adds remote inode's parent instead of
projected parent to the journal. So during journal replay, the
journal entry for the rename operation will wrongly revert the
remote inode's projected rename. This issue can be reproduced by:

 touch file1
 ln file1 file2
 rm file1
 mv file2 file3

After journal replay, file1 reappears and directory's fragstat
gets corrupted.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-04 14:50:14 -08:00
Yan, Zheng
3f69f7290d mds: don't create bloom filter for incomplete dir
Creating bloom filter for incomplete dir that was added by log
replay will confuse subsequent dir lookup and can create null
dentry for existing file. The erroneous null dentry confuses the
fragstat accounting and causes undeletable empty directory.

The fix is check if the dir is complete before creating the bloom
filter. For the MDCache::trim_non_auth{,_subtree} cases, just do
not call CDir::add_to_bloom because bloom filter is useless for
replica.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-04 14:50:11 -08:00
Samuel Just
0756052cff PG: remove last_epoch_started asserts in proc_primary_info
These asserts are valid for a uniform cluster, but they won't hold
for a replica running a version without the info.last_epoch_started
patch.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2012-12-04 11:41:05 -08:00
Yan, Zheng
2ba9c870b0 mds: journal remote inode's projected parent
Server::_rename_prepare() adds remote inode's parent instead of
projected parent to the journal. So during journal replay, the
journal entry for the rename operation will wrongly revert the
remote inode's projected rename. This issue can be reproduced by:

 touch file1
 ln file1 file2
 rm file1
 mv file2 file3

After journal replay, file1 reappears and directory's fragstat
gets corrupted.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-04 05:35:03 -08:00
Yan, Zheng
8cd8f2504a mds: don't create bloom filter for incomplete dir
Creating bloom filter for incomplete dir that was added by log
replay will confuse subsequent dir lookup and can create null
dentry for existing file. The erroneous null dentry confuses the
fragstat accounting and causes undeletable empty directory.

The fix is check if the dir is complete before creating the bloom
filter. For the MDCache::trim_non_auth{,_subtree} cases, just do
not call CDir::add_to_bloom because bloom filter is useless for
replica.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-04 05:29:13 -08:00
Sage Weil
8c2526a770 Merge remote-tracking branch 'gh/wip-mds' into next 2012-12-04 05:27:59 -08:00
Sage Weil
3ace9a7c66 logrotate: do not spam stdout
Avoid anything on stdout that will generate cron emails for people.

Reported-by: Stefan Priebe <s.priebe@profihost.ag>
Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-04 05:25:52 -08:00
Gary Lowell
2eee9e175e Merge branch 'master' of http://github.com/ceph/ceph 2012-12-03 21:31:14 -08:00
Gary Lowell
b5ec1c6766 Merge branch 'next' 2012-12-03 21:29:52 -08:00
John Wilkins
a74a4acf50 doc: Added a striping section for Architecture.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-12-03 20:48:02 -08:00
Gary Lowell
690f817560 v0.55 2012-12-03 19:08:35 -08:00
Gary Lowell
234cc081ab ceph.spec.in: Add SLES and remove Fedora from debug package list. 2012-12-03 19:06:42 -08:00
Sage Weil
595dd0ec60 Merge branch 'next' 2012-12-03 15:33:29 -08:00
Sage Weil
26045573e8 test_rados_api_misc: fix dup rmmkey test
We now expect ENONET as of 9961640f76
again.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-03 15:33:03 -08:00
John Wilkins
f2c7a60c90 doc: Fixed many hyperlinks, a few typos, and some minor clarifications.
fixes: #3564

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-12-03 12:22:37 -08:00
John Wilkins
a7a3cbf8fc doc: Clarified example for root user.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-12-03 10:48:10 -08:00
Sage Weil
5bea57bfd0 config: we still want osd_thread_recovery_timeout
Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-03 03:56:15 -08:00
Sam Lang
e686cb14e9 config: Remove unused options
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-12-03 03:44:36 -08:00
Sam Lang
6b105ae0b7 client: Fix ceph_mount() when subdir is specified
If a subdirectory is specified to ceph_mount, the
root inode does not have an ino of CEPH_INO_ROOT, so
cwd will fail to ever find root and eventially hits
an assertion in in->get_first_parent().  This fix uses
the inode stored in the root member instead, ensuring
that we stop wherever the mount is rooted.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-12-03 03:44:34 -08:00
Sage Weil
f57a79809c osd: EINVAL on unknown TMAP op code
The old/slow implementation did this, but the optimized version did
not.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-03 03:42:17 -08:00
Sage Weil
4870b43cab mds: use TMAP_RMSLOPPY op when removing dentries
After replay, we don't know if the dentry removal has already been
committed.  Use a sloppy removal so that we succeed even if we are
repeating the operation.

Conveniently, the previous implementation (pre v0.55) silently ignored
tmap op codes it did not understand, which means this new RMSLOPPY will
be interpreted the same as an actual RMSLOPPY.  That means an v0.55
mds can run against an older osd (say, argonaut) without problems.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-03 03:42:17 -08:00
Sage Weil
272e89d913 osd: add TMAP_RMSLOPPY op
Remove a key, but succeed if key already does not exist.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-03 03:42:17 -08:00
Sage Weil
9961640f76 osd: ENOENT on TMAP_RM on non-existent key
This reverts 29fae494d0 and fixes the
alternate implmentation added by 8e91d00b52.
librbd relies the ENOENT return value.

Reported-by: Dan Mick <dan.mick@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-03 03:42:17 -08:00
Sage Weil
85574a3622 os/JournalingObjectStore: applied_seq -> max_applied_seq
Rename applied_seq to max_applied_seq, since it is a bound; there may be
seq's < max_applied_seq that are not applied.  This aligns the naming with
max_applying_seq.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-02 14:30:33 -08:00
Sage Weil
528108485b os/FileStore: only wait for applying ops to complete before commit
We can have a large number of operations in the op_wq waiting to be applied
to the fs.  Currently, when we want to commit, we want for them *all* to
apply.  This can take a very long time (the default queue length is 500
operations!).

Instead, mark an Op as started ("applying") when the thread pool actually
starts to apply it.  At that point, only wait for applying ops to complete.
We let any threads with an op seq < max_applying_seq begin as well so that
we have a proper ordering/barrier.  When those flush, applied_seq will ==
max_applying_seq, and that becomes the committing_seq value.

Note that 'applied_seq' is still maintain, but serves no real purpose
except to populate our asserts with sanity checks.  max_applying_seq serves
the purpose applied_seq used to.

This removes once unnecessary source of latency associated with fs
commits.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-02 14:30:32 -08:00
Sage Weil
c10958e4fb osd: fix RepModify when past last_peering_reset
If we apply or commit a RepModify from a prevous perring interval, we need
to free it.

This fixes 'slow request' messages when in fact clients requests are not
delayed, and plugs the related memory leak.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-01 22:41:27 -08:00
Yehuda Sadeh
2d0cfce8bd Merge remote-tracking branch 'origin/wip-coverity' 2012-12-01 19:32:07 -08:00
Sage Weil
fab0976d16 Merge remote-tracking branch 'gh/next' 2012-12-01 18:23:02 -08:00
Sage Weil
880a185625 OutputDataSocket: fix uninit var
CID 745933 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "data_size" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-01 16:57:00 -08:00
Sage Weil
3a064dcfb7 rgw: fix uninit var
CID 745935 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "expiration" is not initialized in this constructor nor in any functions that it calls.

At (2): Non-static class member "min_len" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member "max_len" is not initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member "ret" is not initialized in this constructor nor in any functions that it calls.
At (8): Non-static class member "len" is not initialized in this constructor nor in any functions that it calls.
At (10): Non-static class member "ofs" is not initialized in this constructor nor in any functions that it calls.
At (12): Non-static class member "supplied_md5_b64" is not initialized in this constructor nor in any functions that it calls.
At (14): Non-static class member "supplied_etag" is not initialized in this constructor nor in any functions that it calls.
CID 745934 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
At (16): Non-static class member "data_pending" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-01 16:57:00 -08:00
Sage Weil
648c7f0cec test/osdc/FakeWriteback: fix uninit var
CID 745936 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "m_off" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-01 16:56:50 -08:00
Sage Weil
0dac9e69e3 osd: fix missing unlock; simplify
Instead of a special-case exit, just skip the con replacement.  Continue
on to mark the old con down.

CID 745920 (#1 of 1): Missing unlock (LOCK)
At (8): Returning without unlocking "this->heartbeat_lock._m".

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-01 16:56:48 -08:00
Yan, Zheng
0fa487585e mds: fix freeze inode deadlock
CInode::freeze_inode() is used in the case of cross authority rename.
Server::handle_slave_rename_prep() calls it to wait for all other
operations on source inode to complete. This happens after all locks
for the rename operation are acquired. But to acquire locks, we need
auth pin locks' parent objects first. So there is an ABBA deadlock
if someone auth pins the source inode after locks for rename are
acquired and before Server::handle_slave_rename_prep() is called.
The fix is freeze and auth pin the source inode at the same time.

This patch introduces CInode::freeze_auth_pin(), it waits for all
other MDRequests to release auth pins, then change the inode to
FROZENAUTHPIN state, this state prevents other MDRequests from
getting new auth pins.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-01 12:52:23 -08:00
Yan, Zheng
2a5068944e mds: use rdlock_try() when checking NULL dentry
Use rdlock_try() instead can_read() when path_traverse encounters
a NULL dentry. This can partly avoid infinitely waiting for the
dentry to become readable when the dentry is replica.

Strictly speaking, use rdlock_try() is still enough because auth
MDS may drop the REQRDLOCK message in some cases.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-01 12:52:23 -08:00
Yan, Zheng
1203cd2110 mds: allow open_remote_ino() to open xlocked dentry
discover_ino() has a parameter want_xlocked. The parameter indicates
if remote discover handler can proceed when xlocked dentry is
encountered. open_remote_ino() uses discover_ino() to find non-auth
inode, but always set 'want_xlocked' to false. This may cause
dead lock in some corner cases. For example:

we rename a inode's primary dentry to one of its remote dentry and
send slave request to one witness MDS. but before the slave request
reaches the witness MDS, the inode is trimmed from the witness MDS'
cache. Then when the slave request arrives, open_remote_ino() will
be called during traversing the destpath. open_remote_ino() calls
discover_ino() with 'want_xlocled=false' to find the inode.
discover_ino() sends MDiscover message to the inode's authority MDS.
The handler of MDiscover message finds the inode's primary dentry
is xlocked and it sleeps.

The fix is add a parameter 'want_xlocked' to open_remote_ino() and
make open_remote_ino() pass the parameter to discover_ino().

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-01 12:52:23 -08:00
Yan, Zheng
587aec1706 mds: fix assertion in handle_cache_expire
During export, it's possible to get cache expire messages in
DISCOVERING, FREEZING and PREPPING state.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-01 12:52:23 -08:00
Yan, Zheng
961bc0c936 mds: fix open_remote_inode race
discover_ino() may return -ENOENT if it races with other FS activities.
so use C_MDC_RetryOpenRemoteIno instead of C_MDC_OpenRemoteIno as
onfinish callback.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-01 12:52:23 -08:00
Yan, Zheng
3fa2582b0b mds: consider revoking caps in imported caps as issued
The clients may already send caps release message to the exporting
MDS, so the importing MDS waits for the release message forever.
consider revoking caps as issued can avoid this issue.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-01 12:52:23 -08:00
Yan, Zheng
4cd8ea927e mds: drop locks if requiring auth pinning new objects.
Locker::acquire_locks() skip auth pinning replica object if we only
request a rdlock and the lock is read-lockable. To get all locks,
we may call Locker::acquire_locks() several times, locks in replca
objects may become not read-lockable between calls. So it is
possible we need auth pin new objects after already take some locks.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-01 12:52:22 -08:00
Yan, Zheng
9bfe540c65 mds: don't forward client request from MDS
Forwarding client request that was from MDS will trigger assertion
in MDS::forward_message_mds(). MDS only send client requests for
stray migration/reintegration, so it's safe to drop them.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-01 12:52:22 -08:00
Yan, Zheng
8f674899a8 mds: call eval() after caps are exported
For an inode just changed authority, if the new auth MDS want to
change a lock in the inode from 'sync' to 'lock' state before caps
are exported. The lock in replica can be in 'sync->lock' state
because client caps prevent it from transitting to 'lock' state.
So we should call eval() after clearing client caps.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-01 12:52:22 -08:00
Yan, Zheng
ff170ecfe2 mds: clear lock flushed if replica is waiting for AC_LOCKFLUSHED
So eval_gather() will not skip calling scatter_writebehind(),
otherwise the replica lock may be in flushing state forever.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-01 12:52:22 -08:00