-
Notifications
You must be signed in to change notification settings - Fork 213
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
refactor(executor): experimental support of cancellable query execution. #467
refactor(executor): experimental support of cancellable query execution. #467
Conversation
4ff0c15
to
8a2bc7d
Compare
src/executor/mod.rs
Outdated
@@ -114,20 +120,89 @@ pub type BoxedExecutor = BoxStream<'static, Result<DataChunk, ExecutorError>>; | |||
/// The builder of executor. | |||
#[derive(Clone)] | |||
pub struct ExecutorBuilder { | |||
context: Arc<Context>, | |||
storage: StorageImpl, | |||
} | |||
|
|||
impl ExecutorBuilder { | |||
/// Create a new executor builder. | |||
pub fn new(storage: StorageImpl) -> ExecutorBuilder { |
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.
Do we even need the method now?
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.
Not really, just for backward compatibility. Remove it should be nicer.
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.
Great work! Generally LGTM, but it seems that we may need some more comments.
And please resolve conflicts. |
Signed-off-by: arkbriar <arkbriar@gmail.com>
Signed-off-by: TennyZhuang <zty0826@gmail.com>
Signed-off-by: TennyZhuang <zty0826@gmail.com>
Signed-off-by: arkbriar <arkbriar@gmail.com>
Signed-off-by: arkbriar <arkbriar@gmail.com>
Signed-off-by: arkbriar <arkbriar@gmail.com>
edcc796
to
bf1f57d
Compare
Thanks @TennyZhuang . I am greatly encouraged. I added more commends/docs on Also, 4 more executors (insert/delete, copy from/to file) are refactored and they are all cancellable now. The leaf executors are all cancellable and I think we can interrupt any query from now on.
All conflicts should be resolved now. Please review this again when you have time. |
Thanks! I think it’s good enough to merge! |
I'm going to close #422 because it's far more complicated to interrupt a query and make things right when a query is cancelled, such as aborting/rolling back transactions and cleaning up spawned tasks.
This PR is not only to #423. Here're the main contributions of this PR:
cancellable
to provide the cancellation of executors and integrates it inside the executor tree.Here I only include the cancellation of
TableScanExecutor
in this PR. However, the others (e.g. insert/delete/copy) can be supported in the same fashion.Now you can interrupt a select query in the CLI at any time as you type the CTRL-C. The transactions shall be dealt properly.
To show the debug messages below, please run with
RUST_LOG=risinglight=debug cargo run --release
.