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

quincy: librbd: compare-and-write fixes and vector C API #48474

Merged
merged 9 commits into from Oct 17, 2022

Conversation

idryomov
Copy link
Contributor

Backport #45628 and #48301 to quincy.

PepperJo and others added 9 commits October 13, 2022 13:11
Test correct mismatch offset is returned.
Test no data is written when compare fails.
Test correct data is written when compare succeeds.

Signed-off-by: Jonas Pfefferle <pepperjo@japf.ch>
(cherry picked from commit 3eb7ac6)
This patch removes the compare and write max sector size len
restriction. We can allow up to stripe unit size accesses if
the access is aligned properly.
To allow larger size compare and write requests in the
journal we split the buffers like we do for writes now.

Signed-off-by: Jonas Pfefferle <pepperjo@japf.ch>
(cherry picked from commit d80cff0)
The compare and write C++ API (both sync and async) does not check
compare bufferlist length and executes compare ops of bufferlist length
size, even if (write) "len" is smaller than bufferlist length.
This patch changes this behavior by always issuing compares and
writes of "len" size to match the C API. The bufferlist length
can be greater than "len" for both compare and write but only
"len" bytes are compared and written. If the bufferlist length
is smaller than "len" the call will fail.

Signed-off-by: Jonas Pfefferle <pepperjo@japf.ch>
(cherry picked from commit af96e6d)
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 4ddcb7f)

Conflicts:
	PendingReleaseNotes [ moved to >=17.2.5 section ]
Otherwise this is obviously broken with rbd_cache_policy = writeback or
rbd_cache_policy = writethrough as the write is done on the OSD, beneath
ObjectCacher.  This went unnoticed because the original (and so far the
only known) compare-and-write user, tcmu-runner rbd driver, disables the
cache altogether.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit ec0fc71)
cmp_bl can no longer be shorter than read_bl (i.e. image extent).
This is caught very early at the API level, see commit af96e6d
("librbd: make C++ cmp&write semantics equal to C API").

However, cmp_bl can still be longer than read_bl and in that case
it should be capped by the image extent length.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 35f3ccb)
- missing EILSEQ asserts in IO and IOWithIOHint
- AioCompletion leak in CompareTooSmall and WriteTooSmall
- skip StripeUnitUnaligned and TooLarge on the PWL cache as it wasn't
  limited by the 512-byte sector limit before and isn't limited by the
  stripe unit limit now

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 093e823)
Add compare and write vector C API.
Require cmp_iov and write_iov to be the same length.

Signed-off-by: Jonas Pfefferle <pepperjo@japf.ch>
(cherry picked from commit 60fd534)
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit bd98a66)

Conflicts:
	PendingReleaseNotes [ moved to >=17.2.5 section ]
@idryomov
Copy link
Contributor Author

jenkins test api

Copy link
Contributor

@chrisphoffman chrisphoffman left a comment

Choose a reason for hiding this comment

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

LGTM

@idryomov idryomov merged commit 2851e0e into ceph:quincy Oct 17, 2022
11 checks passed
@idryomov idryomov deleted the wip-librbd-cmp-write-quincy branch October 17, 2022 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants