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>
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>
rgw: Use correct secret key for POST authn

The POST authentication by signature validation looked up a user based
on the access key, then used the first secret key for the user. If the
access key used was not the first access key, then the expected
signature would be wrong, and the POST would be rejected.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Merge branch 'bclibcoop/next-cors' of https://github.com/BCLibCoop/ceph into next

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
common: fix bufferlist::append(istream) test

bufferlist::append(istream) now filters out empty lines; reflect this in
the test

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 4b5f2570e9208bc9311267e93401d6078370807a)
Docs: Add backfill_toofull to list of PG states

Signed-off-by: John Spray <john.spray@inktank.com>
packaging: ship libdir/ceph

Automake puts ceph_common.sh into libdir/ceph, but the Red Hat packaging
was not capturing this file.

Add the libdir/ceph location to the RPM packaging.

Fixes #7117

(cherry picked from commit 2d0d48b829bd5721b7058ec43f61481fe8542b12)
Merge pull request #1119 from ceph/wip-7184

osd: ignore num_objects_dirty for old pools

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
mon/MDSMonitor: do not generate mdsmaps from already-laggy mds

There is one path where a mds that is not sending its beacon (e.g.,
because it is not running at all) will lead to proposal of new mdsmaps.
Fix it.

Backport: emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #1123 from ceph/wip-stray-mdsmaps

mon/MDSMonitor: do not generate mdsmaps from already-laggy mds
Reviewed-by: Greg Farnum <greg@inktank.com>
mon/MonCommands: 'invalidate+forward' -> 'forward'

Commit 4e439857a694 introduced invalidate+forward cache mode, commit
81279e3bb6e0 renamed it to forward, but missed the CLI.  Fix it.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Merge pull request #1124 from ceph/wip-cache-mode-fix

mon/MonCommands: 'invalidate+forward' -> 'forward'

Reviewed-by: Sage Weil <sage@inktank.com>