This will be used by PGBackend implementers to get the SnapSet
and ObjectInfo for newly recovered objects on the primary.
get_object_context may be called on a missing object for a lost_revert
Signed-off-by: Samuel Just <sam.just@inktank.com>
If we resize the write due to the funky truncate behavior, we need to
resize the bufferlist to match.
Fixes: #6346
Signed-off-by: Sage Weil <sage@inktank.com>
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>
By default options are required, and that leads to the Ceph CLI making
users add this to their commands before even submitting it to the monitor. We
want them to see and think about the messages generated by the monitor!
Signed-off-by: Greg Farnum <greg@inktank.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
May as well be pedantic about it, even though we are leaving the port
in numeric form.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Test that it works in snaptest-0.sh, and set the flag in
all the snap workunits so they continue to function.
Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Loic Dachary <loic@dachary.org>
This way users can't put snapshots on their clusters unless they explicitly
ask for them and have seen a warning message. We take a bit of the MDSMap
flags in order to do so. The only thing a little weird here is that anybody
who upgrades to this patch who already has snapshots will hit the EPERM
and have to go through the warning, but it doesn't impact existing snapshots
at all so they should be good.
To go along with this, we add "ever_allowed_snaps" and "explicitly_allowed_snaps"
members to the MDSMap, which are default to false and are set to true
when allow_new_snaps is set. Old maps decoded with new code default to true
and false, respectively, so we can tell.
Fixes: #6332
Signed-off-by: Greg Farnum <greg@inktank.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
The only context that should see this is
C_MDS_BootStart, and it is prepared for failures,
so there's no reason to always return 0.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
This wasn't getting built in!
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 3233336cc3)
so that the following works:
git clone git@github.com:ceph/ceph.git
cd ceph
./autogen.sh
mkdir ../build
cd ../build
../ceph/configure --with-radosgw
make check
Signed-off-by: Loic Dachary <loic@dachary.org>
The current LOOKUPSNAP code path was dereferencing mdr->dn[0] and getting
SEGV. Instead, set the do_lookup arg to false for getattr so that we do
not try to dereference this; for snaps it will always be NULL as we are
constructing a fake namespace for the .snap directory. (This happens in
the path_traverse, the result of which is to set snapid--without any real
dentry).
With this fix, snaptest-0.sh passes.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
The leader mon is responsible for propagating changes in the osdmap
into the pgmap (e.g., when a pool or osd goes away). If that hasn't
happened yet, the pg_map map will be out of sync with the current set
of pools. We shouldn't crash.
Signed-off-by: Sage Weil <sage@inktank.com>
src/Makefile-env.am:31: error: using '$(srcdir)' in TESTS is currently broken: '$(srcdir)/unittest_bufferlist.sh'
src/Makefile.am:1: 'src/Makefile-env.am' included from here
src/Makefile-env.am:31: error: using '$(srcdir)' in TESTS is currently broken: '$(srcdir)/test/encoding/check-generated.sh'
src/Makefile.am:1: 'src/Makefile-env.am' included from here
on my (raring) laptop.
Signed-off-by: Sage Weil <sage@inktank.com>