Commit Graph

40877 Commits

Author SHA1 Message Date
Jason Dillaman
882b370052 tests: verify RBD flags are updated when enabling/disabling features
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-14 12:47:57 -04:00
Jason Dillaman
46b19cb7e1 librbd: update image flags when enabling/disabling features
After enabling object map or fast diff, flag those features as
invalid.  When disabling features, remove the associated invalid
flags.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-14 09:40:02 -04:00
Jason Dillaman
9eb1e59cee librbd: add new RBD_FLAG_FAST_DIFF_INVALID flag
Since fast diff can be enabled/disabled independently from the object
map, it's important to track when the fast diff portion of the object
map is invalid.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-14 09:13:03 -04:00
Jason Dillaman
e5befcd5c3 tests: librbd DiffIterateStress now tests object map merging
Snapshots are deleted to verify that the fast diff feature
still functions as expected.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 17:08:04 -04:00
Jason Dillaman
b3dab78a15 tests: add RBD fast diff feature to unit tests
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:37 -04:00
Jason Dillaman
10f444b7d7 pybind: add new diff_iterate features to RBD python bindings
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:37 -04:00
Jason Dillaman
883169f739 librbd: snap_remove proxy requests require fast diff feature
Since older Ceph clients that support exclusive locking won't
support snap_remove, only attempt to proxy the command if
fast diff is enabled.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:36 -04:00
Jason Dillaman
dd82561c82 tests: relax diff_iterate discard test
The fast diff algorithm can only flag an object as deleted if
the full object is discarded -- not just a small section.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:15 -04:00
Jason Dillaman
7bffb6d185 librbd: implement fast diff algorithm
The fast diff algorithm reads all object maps between the from/to
snapshot ids and computes when the object was changed/removed.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:15 -04:00
Jason Dillaman
c26f58c747 librbd: integrate with new object_map_snap_add/remove cls methods
When a snapshot is added, mark all HEAD image objects that exist as clean.
When a snapshot is removed, mark all clean objects that were dirty in the
deleted snapshot as dirty.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:15 -04:00
Jason Dillaman
3e7a342b4b tests: correct update_features test for FAST_DIFF feature
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:15 -04:00
Jason Dillaman
c39691838c librbd: ensure fast diff feature relies on object map
Throw an error if the fast diff feature is enabled w/o the
object map -- or if the object map is disabled while fast
diff is still enabled.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:15 -04:00
Jason Dillaman
3a239b0962 tests: test new RBD fast diff feature
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:15 -04:00
Jason Dillaman
ed2a1fcb16 librbd: move object map snapshot handling to ObjectMap class
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:14 -04:00
Jason Dillaman
ff5b849fb1 tests: new test cases for cls_rbd
Added test cases for new object_map_snap_add and object_map_snap_remove
methods.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:14 -04:00
Jason Dillaman
d6db277ed2 cls_rbd_client: added object_map_snap_add and object_map_snap_remove methods
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:14 -04:00
Jason Dillaman
11fd7a9a2b cls_rbd: added object_map_snap_add and object_map_snap_remove methods
object_map_snap_add is invoked after creating a new snapshot to flag
all in-use HEAD objects within as clean.  object_map_snap_remove is
invoked after a snapshot is removed in order to clear the clean flag
on all in-use objects.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:14 -04:00
Jason Dillaman
4ac584c34d librbd: move object map codes to common location
These codes will need to be accessible from cls_rbd and librbd.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:14 -04:00
Jason Dillaman
11cc7b2715 rbd: add support for new fast diff feature
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:14 -04:00
Jason Dillaman
16ad44cebc librbd: add new FAST_DIFF feature
A new feature is required to track images that are properly tracking
object deltas between snapshots.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:14 -04:00
Jason Dillaman
4c1b4a8f6a tests: add unit tests for proxied snap_remove operation
Verify handling of snap_remove proxied to the exclusive lock
owner.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:14 -04:00
Jason Dillaman
63324cce9d librbd: add snap_remove to image watcher RPC
In order to support merging dirty object metadata from
snapshot object maps, it is now required to coordinate this
activity through the exclusive lock owner.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-13 15:24:13 -04:00
Jason Dillaman
eed80f022a rbd: add new --object-extents option to diff / export-diff
The rbd CLI can now use the object map to compute the diffs between
two snapshots.  This option is enabled with the new '--object-extents'
option.

