Sage Weil [Thu, 19 Mar 2015 23:27:17 +0000 (16:27 -0700)]
osd: only complain about stored vs actual digest if all peers support it
If we have a mixed cluster of hammer and pre-hammer OSDs, we will fall back
to using 0 as the initial crc32c value. However, if the primary has a
stored digest, it currently compares its value to the reported value (w/
the wrong initial value) and complains.
There are two possible fixes:
- avoid storing a digest if all peers don't support it, or
- avoid complaining on scrub if all peers don't support it.
The latter is easier, and this fix also has the benefit of fixing the bug
even for clusters where this has already happened.
Fixes: #11102 Signed-off-by: Sage Weil <sage@redhat.com>
Loic Dachary [Wed, 18 Mar 2015 13:17:00 +0000 (14:17 +0100)]
osd: erasure-code-profile incremental rm before set
It is possible for an incremental change to have both a rm and a set for
a given erasure code profile. It only happens when a rm is followed by a
set. When a set is followed by a rm, the rm will remove the pending set
in the incremental change.
The logic is the same for pool create and pool delete.
We must apply the incremental erasure-code-profile removal before the
creation otherwise rm and set in the same proposal will ignore the set.
This fix is minimal. A better change would be that erasure-code-profile
set checks if there is a pending removal and wait_for_finished_proposal
before creating.
Loic Dachary [Wed, 18 Mar 2015 10:40:36 +0000 (11:40 +0100)]
mon: informative message when erasure-code-profile set fails
When erasure-code-profile set refuses to override an existing profile,
it may be non trivial to figure out why. For instance:
ceph osd set default ruleset-failure-domain=host
fails with:
Error EPERM: will not override erasure code profile default
although ruleset-failure-domain=host is documented to be the
default. The error message now includes the two profiles that have been
compared to not be equal so that the user can verify the difference.
Error EPERM: will not override erasure code profile default
because the existing profile
{directory=.libs,k=2,m=1,plugin=jerasure,technique=reed_sol_van}
is different from the proposed profile
{directory=.libs,k=2,m=1,plugin=jerasure,ruleset-failure-domain=host,technique=reed_sol_van}
Sage Weil [Tue, 17 Mar 2015 17:26:13 +0000 (10:26 -0700)]
osd: use (robust) helper for setting exists or clearing whiteout
The current blanket check in prepare_transaction() will trigger only when
there is a net obs.exists change from the commited obs to new_obs.
However, this misses the case where the first osd_op is a delete and then a
subsequent osd_op recreates the object. Changing the whiteout check to
look only at new_obs does not work because it fails to understand when
_delete_oid sets the whiteout and will simply clear it again.
In order to support sequences of delete + create in general, we need to do
the whiteout flag clearing when the actual create happens (to match the
fact that we set it when we process the delete osd_op). Use a helper to
do this and consolidate most other obs.exists = true code to use it.
Backport: giant, firefly Signed-off-by: Sage Weil <sage@redhat.com>
David Zafman [Tue, 17 Mar 2015 03:34:10 +0000 (20:34 -0700)]
Improve "ceph_argparse.py: add stderr note if nonrequired param is invalid"
When processing arguments stash an exception which is seen when looking
for another argument type. If we have extra args at the end, output
information about the exception which probably caused the problem.
Samuel Just [Sat, 7 Mar 2015 02:30:41 +0000 (18:30 -0800)]
PGBackend: do not rewrite ec object oi checksums
Deep scrub does not actually give us the whole-object checksum for an ec
object, only the checksum for the first shard. We ignore it in scrub
for ec pools anyway in be_select_auth_object.
Jason Dillaman [Thu, 12 Mar 2015 16:56:14 +0000 (12:56 -0400)]
cls_rbd: set_flags can now update snapshots
It's possible for an object map to be invalid only for
a snapshot, so allow snapshot flags to be updated. This
will also be required when rebuilding the object map and
clearing the invalid flag.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Raju Kurunkad [Tue, 10 Mar 2015 07:58:28 +0000 (13:28 +0530)]
XIO: Handle requeue case of XIO messages
If we are not able to send the XIO message using xio_send_msg(),
remove the XIO message from the send Q, before queuing it to the resend
Q. Otherwise, boost will generate a assert.
Jason Dillaman [Tue, 10 Mar 2015 18:51:51 +0000 (14:51 -0400)]
librbd: retrieve image size at start of resize op
For the case where multiple resize requests were pending,
queued resizes should use the most recent value for the
current image size -- not the image size when the resize
was queued.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Tue, 10 Mar 2015 05:11:38 +0000 (01:11 -0400)]
librbd: do not invalidate oversized object map
If the object map is too large for the current image, it implies
that a resize operation was interrupted. It should only be
considered invalid if the object map is smaller than the image,
which shouldn't be possible.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Tue, 10 Mar 2015 01:45:06 +0000 (21:45 -0400)]
librbd: update size / parent overlap after resize completes
Update the in-memory image metadata for size and parent
overlap after updating the on-disk image metadata. Also
schedule an image refresh in case multiple resizes are
enqueued -- since ictx_refresh isn't async.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Mon, 9 Mar 2015 23:48:45 +0000 (19:48 -0400)]
librbd: resize/flatten should validate image is R/W
When proxying resize/flatten requests, the current image
R/W state is not validated. Also ensure the proper locks
are held when reading image metadata.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Xiong Yiliang [Fri, 6 Mar 2015 04:46:49 +0000 (12:46 +0800)]
osdc: fix a memory leak in C_TwoContexts
If an ObjectOperation op is cancelled, its destructor is
called and each Context object in out_handler is deleted.
A C_TwoContexts object can be one of these handlers. The
two contexts wrapped in C_TwoContexts must be deleted
as well.
Loic Dachary [Mon, 9 Mar 2015 14:41:21 +0000 (15:41 +0100)]
deb: add zlib1g-dev to Build-Depends for Debian/jessie
The zlib1g-dev is installed indirectly for Ubuntu 12.04 or Ubuntu 14.04
but it is only suggested in Debian/jessie. Adding it to the
Build-depends is redundant and harmless for Ubuntu and resolves the
missing dependency for Debian.