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>
doc: Updated terminology. Added librados intro to index.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Added librados introduction doc. Still wip.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Modified doc examples to use rados_create2.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Added python example of handle, and closing session examples.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
osd/ReplicatedPG: no HitSet on non-primary

Signed-off-by: Sage Weil <sage@inktank.com>
mon/OSDMonitor: simplify and make 'osd pool set ...' output consistent

Signed-off-by: Sage Weil <sage@inktank.com>
updated "sample.ceph.conf":

I've made the following changes to simplify initial cluster configuration:

 * Removed deprecated option(s).
 * Removed overrides for default paths that are "not recommended to change".
 * Added comments with keys' descriptions, types and defaults.
 * Added references to relevant on-line docs;
   sorted keys according to their respective docs sections (pages).
 * Use different types of comments for annotations ('#')
   and for keys/values (';').
 * Added many useful keys.
 * Commented some lines to make sample config "neutral". The idea is to
   let users to un-comment what they need rather than remove sample sections
   that they surely won't be using as is.

Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
first commit
client: ceph-fuse use fuse_session_loop_mt to allow multithreaded operation if "fuse multithreaded = 1".
Signed-off-by: Moritz Moeller mm@mxs.de
rgw: don't return -ENOENT in put_obj_meta()

Fixes: #7168

An object put may race with the same object's delete. In this case just
ignore the error, same behavior as if object was created and then
removed.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: handle racing object puts when object doesn't exist

If the object didn't exist before and now we have multiple puts coming
in concurrently, we need to make sure that we behave correctly. Only one
needs to win, the other one can fail silently. We do that by setting
exclusive flag on the object creation and handling the error correctly.
Note that we still want to return -EEXIST in some cases (when the
exclusive flag is passed to put_obj_meta(), e.g., on bucket creation).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
libc++: create portable smart ptr / hash_map/set

Creates ceph:: namespaced versions of smart pointers and unordered map
and sets.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
libc++: use ceph:: namespaced data types

Switches the implemetnation of smart pointers and unordered map/set to
use the ceph:: versions.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
libc++: use ceph::shared_ptr in installed header

librados.hpp uses std::tr1::shared_ptr which may not be available such
as in libc++. This switches the use to ceph::shared_ptr and as a result
also ships include/memory.h for the definition.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
libc++: avoid hash re-definitions

The definitions of hash<> for int64_t/uint64_t that were not available
on i386 in the __gnu_cxx namespace are available when we switch over to
std::tr1 namespace so we remove them to avoid the redefinition errors.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
libc++: fix null pointer comparison

This error is thrown when comparing a shared_ptr to NULL. To resolve
this we just use shared_ptr::operator bool that checks if the stored
pointer is null.

In C++11 the shared_ptr can be compared to nullptr, but as of yet I have
not come up with a good compatibility fix.

Details:

os/MemStore.cc:259:30: error: use of overloaded operator '!=' is ambiguous (with operand types 'ObjectRef' (aka 'shared_ptr<MemStore::Object>') and 'long')
  return (c->get_object(oid) != __null);
          ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:4787:1: note: candidate function [with _Tp = MemStore::Object]
operator!=(const shared_ptr<_Tp>& __x, nullptr_t) throw()
^
os/MemStore.cc:259:30: note: built-in candidate operator!=(int, long)
  return (c->get_object(oid) != __null);
                             ^
os/MemStore.cc:259:30: note: built-in candidate operator!=(unsigned __int128, long)
os/MemStore.cc:259:30: note: built-in candidate operator!=(unsigned long long, long)
    .....
1 error generated.
make[3]: *** [os/MemStore.lo] Error 1

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
osd: ignore num_objects_dirty for old pools

Way back in a0ed9c20048750fd4b2c7ce0339fa8b20ef08ca3 we introduced the
dirty flag, but we did not track it in the stats until much later in
c561d5ea22c335e4c05fdc16ca8fb41f75f89d81.  Unfortunately this interval
spans the emperor release.  To avoid making scrub error out and require
repair on *any* of those old pools, flag stats that were encoded before
now such that the dirty stats are ignored.  Clear the flag if we *do*
do a repair so that it will be tracked properly thereafter.

Signed-off-by: Sage Weil <sage@inktank.com>
rgw: Document fields for access/secret key

The field name mapping for access vs secret key is not clear, this
helped in debugging.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
rgw: Fix signature variable naming/failure print

The signature variables for expected vs got are poorly named, and this
lead them being swapped in the signature validation failure print.
Change them to 'expected' and 'received' and make the related temporary
variables consistent to match.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>