Project

General

Profile

Actions

Bug #20110

closed

RBD aio_ API does not provide awaiting of any completion from a list.

Added by Марк Коренберг almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Suppose I want to copy RBD image in parallel 10 streams. Well, I can run 10 aio_read() functions and associate them with 10 completions respectively. Next I want to wait until any of them is complete to run another read operation (to keep 10 running streams reading).

This is impossible now without using of threads. But what is purpose of these aio functions if I have to use threads ?

Other async frameworks (Python's asyncio, tornado, twisted, also Nodejs) have such functions. But CEPH does not.

So, I want to have function that will wait until all scheduled aio operations are complete. This function should also wait for aio operations that was added from callbacks associated with operations it waits for.

Another way is to have function that receives an array of completions and returns which one has completed.

Ideally, with optional timeout.

Actions #1

Updated by Nathan Cutler almost 7 years ago

  • Project changed from Ceph to rbd
Actions #2

Updated by Jason Dillaman almost 7 years ago

  • Status changed from New to Need More Info

@Марк: I am probably not understanding your goal, but since you can associate a callback with a completion, and said callback can kick off a new IO if desired, there really shouldn't be any need for multiple threads for high-queue depth IO.

Actions #3

Updated by Марк Коренберг almost 7 years ago

So, how should I wait for whole transfer completion?

What is the difference between rbd_read2() and rbd_aio_read2()+rbd_aio_wait_for_complete() ? If I want to track more than one AIO operation simultaneously, I should create threads. But if I use threads, I can use rbd_read2() directly.

The main idea: If we have abstract AIO operations, we should have some event loop. This mean waiting for ANY event (or timer) from multiple streams. Today, we have no such thing.

About kicking additional IO from callbacks -- Yes, I already done that. But it is proven, that callback-chains is very bad pattern. Thiat's why all modern asynchronous frameworks hav "await" functionality.

Please don't close the bug, I will say more if it is required.

Actions #4

Updated by Jason Dillaman almost 7 years ago

@Марк: can you provide an example? Your ticket description clearly states "next I want to wait until any of them is complete to run another read operation" which you can do via the AIO completion callback. You can either have your callback directly kick off the next IO operation or have your callback decrement a counter and signal a condition variable to wake up your paused main thread (which is what the rbd CLI does when using AIO for import/export/benchmark).

I am not saying this is invalid and will be closed, but perhaps it's just very low priority unless you would like to contribute a PR for this feature.

Actions #5

Updated by Jason Dillaman over 6 years ago

  • Status changed from Need More Info to Closed

Closing due to lack of input. Please re-open if data can be provided.

Actions

Also available in: Atom PDF