From f26dba01ca5f253418bf7e1bf3852847afcd6818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=82=8E=E6=B3=BC?= Date: Thu, 25 Apr 2024 22:33:08 +0800 Subject: [PATCH] refactor: Upgrade Openraft to 0.9.7 (#15339) This update includes a fix for excessive log scanning during startup to locate the membership configuration. See: https://github.com/datafuselabs/openraft/commit/14d42e4f33581dc0ea9c4eeaf0ff00ebec85dbb2 --- Cargo.lock | 10 ++++++---- Cargo.toml | 4 ++-- src/meta/types/src/raft_types.rs | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ffd5815dafd..c894367175c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10106,9 +10106,9 @@ dependencies = [ [[package]] name = "openraft" -version = "0.9.1" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "863a31dad5014893c47cdb4291c1f14cd901304b548c739004307fdd2cd37454" +checksum = "7bb93143b31c03885eadbd8b2d1bb63c250302113618d8c0db647ab49171736f" dependencies = [ "anyerror", "byte-unit", @@ -10128,12 +10128,14 @@ dependencies = [ [[package]] name = "openraft-macros" -version = "0.9.1" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f384d67b15e283f1cf6bb778c8f29ab2f8e8729b4bc82e8a1c21f2bf767d60" +checksum = "c468091464f0b38c1c1a9ec72a1e582c46cf4b861b6e0c214da4c6fd96b60358" dependencies = [ + "chrono", "proc-macro2", "quote", + "semver", "syn 2.0.52", ] diff --git a/Cargo.toml b/Cargo.toml index 231792581345..1055700c8790 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,8 +121,8 @@ opendal = { version = "0.45.1", features = [ sled = { git = "https://github.com/datafuse-extras/sled", tag = "v0.34.7-datafuse.1", default-features = false } # openraft for debugging -# openraft = { git = "https://github.com/datafuselabs/openraft", tag = "v0.9.0", features = [ -openraft = { version = "0.9.1", features = [ +#openraft = { git = "https://github.com/drmingdrmer/openraft", branch = "release-0.9", features = [ +openraft = { version = "0.9.7", features = [ "serde", "tracing-log", "generic-snapshot-data", diff --git a/src/meta/types/src/raft_types.rs b/src/meta/types/src/raft_types.rs index 54c73736057e..30ae99ecabdc 100644 --- a/src/meta/types/src/raft_types.rs +++ b/src/meta/types/src/raft_types.rs @@ -14,6 +14,7 @@ //! This mod wraps openraft types that have generics parameter with concrete types. +use openraft::impls::OneshotResponder; use openraft::RaftTypeConfig; use openraft::TokioRuntime; @@ -36,6 +37,7 @@ impl RaftTypeConfig for TypeConfig { type Entry = openraft::entry::Entry; type SnapshotData = SnapshotData; type AsyncRuntime = TokioRuntime; + type Responder = OneshotResponder; } pub type CommittedLeaderId = openraft::CommittedLeaderId;