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

test: fix rbd unit test cases w/ striping feature #13196

Merged
merged 3 commits into from Feb 28, 2017

Conversation

Projects
None yet
2 participants
@vshankar
Contributor

vshankar commented Jan 31, 2017

Run RBD unit tests additionally with RBD_FEATURES=127 (including STRIPINGV2).

Bonus fix for grabbing exclusive-lock during copy on read (required for running unit tests with changes in this pr).

@@ -3419,7 +3423,7 @@ TEST_F(TestLibRBD, FlattenNoEmptyObjects)
librbd::RBD rbd;
std::string parent_name = get_temp_image_name();
uint64_t size = 4 << 20;
int order = 12; // smallest object size is 4K
int order = 0;

This comment has been minimized.

@dillaman

dillaman Jan 31, 2017

Contributor

W/ the default order (4MB) and an image size of 4MB, would you expect any empty objects?

This comment has been minimized.

@vshankar

vshankar Feb 1, 2017

Contributor

Thanks for catching this. Will fix and update.

This comment has been minimized.

@dillaman

dillaman Feb 10, 2017

Contributor

ping

This comment has been minimized.

@vshankar

vshankar Feb 12, 2017

Contributor

Sorry for the delay - will send out the fix in a while.

@@ -284,6 +288,10 @@ void AioImageRequestWQ::set_require_lock_on_read() {
ldout(cct, 20) << __func__ << dendl;
RWLock::WLocker locker(m_lock);
if (m_require_lock_on_read) {

This comment has been minimized.

@dillaman

dillaman Feb 13, 2017

Contributor

Nit: doesn't really protect against anything :-p

@@ -111,6 +111,10 @@ void AioImageRequestWQ::aio_read(AioCompletion *c, uint64_t off, uint64_t len,
RWLock::RLocker owner_locker(m_image_ctx.owner_lock);
if (m_image_ctx.clone_copy_on_read && is_lock_required()) {

This comment has been minimized.

@dillaman

dillaman Feb 13, 2017

Contributor

Probably better to combine this with the existing logic in librbd::image::RefreshRequest to avoid having this flag cleared should journaling be disabled while a read IO is queued. Probably can avoid the other changes in this file if that change is made.

@@ -596,7 +596,7 @@ struct C_InvalidateCache : public Context {
bool ImageCtx::test_features(uint64_t in_features,
const RWLock &in_snap_lock) const
{
assert(snap_lock.is_locked());
assert(in_snap_lock.is_locked());

This comment has been minimized.

@dillaman

dillaman Feb 22, 2017

Contributor

The convention of passing in a reference of a lock is just a way to indicate that this method requires that you have already locked the lock. The assertion just verifies that fact. With this change, I could now invoke test_features(XYZ, owner_lock) and the assert will pass if I have ImageCtx::owner_lock locked without locking the correct ImageCtx::snap_lock.

This comment has been minimized.

@vshankar

vshankar Feb 23, 2017

Contributor

Thanks for the explanation. It looked like a harmless typo to me given that in_snap_lock is never used in the function. Plus it looked a bit unnecessary to accept a lock as a parameter and check if its the lock is already acquired. (I had put up a comment in github regarding this but never published it)

I'll revert this change and resubmit.

vshankar added some commits Feb 20, 2017

librbd: acquire exclusive-lock during copy on read
Fixes: http://tracker.ceph.com/issues/18888
Signed-off-by: Venky Shankar <vshankar@redhat.com>
test / librbd: support STRIPINGV2 unit tests
Signed-off-by: Venky Shankar <vshankar@redhat.com>
test: add STRIPINGV2 feature to RBD test cases
Signed-off-by: Venky Shankar <vshankar@redhat.com>
@vshankar

This comment has been minimized.

Contributor

vshankar commented Feb 23, 2017

@dillaman resent the PR with the unwanted commit removed.

@dillaman dillaman changed the title from Fix rbd unit test case w/ STRIPINGV2 to test: fix rbd unit test cases w/ striping feature Feb 28, 2017

@dillaman dillaman merged commit c099bb7 into ceph:master Feb 28, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment