Repository navigation
librbd: async version of metadata_set/remove - #37121
Conversation
|
@dillaman Please help to have a look, thank you. |
2c79fe9 to
f31e946
Compare
|
@dillaman updated, please have a look. thx. |
1c98178 to
e2bc58f
Compare
In iSCSI scenario (via tcmu-runner), after a client has acquired exclusive
lock on an image, users will no longer be able to set metadata on the image.
This commit try to fix it by forward the request to the lock owner.
Steps to reproduce:
1. Client A:
```
>>> import rbd, rados;client=rados.Rados(conffile='');client.connect();ioctx=client.open_ioctx('rbd');rbd_inst=rbd.RBD();image=rbd.Image(ioctx, 'img1')
>>> from rbd import RBD_LOCK_MODE_EXCLUSIVE
>>> image.lock_acquire(RBD_LOCK_MODE_EXCLUSIVE)
>>>
```
2. Client B:
```
$ rbd image-meta set img1 conf_rbd_qos_iops_limit 10000
2020-09-12T15:19:58.325+0800 7f161affd700 -1 librbd::ManagedLock: 0x7f15f4001d48 handle_acquire_lock: failed to acquire exclusive lock:(30) Read-only file system
failed to set metadata conf_rbd_qos_iops_limit of image : (30) Read-only file system
rbd: setting metadata failed: (30) Read-only file system
$
```
Signed-off-by: songweibin <[email protected]>
e2bc58f to
7bc663d
Compare
|
Hi, @dillaman, thanks for your review. |
Does it really matter that it takes more than one op? How would you set multiple key/value pairs from the CLI? |
Indeed, setting up multiple key/value pairs from the CLI is a bit complicated, perhaps like this? — rbd image-meta set pool/image k1=val1 k2=val2 k3=val3 |
| } | ||
| r = invoke_async_request("metadata_set", | ||
| exclusive_lock::OPERATION_REQUEST_TYPE_GENERAL, | ||
| true, |
There was a problem hiding this comment.
@dillaman Oops, I think there is a mistake here, it should be false? So the python API could not permit to update metadata via snapshot.
There was a problem hiding this comment.
I don't think it was restricted before (was it?) since the metadata applies to both snapshots and the image HEAD revision.
There was a problem hiding this comment.
@dillaman Yeah, it was.
We noticed that if the journaling feature is enabled, the event that update metadata is recorded.
However, the event is not recorded if updated via snapshot. Is this going to be a problem?
Thank you.
There was a problem hiding this comment.
Ah, ok. Can you open a new PR to address this?
I personally don't see the value of adding a new API to support multiple key/value metadata pairs when you can continue to just set them individually. If there is a bug in QoS where it acts badly for the short period of time when you change the QoS settings, that should be fixed regardless. |
Fixes: ceph#37121 Signed-off-by: songweibin <[email protected]>
Fixes: ceph/ceph#37121 Signed-off-by: songweibin <[email protected]>
Fixes: ceph/ceph#37121 Signed-off-by: songweibin <[email protected]>
In iSCSI scenario (via tcmu-runner), after a client has acquired exclusive
lock on an image, users will no longer be able to set metadata on the image.
This commit try to fix it by forward the request to the lock owner.
Steps to reproduce:
1. Client A:
```
>>> import rbd, rados;client=rados.Rados(conffile='');client.connect();ioctx=client.open_ioctx('rbd');rbd_inst=rbd.RBD();image=rbd.Image(ioctx, 'img1')
>>> from rbd import RBD_LOCK_MODE_EXCLUSIVE
>>> image.lock_acquire(RBD_LOCK_MODE_EXCLUSIVE)
>>>
```
2. Client B:
```
$ rbd image-meta set img1 conf_rbd_qos_iops_limit 10000
2020-09-12T15:19:58.325+0800 7f161affd700 -1 librbd::ManagedLock: 0x7f15f4001d48 handle_acquire_lock: failed to acquire exclusive lock:(30) Read-only file system
failed to set metadata conf_rbd_qos_iops_limit of image : (30) Read-only file system
rbd: setting metadata failed: (30) Read-only file system
$
```
Signed-off-by: songweibin <[email protected]>
(cherry picked from commit 7bc663d)
(cherry picked from commit ceph/ceph#37121
and ceph/ceph#37417)
Signed-off-by: songweibin <[email protected]>
Change-Id: I82c615cb65c3a604f7ef955d83a011717fc02413
In iSCSI scenario (via tcmu-runner), after a client has acquired exclusive
lock on an image, users will no longer be able to set metadata on the image.
This commit try to fix it by forward the request to the lock owner.
Steps to reproduce:
1. Client A:
```
>>> import rbd, rados;client=rados.Rados(conffile='');client.connect();ioctx=client.open_ioctx('rbd');rbd_inst=rbd.RBD();image=rbd.Image(ioctx, 'img1')
>>> from rbd import RBD_LOCK_MODE_EXCLUSIVE
>>> image.lock_acquire(RBD_LOCK_MODE_EXCLUSIVE)
>>>
```
2. Client B:
```
$ rbd image-meta set img1 conf_rbd_qos_iops_limit 10000
2020-09-12T15:19:58.325+0800 7f161affd700 -1 librbd::ManagedLock: 0x7f15f4001d48 handle_acquire_lock: failed to acquire exclusive lock:(30) Read-only file system
failed to set metadata conf_rbd_qos_iops_limit of image : (30) Read-only file system
rbd: setting metadata failed: (30) Read-only file system
$
```
Signed-off-by: songweibin <[email protected]>
(cherry picked from commit 7bc663d)
(cherry picked from commit ceph/ceph#37121
and ceph/ceph#37417)
Signed-off-by: songweibin <[email protected]>
Change-Id: I82c615cb65c3a604f7ef955d83a011717fc02413
In iSCSI scenario (via tcmu-runner), after a client has acquired exclusive
lock on an image, users will no longer be able to set metadata on the image.
This commit try to fix it by forward the request to the lock owner.
Step to reproduce:
Signed-off-by: songweibin [email protected]
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox