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>
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.
Samuel Just [Sat, 7 Mar 2015 02:02:25 +0000 (18:02 -0800)]
ReplicatedPG: block write on degraded object if there are waiters
Suppose we have min_size of 2 and size of 3, foo exists only on the
primary.
- block op 1 on foo due to < min_size
- start recovery on foo for replicas 1 and 2
- complete push to replica 1 (2 copies now)
- allow op 2 on foo through since we have 2 copies
- complete recovery on foo, requeue op 1
Fixes: 11057 Signed-off-by: Samuel Just <sjust@redhat.com>
Sage Weil [Sat, 7 Mar 2015 01:43:11 +0000 (17:43 -0800)]
crush: parse alg names that include a digit
The str_p("straw2") won't parse straw2, it seems because the digit is throwing
it off. Use the existing name rule instead which is more robust. Note that
not constraining the alg value here is better anyway because instead of a
'cannot parse' error that is hard to debug we instead get a 'unknown alg foo'
error when doing the semantic pass.
Fixes: #11015 Signed-off-by: Sage Weil <sage@redhat.com>
Loic Dachary [Thu, 5 Mar 2015 10:38:18 +0000 (11:38 +0100)]
install-deps.sh: strip | in the list of packages
Alternatives were introduced lately and the | needs to be stripped from
the list of packages to install otherwise apt-get will try to install
all packages.
Yehuda Sadeh [Thu, 12 Feb 2015 23:29:24 +0000 (15:29 -0800)]
rgw: fix watch initialization and reinit on error
We can't just call rados->finalize_watch() and rados->init_watch() from
the watcher, as these calls modify the watcher itself. Also, we can't just
enable the cache after successful watch, because there's more than one
watcher. Only enable the cache if all watchers are set.
Ken Dreyer [Wed, 4 Mar 2015 22:01:34 +0000 (15:01 -0700)]
ceph.spec.in: loosen ceph-test's dependencies
In Debian, the ceph-test package can be installed with any version of
ceph-common.
Prior to this commit, in RHEL, we're much more strict about which
version of the dependencies we require. We depend directly on
librados2/librbd1/libcephfs1 instead of ceph-common, and we also require
the specific versions of these libraries to match the version of
ceph-test.
For testing Ceph, it is nice to have the ability to upgrade the
librados2/librbd1/libcephfs1 libraries on a host without having to also
upgrade the ceph-test package as well.
Remove the version number requirements, and change the dependencies from
librados2/librbd1/libcephfs1 to simply "ceph-common". That will make
/etc/ceph/ and /var/log/ceph present for the tests.
Jason Dillaman [Tue, 3 Mar 2015 02:14:21 +0000 (21:14 -0500)]
librbd: delay completion of AioRequest::read_from_parent
If the object map is enabled, it's possible for a read request to
instantly complete due to the skipped librados operations. Now
AioRequest will block the completion of read_from_parent requests
to prevent the possibility of the parent image being closed while
the read_from_parent method invocation is in-progress.
Fixes: #10968 Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Tue, 3 Mar 2015 02:07:01 +0000 (21:07 -0500)]
librbd: allow AioCompletions to be blocked
Blocked AioCompletions will not fire their callback until unblocked.
This is an expansion / replacement of the previous 'building' flag
used to block completions while additional requests were added to the
completion.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Mon, 2 Mar 2015 13:13:55 +0000 (08:13 -0500)]
librbd: handle possible aio_read return error code
AioRead and CopyupRequest were not properly handling possible
error codes from aio_read. They now correctly free the completion
and invoke the callback context.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Loic Dachary [Wed, 25 Feb 2015 14:32:50 +0000 (15:32 +0100)]
mon: ignore crushtool validation if too long
The crushtool is aborted if it takes more than mon lease seconds. Since
the monitor blocks while running it, this is mandatory otherwise the
monitor will be considered down and new elections triggered.
Loic Dachary [Mon, 2 Mar 2015 10:14:18 +0000 (11:14 +0100)]
mon: do not hardwire crushtool command line
Make crushtool a configuration value that defaults to crushtool and
allow it to be injected. It helps with testing: the command can be
replaced with another that misbehaves in various ways.
Jason Dillaman [Mon, 2 Mar 2015 22:39:20 +0000 (17:39 -0500)]
rbd: fixed formatted output of rbd image features
All feature flags were being displayed when using JSON/XML
formatted output. Now use the same formatting routing for
plain/JSON/XML output for features and flags.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Fri, 27 Feb 2015 14:46:55 +0000 (09:46 -0500)]
librbd: flush pending AIO after acquiring lock
There was a potential race condition between a delayed AIO
operation waiting on acquiring a lock and a snap_create
flushing all pending IO. Since snap_create owned md_lock, the
delayed AIO would not be allowed to complete -- deadlocking the
flush.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Fri, 27 Feb 2015 04:39:10 +0000 (23:39 -0500)]
librbd: hold snap_lock between clipping IO and registering AIO
In the case where concurrent IO is occurring when a trim resize
operation is initiated, hold the snap_lock between clipping the
IO operation and registering the pending op. That allows the
resize state machine to properly flush all operations issued
before the clip region was updated.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Loic Dachary [Fri, 27 Feb 2015 15:15:57 +0000 (16:15 +0100)]
mon: do not pollute directory with cvs files from crushtool
The --output-csv option to crushtool will create files in the current
directory of the monitor. The only reason for using it is because
crushtool requires at least one option for display. Relax this
constraint in crushtool and remove the option from the call made by the
monitor to validate a new crushmap.