Fixes: #7787
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-12 21:17:33 -04:00
Jason Dillaman
b3e8a90c3e tests: add unit test for new diff_iterate2 librbd API method
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-12 21:17:32 -04:00
Jason Dillaman
6d5b969d42 librbd: add diff_iterate2 to API
New diff_iterate API supports skipping parent images and reporting
the object extents for an object that has been modified. The latter
will be helpful in providing an optimized diff method that can use
the object map to quickly compute object diffs between snapshots.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-12 21:17:32 -04:00
branto1
48e34036ef Merge pull request #4317 from ceph/wip-rpm-with-systemd-comparison
ceph.spec.in: set _with_systemd on RHEL 7 and Fedora
2015-04-13 14:11:45 +02:00
Kefu Chai
6f6d7fe256 Merge pull request #4327 from dachary/wip-wheezy
install-deps.sh: Debian GNU/Linux wheezy needs backports

Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-04-13 18:06:28 +08:00
Loic Dachary
2773ae5aeb Merge pull request #4341 from dachary/wip-test-timeout
tests: display ceph report when stuck

Reviewed-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-04-13 11:30:29 +02:00
Loic Dachary
921436e1dd Merge pull request #4334 from smithfarm/master
do_autogen: add missing '--without-lttng' option to usage()

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2015-04-13 11:20:34 +02:00
Loic Dachary
464999e1b7 tests: display ceph report when stuck
When the cluster is stuck (wait_for_clean times out), display ceph
report to stderr for debugging purposes.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-04-11 14:14:53 +02:00
Josh Durgin
796f810398 Merge pull request #4239 from yuyuyu101/wip-librbd-conf
Wip librbd conf

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-10 23:10:34 -07:00
Josh Durgin
2239dcb71d Merge pull request #4323 from ceph/wip-11363
librbd: ImageWatcher should cancel in-flight ops on watch error

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-10 18:04:30 -07:00
Josh Durgin
458901dfb2 Merge pull request #4140 from ceph/wip-rbd-rebuild-object-map
rbd: add ability to rebuild corrupt/missing object maps

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-10 17:56:48 -07:00
Josh Durgin
0593611fe9 Merge pull request #4325 from wonzhq/async-resize-2
librbd/AsyncResize: avoid dup incrementing refresh seq

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-10 17:32:58 -07:00
Josh Durgin
ef5c2b7b89 Merge pull request #4336 from ceph/wip-11369
librbd: failure to update the object map should always return success

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-10 17:26:14 -07:00
Loic Dachary
3ab13e6451 install-deps.sh: Debian GNU/Linux wheezy needs backports
It is not enough for the backports to be available, they also need to be
explicitly allowed to take precedence whenever a package is installed
indirectly. This is causing problems with libp11-kit-dev pulled by
libcurl4-gnutls-dev.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-04-10 23:51:45 +02:00
Josh Durgin
523272cf22 Merge pull request #4319 from ceph/wip-11348
librbd: update default image format to version 2

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2015-04-10 14:07:43 -07:00
Nathan Cutler
56039b37b3 do_autogen.sh: add missing '--without-lttng' option to usage
Signed-off-by: Nathan Cutler <ncutler@suse.cz>
2015-04-10 21:52:11 +02:00
Jason Dillaman
06f30fc18d librbd: notify of header update after rebuilding object map
This will allow clients to detect that the object map is no longer
invalid and to reload the object map from disk.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:22 -04:00
Jason Dillaman
58be49e592 librbd: rebuilding object map shouldn't update piecemeal
The object map is now rebuilt in-memory and written back to the
OSDs as a single operation.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:22 -04:00
Jason Dillaman
3ec68db139 tests: add test case for cls_rbd object_map_save
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:22 -04:00
Jason Dillaman
24c923e22e cls_rbd_client: add object_map_save helper method
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:22 -04:00
Jason Dillaman
e5adbaa80b cls_rbd: add object_map_save method
Allow the object map rebuild process to build the full object map
in memory and save it to disk with one operation.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:22 -04:00
Jason Dillaman
8ca6220fc2 tests: add ImageWatcher test for new rebuild object map request
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:22 -04:00
Jason Dillaman
852592a565 tests: added rebuild_object_map test to test_librbd
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 15:46:21 -04:00
Jason Dillaman
7ba4f1003a tests: librados_test_stub reads should deep-copy
If a client of librados_test_stub modified a bufferlist
retrieved via a read call, the client will actually be
changing the contents of the file.  Therefore, read calls
should deep-copy the contents of the buffer::ptrs.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:05 -04:00
Jason Dillaman
e714800c48 librbd: allow snapshot object maps to be updated
Rebuild will need to be able to update/resize the object maps
for image snapshots.  This was previously not permitted.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:05 -04:00
Jason Dillaman
92a42561f8 librbd: update in-memory object map before on-disk update completes
When multiple IO updates are occurring within the same object, this
will allow only a single object map update request to be sent to the
OSD.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:05 -04:00
Jason Dillaman
1b7f8c13f9 cls_rbd: treat zero-byte object maps as missing
Acquiring the lock on a missing object map will create an
empty object. Treat the empty object as a non-existant
object map to support rebuilding corrupt object maps while
holding the exclusive lock.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:05 -04:00
Jason Dillaman
6ce79ab008 rbd: add object map rebuild command
An invalid object map can now be rebuilt via the rbd CLI.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2015-04-10 14:10:05 -04:00