Re: blueprint: consistency groups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I was writing unit tests for create_cg function when I realized that
it wouldn't recover if we lost connection between
cls_client::dir_add_cg and create_cg object. If create_cg doesn't
happen then we are unable to repeat dir_add_cg.
However since I implemented create_cg operation after create_image
operation. create_image operation has the same issue.

So, my question is. Should I reimplement create_cg so that it can
recover from connection loss to the cluster or should I keep it the
same way create_image is implemented?

Also, what is more preferable big pull request for all components of
the feature - CRUD for consistency groups and snapshots, or split it
into smaller pull requests - first merge CRUD operations then
implement snapshots?

Thanks,
V.

On Tue, May 3, 2016 at 5:29 PM, Jason Dillaman <jdillama@xxxxxxxxxx> wrote:
> You can use the explicit constructor of librados::Rados to convert
> from a librados::IoCtx [1].  Once you have the Rados object, use
> librados::Rados::ioctx_create2 to create a new librados::IoCtx [2].
> Here is the example from the snap unprotect state machine [3].
>
> [1] https://github.com/ceph/ceph/blob/master/src/include/rados/librados.hpp#L1145
> [2] https://github.com/ceph/ceph/blob/master/src/include/rados/librados.hpp#L1187
> [3] https://github.com/ceph/ceph/blob/master/src/librbd/operation/SnapshotUnprotectRequest.cc#L73
>
> On Tue, May 3, 2016 at 5:48 PM, Victor Denisov <vdenisov@xxxxxxxxxxxx> wrote:
>> Jason,
>>
>> Can you point me to a specific line of code where you reuse Rados?
>> I see that IoCtx only has reference to RadosClient not to Rados itself.
>>
>> On Tue, May 3, 2016 at 5:05 AM, Jason Dillaman <jdillama@xxxxxxxxxx> wrote:
>>> On Mon, May 2, 2016 at 8:26 PM, Victor Denisov <vdenisov@xxxxxxxxxxxx> wrote:
>>>> As such, I can't open another ioctx when I'm already inside rbd
>>>> class.
>>>
>>> You actually can open a new IoCtx against a new pool -- we do this
>>> internally for journaling handling, scanning pools for children during
>>> the snapshot unprotect operation, opening a parent image of a clone,
>>> etc.   You can extract the "librados::Rados" object from the
>>> "librados::IoCtx" and then use "librados::Rados::ioctx_create2" to
>>> create a new IoCtx by pool id.
>>>
>>> Also agree with Mykola in that the API should return resolved image names.
>>>
>>> --
>>> Jason
>
>
>
> --
> Jason
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux