qa/workunits/mon/crush_ops.sh: fix test

Fix root.

Fixes: #6392
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit c8cae87e9e08468cc86145e0fd60c05d12826239)
Invoke python with /usr/bin/env python instead of directly

Fixes: #6311
Signed-off-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit b9000b314b9166845ff302d4a827a996775d9a14)
crush: invalidate rmap on create (and thus decode)

If we have an existing CrushWrapper object and decode from a bufferlist,
reset build_rmaps so that they get rebuilt.

Remove the build_rmaps() all in decode that was useless on a redecode
(because have_rmaps == true in that case and it did nothing).

Fixes: #6442
Backport: dumpling, maybe cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit 9b7a2ae329b6a511064dd3d6e549ba61f52cfd21)
mon: OSDMonitor: do not write full_latest during trim

On commit 81983bab we patched OSDMonitor::update_from_paxos() such that we
write the latest full map version to 'full_latest' each time the latest
full map was built from the incremental versions.

This change however clashed with OSDMonitor::encode_trim_extra(), which
also wrote to 'full_latest' on each trim, writing instead the version of
the *oldest* full map.  This duality of behaviors could lead the store
to an inconsistent state across the monitors (although there's no sign of
it actually imposing any issues besides rebuilding already existing full
maps on some monitors).

We now stop OSDMonitor::encode_trim_extra() from writing to 'full_latest'.
This function will still write out the oldest full map it has in the store,
but it will no longer write to full_latest, instead leaving it up to
OSDMonitor::update_from_paxos() to figure it out -- and it already does.

Fixes: #6378

Backport: dumpling

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit bd0f29a2c28cca496ec830eac932477ebf3182ba)
osd/OSD.cc: Use MIN() so that we don't exceed osd_recovery_max_active

Caused by 944f3b73531af791c90f0f061280160003545c63

Fixes: #6291

Backport: dumpling

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 139a714e13aa3c7f42091270b55dde8a17b3c4b8)

Conflicts:

	src/osd/OSD.cc
rgw: fix keystone token expiration test

Fixes: #6360
The test was inverted, need expiration to be greater than
current time in order for token to be valid.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
v0.67.4
ceph_test_rados: do not let rollback race with snap delete

Note that the OSD behaves in a weird way when you rollback to a non-
existent snap, so the test probably isn't the only party at fault here.

Fixes (test half of): #6254
Backport: dumpling, cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 55d279b98553ba4542219b126fc7159b20b18b1f)

Conflicts:

	src/test/osd/RadosModel.h
	src/test/osd/TestRados.cc
Merge branch 'dumpling' of jenkins:ceph/ceph into dumpling
ceph.spec.in:  radosgw package doesn't require mod_fcgi

Fixes #5702

Signed-off-by: Gary Lowell  <gary.lowell@inktank.com>
Go back to $PWD in fsstress.sh if compiling from source.

Although fsstress was being called with a static path the directory
it was writing to was in the current directory so doing a cd to the
source directory that is made in /tmp and then removing it later
caused it to be unable to write the files in a non-existent dir.

This change gets the current path first and cd's back into it after
it is done compiling fsstress.

Issue #6479.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Alfredo Deza <alfredo.deza@inktank.com>
osdc/ObjectCacher: finish contexts after dropping object reference

The context to finish can be class C_Client_PutInode, which may drop
inode's last reference. So we should first drop object's reference,
then finish contexts.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
(cherry picked from commit b66ac77fa7aa3ff37804918c4308a348f239af09)
mon/MDSMonitor: don't reset incarnation when creating newfs

Fixes: #6279

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
(cherry picked from commit 40613b700b87b495d67793101ae05d6ba58b2a9a)
Reviewed-by: Greg Farnum <greg@inktank.com>
mds: return -EAGAIN if standby replay falls behind

standby replay may fall behind and get -ENOENT when reading the
journal. return -EAGAIN in this case, it makes the MDS respawn itself.

fixes: #5458

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit d2cb2bf6bac83ac6db9df6cb876317d30e7493cc)
Reviewed-by: Greg Farnum <greg@inktank.com>
rgw: swift update obj metadata also add generic attrs

Fixes: #6462
We were missing the generic attributes when we updated the object
metadata (operation that only exists in the swift api).

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit f2645e1c6d7383a0ace3b239f4304e353249c4bb)
rgw: change default log level

Fixes: #6554
Backport: cuttlefish, dumpling
Default log level was just too high, bring it down a bit.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 8d7dbf85472cfca9268d81ecf057ea078cf345b3)
rgw: fix authenticated users acl group check

Fixes: #6553
Backport: bobtail, cuttlefish, dumpling
Authenticated users group acl bit was not working correctly. Check to
test whether user is anonymous was wrong.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit bebbd6cb7b71697b34b8f27652cabdc40c97a33b)
mds: fix infinite loop of MDCache::populate_mydir().

make MDCache::populate_mydir() only fetch bare-bone stray dirs.
After all stray dirs are populated, call MDCache::scan_stray_dir(),
it fetches incomplete stray dirs.

Fixes: #4405
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 007f06ec174d4ee5cfb578c8b3f1c96b2bb0c238)

Conflicts:

	src/mds/MDCache.h

Reviewed-by: Greg Farnum <greg@inktank.com>
common/config: include --cluster in default usage message

Clean it up a bit too.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 157754b3a0191c5ff534a84adbeed88025615898)
rbd.py: increase parent name size limit

64 characters isn't all that long. 4096 ought to be enough for anyone.

Fixes: #6072
Backport: dumpling, cuttlefish
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 3c0042cde5a12de0f554a16b227ab437c6254ddd)