test_stress_watch: remove bogus asserts

There's no reason to check the duration of a watch. The notify will
timeout after 30s on the OSD, but there's no guarantee the client will
see that in any bounded time. This test is really meant as a stress
test of the OSDs anyway, not of the clients, so just remove asserts
about operation duration.

Fixes: #4591
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
mds: fix session_info_t decoding

commit 0bcf2ac081 changes session_info_t's format, but there is
a typo in the code that decodes old format. We also need to
handle struct_v == 1, which had the same encoding but without
the size guards (which is all handled by DECODE_START_LEGACY_COMPAT).

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
Journal: pass the sequence number to commit_start

A subsequent patch will need to see the committing seq.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Journal: commits may not include all journaled seqs

At one point, a commit had to drain the FileStore op
queue.  This is no longer the case.  Consequently, the
journal may have to wait more than one commit for the
filestore to create a stable commit point at a particular
sequence.  Handling this requires two changes:

1) We cannot transition to FULL_WAIT until we receive
a commit_start on a seq >= journaled_seq.
2) We cannot remove the journal completion plug until get
a committed_thru on a seq >= header.start_seq at least as
new as the oldest committed item in the journal.  If on
replay, the journal does not include fs_op_seq, we ignore
it, which is fine since we won't have reported those
entries committed!

Signed-off-by: Samuel Just <sam.just@inktank.com>
FileJournal: fix off by one error in committed_thru

journalq.front().first is the sequence number of the entry
at journalq.front().second.

Signed-off-by: Samuel Just <sam.just@inktank.com>
FileJournal: start_seq is seq+1 if journalq.empty()

This is also the same as journaled_seq + 1 for writeahead
journaling, but not for parallel journaling.

Signed-off-by: Samuel Just <sam.just@inktank.com>
rgw_admin: Create keys for a new user by default.

Create a new key pair for new users or when --gen-access-key is specified.

Signed-off-by: caleb miles <caleb.miles@inktank.com>
rbd qa/workunits: add rbd read data test

This adds a new test script for validating data reads from a mapped
rbd image is what it's expected to be.

See the content of the file for a bit more explanation.

Signed-off-by: Alex Elder <elder@inktank.com>
Merge branch 'wip_4654' into next

Fixes: #wip_4654
Reviewed-by: Greg Farnum <greg@inktank.com>
OSD: make pg upgrade logging quiet

Fixes: #4701
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
client:  Unify session close handling

If mds failure causes client reconnect while the
client is unmounting, the client will send a session
close request to the mds even if there are outstanding
inodes in the cache waiting to receive flush_acks.   This
causes the mds to send back a session close message and
the client closes the connection, so that when the mds tries
to send flush acks back to the client, they get dropped, resulting
in the client hanging on unmount.  The pattern for this bug is:

1. mds restart
2. client sends session open request
3. client unmount sets unmounting flag and waits for flush_acks
4. mds sends session open reply
5. client sends session close request (because its unmounting)
6. mds sends session close, client closes connection
7. mds tries to send flush_acks, but drops them because the connection
is gone

This patch unifies the session close handling so that the client
only sends a session close in unmount once all flush acks have been
received.  If the mds restarts during session close, the reconnect
logic will kick the session close waiter so that session close requests
are re-sent for session close replies not yet received.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
mds: Delay export on missing inodes for reconnect

The reconnect caps sent by the client on reconnect may not have
inodes found in the inode cache until after clientreplay (when
the client creates a new file, for example). Currently, we send an
export for that cap to the client if we don't see an inode in the cache
and path_is_mine() returns false (for example, if the client didn't
send a path because the file was already unlinked).
Instead, we want to delay handling of the reconnect cap until
clientreplay completes.

This patch modifies handle_client_reconnect() so that we don't assume
the cap isn't ours if we don't have an inode for it, but instead delay
recovery for later. An export cap message is only sent if the inode exists
and the cap isn't ours (non-auth) during reconnect. If any remaining
recovered caps exist in the recovered list once the mds goes active, we
send export messages at that point.

Also, after removing the path_is_mine check,
MDCache::parallel_fetch_traverse_dir() needs to skip non-auth dirfrags.

Fixes #4451.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Merge pull request #212 from ceph/wip-4451
Merge pull request #213 from ceph/wip-sessionmap-4644

mds: fix session_info_t decoding

Reviewed-by:  Sam Lang <sam.lang@inktank.com>
init-radosgw.sysv:  New radosgw init file for rpm based systems

Added init-radosgw.sys file for rpm based systems, added it to
the tarball list in the makefile, and updated the specfile to
install it.  Also added the a dependency in ceph since it uses
utility routes from that package (On debian systems these are
packaged in ceph-common).  Incorporated review comments from
Alex. (Bug #4571)

Signed-off-by: Gary Lowell  <gary.lowell@inktank.com>
Reviewed-by: Alexandre Marangone  <alexandre.marangone@inktank.com>
mds: output error number when failing to load an MDSTable

Signed-off-by: Greg Farnum <greg@inktank.com>
qa: add workunit for running qemu-iotests

This uses the old stand-alone qemu-iotests repo so it works with the
version of qemu in Ubuntu 12.04. The tests depend tightly on qemu
version, so to use later tests we'd need to install corresponding
versions of qemu.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Merge branch 'next'