Commit Graph

22769 Commits

Author SHA1 Message Date
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
Yan, Zheng
946b263c10 mds: Don't acquire replica object's versionlock
Both CInode and CDentry's versionlocks are of type LocalLock.
Acquiring LocalLock in replica object is useless and problematic.
For example, if two requests try acquiring a replica object's
versionlock, the first request succeeds, the second request
is added to wait queue. Later when the first request finishes,
MDCache::request_drop_foreign_locks() finds the lock's parent is
non-auth, it skips waking requests in the wait queue. So the
second request hangs.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-01 12:52:22 -08:00
Yan, Zheng
5620f3d0bf mds: allow try_eval to eval unstable locks in freezing object
Unstable locks hold auth_pins on the object, it prevents the freezing
object become frozen and then unfreeze. So try_eval() should not wait
for freezing object

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-12-01 12:52:21 -08:00
Sage Weil
8dcc6c399c msg/Pipe: flush delayed messages when stealing/failing pipes
If we are failing a pipe, flush the incoming messages before we try to
reconnect.  Similarly, flush queued messages on an existing pipe beore we
replace it.  This ensures that when we get a socket failure and reconnect
the delayed messages are handled in the normal fashion.

Specifically, it fixes a situation like:

 - read msg, update in_seq etc.
 - delay msg
 - pipe faults
 - peer reconnects, we replace existing pipe, discard delayed msgs
 - peer resends msgs
 - we discard, because they are < in_seq

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-01 12:45:22 -08:00
Dan Mick
7794de61b5 rbd: report striping as a feature in rbd info
Fixes: #3549
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2012-11-30 23:14:05 -08:00
Samuel Just
dccf6ee4d5 ceph-osd: put g_ceph_context before exit
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-11-30 20:57:04 -08:00
Samuel Just
49f32cee64 ReplicatedPG: only increment active_scrub on primary for final push
We only queue the _applied_recovered_object callback on the primary for the
final push.  It is this callback which decrements active_pushes.  It's ok to
not increment active_pushes for the intermediate pushes since these only affact
a temp file.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-11-30 14:04:53 -08:00
Sage Weil
246eb7b2af Merge remote-tracking branch 'gh/wip-osd-msgr' 2012-11-30 12:12:23 -08:00
Samuel Just
a928b6dbf6 OSDService: make messengers private
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-11-30 11:20:41 -08:00
Samuel Just
47699f39b9 osd/: make OSDService messenger helpers return ConnectionRef
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-11-30 11:08:55 -08:00
Joao Eduardo Luis
494711e6c9 mon: PaxosService: cancel proposal timer after election
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2012-11-30 09:37:07 -08:00
Sage Weil
7412bd3675 Merge remote-tracking branch 'gh/wip-mds-ls2'
Reviewed-by: Greg Farnum <greg@inktank.com>
2012-11-30 08:26:25 -08:00
Sage Weil
9cd730bd50 doc: update kernel recs
Mention which stable kernels we recommend.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-30 08:22:00 -08:00
David Zafman
dc93132d8c logrotate: fix rotation
Fixes: #3554
Always reload with Upstart because in some configs the init.d script doesn't work

Signed-off-by: David Zafman <david.zafman@inktank.com>
2012-11-29 18:18:13 -08:00
Sage Weil
909b92e812 mds: assert segements not emtpy in get_current_segment()
Only one caller can tolerate no segments; make a new
peek_current_segment() for them.

Motivated by paranoia tracking down a crash during client unmount, but
it wasn't this.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 17:21:52 -08:00
Sage Weil
f0c2920e02 mds: be explicit about MDRequest killed state
Set the killed flag and use that instead of inferring things from
the session xlist.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 17:21:45 -08:00
Sage Weil
41ef9bbbe8 mds: drop redundant mdr->committing = true
journal_and_reply() does this.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 17:20:27 -08:00
Sage Weil
44bc687d98 mds: fix request_kill()
Only request_cleanup() if the request isn't already committing.  If it
is, wait for it to commit before we clean up.

