Skip to content

Commit

Permalink
Merge remote-tracking branch 'tikv/master' into merge-tikv-near-7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinNeo committed Aug 28, 2023
2 parents 2c7dc1a + e0e1ccc commit fc22225
Show file tree
Hide file tree
Showing 163 changed files with 17,378 additions and 1,321 deletions.
5 changes: 5 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Code of Conduct

We follow the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).

Please contact the [CNCF Code of Conduct Committee](mailto:[email protected]) in order to report violations of the Code of Conduct.
39 changes: 28 additions & 11 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tikv"
version = "7.3.0-alpha"
version = "7.4.0-alpha"
authors = ["The TiKV Authors"]
description = "A distributed transactional key-value database powered by Rust and Raft"
license = "Apache-2.0"
Expand Down Expand Up @@ -203,7 +203,7 @@ backtrace = { git = 'https://github.com/hehechen/backtrace-rs', branch = "v0.3.6
sysinfo = { git = "https://github.com/tikv/sysinfo", branch = "0.26-fix-cpu" }

[target.'cfg(target_os = "linux")'.dependencies]
procinfo = { git = "https://github.com/tikv/procinfo-rs", rev = "6599eb9dca74229b2c1fcc44118bef7eff127128" }
procinfo = { git = "https://github.com/tikv/procinfo-rs", rev = "7693954bd1dd86eb1709572fd7b62fd5f7ff2ea1" }
# When you modify TiKV cooperatively with kvproto, this will be useful to submit the PR to TiKV and the PR to
# kvproto at the same time.
# After the PR to kvproto is merged, remember to comment this out and run `cargo update -p kvproto`.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ unset-override:

pre-format: unset-override
@rustup component add rustfmt
@cargo install --force -q cargo-sort
@cargo install --force --locked -q cargo-sort

pre-format-fast: unset-override
@rustup component add rustfmt
Expand Down
1 change: 1 addition & 0 deletions cmd/tikv-ctl/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ pub enum Cmd {
/// hex end key
end: String,
},
/// Get the state of a region's RegionReadProgress.
GetRegionReadProgress {
#[structopt(short = "r", long)]
/// The target region id
Expand Down
35 changes: 20 additions & 15 deletions cmd/tikv-ctl/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::{
borrow::ToOwned, cmp::Ordering, path::Path, pin::Pin, result, str, string::ToString, sync::Arc,
time::Duration, u64,
time::Duration,
};

use api_version::{ApiV1, KvFormat};
Expand Down Expand Up @@ -83,9 +83,9 @@ pub fn new_debug_executor(
data_dir: Option<&str>,
host: Option<&str>,
mgr: Arc<SecurityManager>,
) -> Box<dyn DebugExecutor> {
) -> Box<dyn DebugExecutor + Send> {
if let Some(remote) = host {
return Box::new(new_debug_client(remote, mgr)) as Box<dyn DebugExecutor>;
return Box::new(new_debug_client(remote, mgr)) as Box<_>;
}

// TODO: perhaps we should allow user skip specifying data path.
Expand Down Expand Up @@ -128,7 +128,7 @@ pub fn new_debug_executor(
let debugger: DebuggerImpl<_, MockEngine, MockLockManager, ApiV1> =
DebuggerImpl::new(Engines::new(kv_db, raft_db), cfg_controller, None);

Box::new(debugger) as Box<dyn DebugExecutor>
Box::new(debugger) as Box<_>
} else {
let mut config = cfg.raft_engine.config();
config.dir = cfg.infer_raft_engine_path(Some(data_dir)).unwrap();
Expand All @@ -146,14 +146,14 @@ pub fn new_debug_executor(

let debugger: DebuggerImpl<_, MockEngine, MockLockManager, ApiV1> =
DebuggerImpl::new(Engines::new(kv_db, raft_db), cfg_controller, None);
Box::new(debugger) as Box<dyn DebugExecutor>
Box::new(debugger) as Box<_>
}
EngineType::RaftKv2 => {
let registry =
TabletRegistry::new(Box::new(factory), Path::new(data_dir).join("tablets"))
.unwrap_or_else(|e| fatal!("failed to create tablet registry {:?}", e));
let debugger = DebuggerImplV2::new(registry, raft_db, cfg_controller);
Box::new(debugger) as Box<dyn DebugExecutor>
Box::new(debugger) as Box<_>
}
}
}
Expand Down Expand Up @@ -1008,15 +1008,20 @@ impl DebugExecutor for DebugClient {
),
("paused", resp.get_region_read_progress_paused().to_string()),
("discarding", resp.get_discard().to_string()),
// TODO: figure out the performance impact here before implementing it.
// (
// "duration to last update_safe_ts",
// format!("{} ms", resp.get_duration_to_last_update_safe_ts_ms()),
// ),
// (
// "duration to last consume_leader_info",
// format!("{} ms", resp.get_duration_to_last_consume_leader_ms()),
// ),
(
"duration since resolved-ts last called update_safe_ts()",
match resp.get_duration_to_last_update_safe_ts_ms() {
u64::MAX => "none".to_owned(),
x => format!("{} ms", x),
},
),
(
"duration to last consume_leader_info()",
match resp.get_duration_to_last_consume_leader_ms() {
u64::MAX => "none".to_owned(),
x => format!("{} ms", x),
},
),
("Resolver:", "".to_owned()),
("exist", resp.get_resolver_exist().to_string()),
("resolved_ts", resp.get_resolved_ts().to_string()),
Expand Down
Loading

0 comments on commit fc22225

Please sign in to comment.