Skip to content

Commit

Permalink
Update tokio-uring (#43)
Browse files Browse the repository at this point in the history
Fixes some issues created by monoio integration and updates kioto-uring-executor.
  • Loading branch information
kaimast authored Jan 19, 2025
1 parent 4a3db7e commit bb3f333
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install rustc and clippy nightly
Expand Down
10 changes: 6 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,13 @@ tokio-condvar = { version="0.3", features=["parking_lot"] }
tokio-uring = { version="0.5", optional=true }
bloomfilter = { version="3", optional=true }
monoio = { version="0.2", optional=true, features=["sync"] }
kioto-uring-executor = { version="0.2", optional=true }

[dependencies.tokio]
version="1"
default-features=false
features=["io-util", "sync", "macros", "tracing", "time"]

[dependencies.tokio-uring-executor]
package="kioto-uring-executor"
git="https://github.com/kaimast/kioto-uring-executor.git"
branch="shutdown"
# version="0.1"
optional=true

[dev-dependencies]
clap = { version="4", features=["derive"] }
env_logger = "0.11"
Expand All @@ -57,7 +51,7 @@ monoio = ["dep:monoio", "_async-io"]
snappy-compression = ["dep:snap"]
wisckey = []
bloom-filters = ["dep:bloomfilter"]
tokio-uring = ["dep:tokio-uring", "dep:tokio-uring-executor", "_async-io"]
tokio-uring = ["dep:tokio-uring", "dep:kioto-uring-executor", "_async-io"]
_async-io = []

[[test]]
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async fn bench_init(args: &Args) -> (TempDir, Database) {
(tmp_dir, database)
}

#[cfg_attr(feature = "tokio-uring", tokio_uring_executor::main)]
#[cfg_attr(feature = "tokio-uring", kioto_uring_executor::main)]
#[cfg_attr(feature = "monoio", monoio::main)]
#[cfg_attr(not(feature = "_async-io"), tokio::main)]
async fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/data_blocks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ mod tests {
use tempfile::tempdir;

#[cfg(feature = "tokio-uring")]
use tokio_uring_executor::test as async_test;
use kioto_uring_executor::test as async_test;

#[cfg(feature = "monoio")]
use monoio::test as async_test;
Expand Down
2 changes: 1 addition & 1 deletion src/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ mod tests {
use tempfile::TempDir;

#[cfg(feature = "tokio-uring")]
use tokio_uring_executor::test as async_test;
use kioto_uring_executor::test as async_test;

#[cfg(feature = "monoio")]
use monoio::test as async_test;
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ mod tests {
use tempfile::tempdir;

#[cfg(feature = "tokio-uring")]
use tokio_uring_executor::test as async_test;
use kioto_uring_executor::test as async_test;

#[cfg(feature = "monoio")]
use monoio::test as async_test;
Expand Down
2 changes: 1 addition & 1 deletion src/sorted_table/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::manifest::Manifest;
use tempfile::tempdir;

#[cfg(feature = "tokio-uring")]
use tokio_uring_executor::test as async_test;
use kioto_uring_executor::test as async_test;

#[cfg(feature = "monoio")]
use monoio::test as async_test;
Expand Down
6 changes: 3 additions & 3 deletions src/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl TaskManager {
let level_update_cond = Arc::new(UpdateCond::new());

#[cfg(feature = "tokio-uring")]
let mut spawn_pos = tokio_uring_executor::SpawnPos::default();
let mut spawn_pos = kioto_uring_executor::new_spawn_ring();

{
let memtable_update_cond = Arc::new(UpdateCond::new());
Expand All @@ -201,7 +201,7 @@ impl TaskManager {
cfg_if::cfg_if! {
if #[cfg(feature="tokio-uring")] {
unsafe {
tokio_uring_executor::unsafe_spawn_at(spawn_pos.get(), task);
kioto_uring_executor::unsafe_spawn_at(spawn_pos.get(), task);
spawn_pos.advance();
}
} else if #[cfg(feature="monoio")] {
Expand Down Expand Up @@ -235,7 +235,7 @@ impl TaskManager {
cfg_if::cfg_if! {
if #[cfg(feature="tokio-uring")] {
unsafe {
tokio_uring_executor::unsafe_spawn_at(spawn_pos.get(), task);
kioto_uring_executor::unsafe_spawn_at(spawn_pos.get(), task);
spawn_pos.advance();
}
} else if #[cfg(feature="monoio")] {
Expand Down
2 changes: 1 addition & 1 deletion src/values/tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[cfg(feature = "tokio-uring")]
use tokio_uring_executor::test as async_test;
use kioto_uring_executor::test as async_test;

#[cfg(feature = "monoio")]
use monoio::test as async_test;
Expand Down
4 changes: 2 additions & 2 deletions src/wal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl WriteAheadLog {
}
} else if #[cfg(feature = "_async-io")] {
unsafe {
tokio_uring_executor::unsafe_spawn(async move {
kioto_uring_executor::unsafe_spawn(async move {
let mut writer = WalWriter::new(params).await;
loop {
let done = writer.update_log(&inner).await;
Expand Down Expand Up @@ -267,7 +267,7 @@ impl WriteAheadLog {
cfg_if::cfg_if! {
if #[cfg(feature = "tokio-uring")] {
unsafe {
tokio_uring_executor::unsafe_spawn(async move {
kioto_uring_executor::unsafe_spawn(async move {
let mut writer = WalWriter::continue_from(position, params).await;
loop {
let done = writer.update_log(&inner).await;
Expand Down
2 changes: 1 addition & 1 deletion src/wal/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tempfile::TempDir;
use super::*;

#[cfg(feature = "tokio-uring")]
use tokio_uring_executor::test as async_test;
use kioto_uring_executor::test as async_test;

#[cfg(feature = "monoio")]
use monoio::test as async_test;
Expand Down
2 changes: 1 addition & 1 deletion tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use lsm::{Database, Params, StartMode, WriteBatch, WriteOptions};
const SM: StartMode = StartMode::CreateOrOverride;

#[cfg(feature = "tokio-uring")]
use tokio_uring_executor::test as async_test;
use kioto_uring_executor::test as async_test;

#[cfg(feature = "monoio")]
use monoio::test as async_test;
Expand Down
2 changes: 1 addition & 1 deletion tests/reopen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use tempfile::{Builder, TempDir};
use futures::stream::StreamExt;

#[cfg(feature = "tokio-uring")]
use tokio_uring_executor::test as async_test;
use kioto_uring_executor::test as async_test;

#[cfg(feature = "monoio")]
use monoio::test as async_test;
Expand Down

0 comments on commit bb3f333

Please sign in to comment.