Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librbd: API changes to support separate data pool #11353

Merged
merged 5 commits into from Oct 7, 2016

Conversation

dillaman
Copy link

@dillaman dillaman commented Oct 6, 2016

No description provided.

@dillaman
Copy link
Author

dillaman commented Oct 6, 2016

This is rebased on top of PR #11327

@dillaman dillaman changed the title librbd: API changes to support separate data pool [DNM] librbd: API changes to support separate data pool Oct 6, 2016
Jason Dillaman added 5 commits October 6, 2016 14:50
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Replace the individual image option parameters with the ImageOptions
wrapper and extract the options within the state machine itself.
This will simplify adding support for the data pool and other options
in the future.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
@dillaman dillaman changed the title [DNM] librbd: API changes to support separate data pool librbd: API changes to support separate data pool Oct 6, 2016
@trociny trociny self-assigned this Oct 6, 2016
@trociny
Copy link
Contributor

trociny commented Oct 7, 2016

@dillaman pybind test fails:

% RBD_FEATURES=127  PYTHONPATH=../src/test/pybind:../src/pybind:./lib/cython_modules/lib.2 LD_LIBRARY_PATH=./lib nosetests -v test_rbd -m 'test_create_defaults' 
test_rbd.test_create_defaults ... FAIL

======================================================================
FAIL: test_rbd.test_create_defaults
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/SSD/ceph/ceph.upstream/build/test_rbd.py", line 194, in test_create_defaults
    check_default_params(2, 20, RBD_FEATURE_STRIPINGV2, 0, 0)
  File "/SSD/ceph/ceph.upstream/build/test_rbd.py", line 150, in check_default_params
    eq(expected_features, image.features())
AssertionError: 2 != 0L

----------------------------------------------------------------------
Ran 1 test in 6.695s

So it fails when creating an image with 'striping' feature and providing stripe_unit and stripe_count = 0. Previously in such a case it used defaults for these parameters and set the feature bit. Now it creates the image without this feature. Also reproducible with rbd cli:

% ./bin/rbd create test_striping --size 1 --rbd_default_features 2 --rbd_default_stripe_count=0 --rbd_default_stripe_unit=0
% ./bin/rbd info test_striping
rbd image 'test_striping':
        size 1024 kB in 1 objects
        order 22 (4096 kB objects)
        block_name_prefix: rbd_data.5e692ae8944a
        format: 2
        features: 
        flags: 
% ./bin/rbd create test_striping1 --size 1 --image-feature striping --stripe-count 0 --stripe-unit 0
% ./bin/rbd info test_striping1
rbd image 'test_striping1':
        size 1024 kB in 1 objects
        order 22 (4096 kB objects)
        block_name_prefix: rbd_data.5e672ae8944a
        format: 2
        features: 
        flags: 
# Now using rbd from master:
% ../../ceph/build/bin/rbd create test_striping2 --size 1 --image-feature striping --stripe-count 0 --stripe-unit 0
% ./bin/rbd info test_striping2
rbd image 'test_striping2':
        size 1024 kB in 1 objects
        order 22 (4096 kB objects)
        block_name_prefix: rbd_data.5e752ae8944a
        format: 2
        features: striping
        flags: 
        stripe unit: 4096 kB
        stripe count: 1

@trociny
Copy link
Contributor

trociny commented Oct 7, 2016

@dillaman Never mind, I was running a wrong test_rbd.py, I see you have already updated it accordingly.

@dillaman
Copy link
Author

dillaman commented Oct 7, 2016

@trociny Yeah, I expanded on the approach where the STRIPINGV2 feature is auto-applied if you specify stripe options for the DATA_POOL feature. However, I didn't want to introduce unnecessary incompatibility if the data pool was the same as the header's pool, so I also auto-removed the flag if the feature wasn't in use. Given that, I figured it also probably made sense to remove the STRIPINGV2 flag if fancy striping wasn't actually being used (although I know krbd will just ignore it if it's set w/ non-fancy stripe settings).

Copy link
Contributor

@trociny trociny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@trociny trociny merged commit b170f9d into ceph:master Oct 7, 2016
@dillaman dillaman deleted the wip-17423 branch October 10, 2016 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants