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

osd,librados: cmpext support #14715

Merged
merged 5 commits into from Apr 26, 2017

Conversation

Projects
None yet
5 participants
@wangzhengyong
Contributor

wangzhengyong commented Apr 21, 2017

This is a follow up to pr 14071
The patch-set carries @ddiss and @mikechristie 's implementation of OSD cmpext support,
The librados API and testcase
According to the result of the conversationabove, I rebase the code on @ddiss 's repo, simply the librados API

@ddiss

This comment has been minimized.

Contributor

ddiss commented Apr 21, 2017

@wangzhengyong could you please rebase against my latest push to #14071 - it includes the new (-1000 - miscompare_off) API, and reworks the tests atop that.

@liewegas liewegas added the needs-qa label Apr 25, 2017

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Apr 25, 2017

@wangzhengyong your signed-off-by lines do not look right, it could be

Signed-off-by: Zhengyong Wang <wangzhengyong@cmss.chinamobile.com>

if you like.

wangzhengyong added some commits Apr 21, 2017

ceph osd: add support for new op cmpext
This adds support for a new op cmpext. The request will read
extent.length bytes and compare them to extent.length bytes at
extent.offset on disk. return 0 on success, negative error code
on failure, (-MAX_ERRNO - mismatch_off) on mismatch

rbd will use this in a multi op request to implement the
SCSI COMPARE_AND_WRITE request which is used by VMware for
its atomic test and set request.

Signed-off-by: Zhengyong Wang <wangzhengyong@cmss.chinamobile.com>
Signed-off-by: Mike Christie <mchristi@redhat.com>
[ddiss@suse.de: ReplicatedPG -> PrimaryLogPG]
Reviewed-by: David Disseldorp <ddiss@suse.de>
ceph_test_rados_api_misc: add cmpext tests
Signed-off-by: Zhengyong Wang <wangzhengyong@cmss.chinamobile.com>
Signed-off-by: Mike Christie <mchristi@redhat.com>
[ddiss@suse.de: add rados_cmpext() test coverage]
Reviewed-by: David Disseldorp <ddiss@suse.de>
librados: add cmpext API
The compare-extent (cmpext) operation allows callers to compare existing
object contents with an arbitrary buffer. cmpext requests can be
compounded with read and write operations, allowing for atomic object
content updates. return 0 on success, negative error code
on failure, (-MAX_ERRNO - mismatch_off) on mismatch

This commit is based on Mike Christie's initial C++ API, with the
addition of AIO support and a C API. Response marshalling was also
reworked, so that the miscompare offset is unmarshalled transparently to
the caller.

Signed-off-by: Zhengyong Wang <wangzhengyong@cmss.chinamobile.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
ceph_test_rados_api_aio: add cmpext tests
Write a buffer and compare it with a matching and non-matching buffer
via cmpext. Do this using rados_aio_cmpext(), ioctx.aio_cmpext() and
ioctx.aio_operate(op.cmpext())

Signed-off-by: Zhengyong Wang <wangzhengyong@cmss.chinamobile.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
test/librados/c_operations: add cmpext tests
Dispatch compare-and-read and compare-and-write compound requests, and
confirm expected behaviour under compare and miscompare conditions.

Signed-off-by: Zhengyong Wang <wangzhengyong@cmss.chinamobile.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
@wangzhengyong

This comment has been minimized.

Contributor

wangzhengyong commented Apr 26, 2017

@tchaikov thx, I have already modified

@yuriw yuriw merged commit 5129e0f into ceph:master Apr 26, 2017

3 of 4 checks passed

arm build Build triggered. sha1 is merged.
Details
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