It might fix all of #3531, #3210, #1947, and #1548.  Maybe.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 17:20:16 -08:00
Sage Weil
0ffafb3106 Revert "osd: fix leak of heartbeat con on reset"
This reverts commit b31a99abda.
2012-11-29 17:03:30 -08:00
Sage Weil
abd9e36c5d client: only dump cache on umount if we time out
We don't want to dump the cache every time an item is trimmed and the
mount_cond gets signaled; this can make umount crazy-slow when logging is
turned up.

Instead, only dump if we wait 5 seconds without making any progress on
shrinking the cache.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 16:47:26 -08:00
Sage Weil
6d65fa4ef9 msg/Pipe: release dispatch throttle on delayed queue discard
This avoids leaking into the throttle and deadlocking.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 16:09:45 -08:00
Sage Weil
158260b6ae msg/Pipe: start delay thread *after* we know peer type
At end of connect(), or end of accept().

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 16:09:45 -08:00
Sage Weil
f0bf616878 msg/Pipe: drop queue helpers
There is a single caller; these only obfuscate.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 16:09:45 -08:00
Sage Weil
f454bb591d msg/Pipe: refactor msgr delays
- move all delay state into a single class
- create thread once and only once per Pipe
- adjust debug levels
- discard messages at the appropriate times

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 16:09:45 -08:00
Greg Farnum
b97aaca387 msgr: add a delay_until queue that is used to delay deliveries.
Its life-cycle matches that of delay_queue, and the delayed_delivery
function respects it. For now queue_received is just setting it to
delay everything by 1 second.

Signed-off-by: Greg Farnum <greg@inktank.com>
2012-11-29 16:09:45 -08:00
Greg Farnum
01059e9b43 msgr: clear out the delay queue when stop()ing
After some brief thought, I believe deleting any messages in the
delay queue is correct -- we are trying to simulate line delays
in delivery and so anything still in the queue has supposedly
not arrived yet. So delete them when we stop the Pipe for
any reason.

Signed-off-by: Greg Farnum <greg@inktank.com>
2012-11-29 16:09:44 -08:00
Greg Farnum
0e92f89204 msgr: move the delay queue initialization into start_reader
The Pipe doesn't know the peer type in the constructor. It
doesn't always know in start_reader either, so this needs more work,
but at least it knows more frequently than it did.

Signed-off-by: Greg Farnum <greg@inktank.com>
2012-11-29 16:09:44 -08:00
Greg Farnum
90f66980bf messenger: add the shell of a system to delay incoming Message delivery
When ms_inject_delay_type matches that of the incoming Connection,
the Pipe sets up a delay queue that it shuttles all Messages through.
This lets us check cleanup and some notification code but doesn't
actually generate any delays.

Signed-off-by: Greg Farnum <greg@inktank.com>
2012-11-29 16:09:44 -08:00
Yehuda Sadeh
bea3ecf074 rgw: treat lack of swift token as anonymous user access
Fixes: 3534
If a swift token hasn't been provided, set user as anonymous.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-11-29 16:06:11 -08:00
Sage Weil
c26dc1885d Merge branch 'next'
Conflicts:
	src/rgw/rgw_admin.cc
2012-11-29 15:48:54 -08:00
Sage Weil
77711ddee3 Merge remote-tracking branch 'gh/wip_next_bugs' into next 2012-11-29 15:47:26 -08:00
Sage Weil
ef39773c18 Merge remote-tracking branch 'gh/wip-mon-osd-create-fix' into next 2012-11-29 15:34:32 -08:00
Yehuda Sadeh
6a69083dce radosgw-admin: close storage before exit
Fixes: #3560
This will remove watches off notification objects.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-11-29 15:33:22 -08:00
Sage Weil
774d5bf14c osd: move next_osdmap under separate lock
It doesn't actually interfere with publish_lock, and the current osdmap
ref.

Document what is going on.

Always preceed publish_map() with one or more pre_publish_map() calls.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 15:15:31 -08:00