rgw: add compatibility for MultipartUpload

Fixes: #6677
It seems that there's some external library that uses MultipartUpload
instead of CompleteMultipartUpload, even though it's not part of the
documented api. Support it.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: set bucket permissions, cors on swift creation

Fixes: #7271
Swift bucket creation was ignoring the x-container-read,
x-container-write and the various cors related headers. Now going
through the same logic that bucket modify goes.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
monc: let users specify a callback when they reopen their monitor session

Then the callback is triggered when a new session is established, and the
daemon can do whatever it likes. There are no guarantees about how long it
might take to trigger, though. In particular we call the provided callback
while not holding our own lock in order to avoid deadlock. This could lead
to some funny ordering from the user's perspective if they call
reopen_session() again before getting the callback, but there's no way around
that, so they just have to use it appropriately.

Signed-off-by: Greg Farnum <greg@inktank.com>
monc: set "hunting" to true when we reopen the mon session

If we don't have a connecton to a monitor, we want to retry to another
monitor regardless of whether it's the first time or not.

Signed-off-by: Greg Farnum <greg@inktank.com>
monc: backoff the timeout period when reconnecting

If the monitors are systematically slowing down, we don't want to spam
them with reconnect attempts every three seconds. Instead, every time
we issue a reconnect, multiply our timeout period by a configurable; when
we complete the connection, reduce that multipler by 50%. This should let
us respond to monitor load.
Of course, we don't want to do that for initial startup in the case of a
couple down monitors, so don't apply the backoff until we've successfully
connected to a monitor at least once.

Signed-off-by: Greg Farnum <greg@inktank.com>
OSD: disable the PGStatsAck timeout when we are reconnecting to a monitor

Previously, the timeout counter started as soon as we issued the reopen,
but if the reconnect process itself took a while, we might time out and
issue another reopen just as we get to the point where it's possible to
get work done. Since the mon client has its own reconnect timeouts (that is,
the OSD doesn't need to trigger those), we instead disable our timeouts
while the reconnect is happening, and then turn them back on again starting
from when we get the reconnect callback.

Signed-off-by: Greg Farnum <greg@inktank.com>
common: ping existing admin socket before unlink

When a daemon initializes it tries to create an admin socket and unlinks
any pre-existing file, regardless. If such a file is in use, it causes
the existing daemon to loose its admin socket.

The AdminSocketClient::ping is implemented to probe an existing socket,
using the "0" message. The AdminSocket::bind_and_listen function is
modified to call ping() on when it finds existing file. It unlinks the
file only if the ping fails.

http://tracker.ceph.com/issues/7188 fixes: #7188

Backport: emperor, dumpling
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
Merge pull request #1246 from dachary/wip-7188

common: ping existing admin socket before unlink
SimpleMessenger: init_local_connection whenever my_inst changes

This is necessary to correctly handle messages to self.

Signed-off-by: Samuel Just <sam.just@inktank.com>
librados: add calls to expose required write alignment

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: reject unaligned writes on ec pools

Signed-off-by: Samuel Just <sam.just@inktank.com>
TestRados: send aligned appends on erasure pools

Signed-off-by: Samuel Just <sam.just@inktank.com>
ObjectStore: fix OP_COLL_ADD dump output

Signed-off-by: Samuel Just <sam.just@inktank.com>
ErasureCodeJerasure: fix alignement issues in encode/decode

Signed-off-by: Samuel Just <sam.just@inktank.com>
ErasureCodeJerasure: fill in decoded if all shards are included

This causes it to match minimum_to_decode.

Signed-off-by: Samuel Just <sam.just@inktank.com>
FileStore: permit NULL onreadable callback

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: release_op_ctx_locks in all-applied, not all-committed

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: handle xattr cache on rollback and delete_head

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: find_object_context debugging: output oi

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG:: remove_snap_mapped_object already removes the object

Signed-off-by: Samuel Just <sam.just@inktank.com>