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

rbd: expose pool stats summary tool #24830

Merged
merged 2 commits into from
Nov 10, 2018
Merged

Conversation

dillaman
Copy link

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

src/include/rbd/librbd.h Outdated Show resolved Hide resolved
@dillaman dillaman force-pushed the wip-rbd-pool-stats branch 2 times, most recently from 9f94937 to 75c4331 Compare November 2, 2018 14:10
@trociny
Copy link
Contributor

trociny commented Nov 2, 2018

@dillaman It looks like you squshed wrong commits.

@dillaman
Copy link
Author

dillaman commented Nov 2, 2018

@trociny Indeed -- thx and fixed.

@dillaman
Copy link
Author

dillaman commented Nov 8, 2018

@trociny bit the bullet and went w/ your original suggestion to have dynamic stat querying.

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

eq(stats['trash_count'], 0)
eq(stats['trash_provisioned_bytes'], 0)
eq(stats['trash_max_provisioned_bytes'], 0)
eq(stats['trash_snap_count'], 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

When running all pybind tests it fails with:

======================================================================
FAIL: test_rbd.test_pool_stats
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/mgolub/ceph/ceph.ci/src/test/pybind/test_rbd.py", line 119, in _require_new_format
    return fn(*args, **kwargs)
  File "/home/mgolub/ceph/ceph.ci/src/test/pybind/test_rbd.py", line 397, in test_pool_stats
    eq(stats['trash_count'], 0)
AssertionError: 1L != 0

Which is due to TestTrash.test_remove_denied not doing necessary cleanup. Anyway, probably a good idea to additionally run rbd.pool_stats_get before creating the images to make sure the pool is empty?

And you need to do the images cleanup too, because after fixing TestTrash.test_remove_denied by adding
RBD().trash_remove(ioctx, image_id, True) I start to observe:

======================================================================
FAIL: test_rbd.test_list_empty
----------------------------------------------------------------------
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.ci/src/test/pybind/test_rbd.py", line 314, in test_list_empty
    eq([], RBD().list(ioctx))
AssertionError: [] != [u'image175', u'image176', u'image177', u'image178']

Copy link
Author

Choose a reason for hiding this comment

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

@trociny Sorry about that -- should be better now

Jason Dillaman added 2 commits November 9, 2018 12:40
The init method is a stub for handling new pool initialization. It
currently only handles setting the application tag. The stats method
will quickly calculate the number of images and provisioned space for
those images within the pool. Querying the pool stats on a pool with
10,000 images only required approximately 2 seconds as compared to
over 2 minutes for a "rbd ls -l" scan.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This provides a quick summary of provisioned pool usage.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
@trociny trociny merged commit 56412bf into ceph:master Nov 10, 2018
@dillaman dillaman deleted the wip-rbd-pool-stats branch November 10, 2018 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants