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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ]
|
jenkins test api |
chrisphoffman
approved these changes
Oct 14, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport #45628 and #48301 to quincy.