diff --git a/Cargo.lock b/Cargo.lock index f79acbe068e..bd995cb05be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2629,7 +2629,7 @@ dependencies = [ [[package]] name = "kvproto" version = "0.0.2" -source = "git+https://github.com/pingcap/kvproto.git#0e2f26c0a46ae7d666d6ca4410046a39e0c96f36" +source = "git+https://github.com/pingcap/kvproto.git#d88fa382391ec305e879be7635e39beae6a19890" dependencies = [ "futures 0.3.15", "grpcio", @@ -2758,7 +2758,7 @@ dependencies = [ [[package]] name = "librocksdb_sys" version = "0.1.0" -source = "git+https://github.com/tikv/rust-rocksdb.git#de8310c3983a30236ea03f802ed0c2401a4908ae" +source = "git+https://github.com/tikv/rust-rocksdb.git#2e00e78b945194e8a672e8e078b6c73956e9ace0" dependencies = [ "bindgen 0.57.0", "bzip2-sys", @@ -2777,7 +2777,7 @@ dependencies = [ [[package]] name = "libtitan_sys" version = "0.0.1" -source = "git+https://github.com/tikv/rust-rocksdb.git#de8310c3983a30236ea03f802ed0c2401a4908ae" +source = "git+https://github.com/tikv/rust-rocksdb.git#2e00e78b945194e8a672e8e078b6c73956e9ace0" dependencies = [ "bzip2-sys", "cc", @@ -3495,18 +3495,30 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.38" +version = "0.10.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" +checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" dependencies = [ "bitflags", "cfg-if 1.0.0", "foreign-types", "libc 0.2.125", "once_cell", + "openssl-macros", "openssl-sys", ] +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "openssl-probe" version = "0.1.2" @@ -3524,9 +3536,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.72" +version = "0.9.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" +checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" dependencies = [ "autocfg", "cc", @@ -4701,7 +4713,7 @@ dependencies = [ [[package]] name = "rocksdb" version = "0.3.0" -source = "git+https://github.com/tikv/rust-rocksdb.git#de8310c3983a30236ea03f802ed0c2401a4908ae" +source = "git+https://github.com/tikv/rust-rocksdb.git#2e00e78b945194e8a672e8e078b6c73956e9ace0" dependencies = [ "libc 0.2.125", "librocksdb_sys", @@ -6182,9 +6194,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-ctl" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb833c46ecbf8b6daeccb347cefcabf9c1beb5c9b0f853e1cec45632d9963e69" +checksum = "e37706572f4b151dff7a0146e040804e9c26fe3a3118591112f05cf12a4216c1" dependencies = [ "libc 0.2.125", "paste", @@ -6193,9 +6205,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.4.3+5.2.1-patched.2" +version = "0.5.1+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1792ccb507d955b46af42c123ea8863668fae24d03721e40cad6a41773dbb49" +checksum = "931e876f91fed0827f863a2d153897790da0b24d882c721a79cb3beb0b903261" dependencies = [ "cc", "fs_extra", @@ -6204,9 +6216,9 @@ dependencies = [ [[package]] name = "tikv-jemallocator" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b7bcecfafe4998587d636f9ae9d55eb9d0499877b88757767c346875067098" +checksum = "20612db8a13a6c06d57ec83953694185a367e16945f66565e8028d2c0bd76979" dependencies = [ "libc 0.2.125", "tikv-jemalloc-sys", @@ -7080,12 +7092,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.4.19+zstd.1.4.8" +version = "2.0.1+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec24a9273d24437afb8e71b16f3d9a5d569193cccdb7896213b59f552f387674" +checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" dependencies = [ "cc", - "glob", - "itertools 0.9.0", "libc 0.2.125", ] diff --git a/components/encryption/src/config.rs b/components/encryption/src/config.rs index 8cb779f1cdc..4f83a72855f 100644 --- a/components/encryption/src/config.rs +++ b/components/encryption/src/config.rs @@ -111,6 +111,7 @@ mod encryption_method_serde { const AES128_CTR: &str = "aes128-ctr"; const AES192_CTR: &str = "aes192-ctr"; const AES256_CTR: &str = "aes256-ctr"; + const SM4_CTR: &str = "sm4-ctr"; #[allow(clippy::trivially_copy_pass_by_ref)] pub fn serialize(method: &EncryptionMethod, serializer: S) -> Result @@ -123,6 +124,7 @@ mod encryption_method_serde { EncryptionMethod::Aes128Ctr => serializer.serialize_str(AES128_CTR), EncryptionMethod::Aes192Ctr => serializer.serialize_str(AES192_CTR), EncryptionMethod::Aes256Ctr => serializer.serialize_str(AES256_CTR), + EncryptionMethod::Sm4Ctr => serializer.serialize_str(SM4_CTR), } } @@ -149,6 +151,7 @@ mod encryption_method_serde { AES128_CTR => Ok(EncryptionMethod::Aes128Ctr), AES192_CTR => Ok(EncryptionMethod::Aes192Ctr), AES256_CTR => Ok(EncryptionMethod::Aes256Ctr), + SM4_CTR => Ok(EncryptionMethod::Sm4Ctr), _ => Err(E::invalid_value(Unexpected::Str(value), &self)), } } diff --git a/components/encryption/src/crypter.rs b/components/encryption/src/crypter.rs index c17560d4a38..b8531d915fc 100644 --- a/components/encryption/src/crypter.rs +++ b/components/encryption/src/crypter.rs @@ -16,6 +16,7 @@ pub fn encryption_method_to_db_encryption_method(method: EncryptionMethod) -> DB EncryptionMethod::Aes128Ctr => DBEncryptionMethod::Aes128Ctr, EncryptionMethod::Aes192Ctr => DBEncryptionMethod::Aes192Ctr, EncryptionMethod::Aes256Ctr => DBEncryptionMethod::Aes256Ctr, + EncryptionMethod::Sm4Ctr => DBEncryptionMethod::Sm4Ctr, EncryptionMethod::Unknown => DBEncryptionMethod::Unknown, } } @@ -26,6 +27,7 @@ pub fn encryption_method_from_db_encryption_method(method: DBEncryptionMethod) - DBEncryptionMethod::Aes128Ctr => EncryptionMethod::Aes128Ctr, DBEncryptionMethod::Aes192Ctr => EncryptionMethod::Aes192Ctr, DBEncryptionMethod::Aes256Ctr => EncryptionMethod::Aes256Ctr, + DBEncryptionMethod::Sm4Ctr => EncryptionMethod::Sm4Ctr, DBEncryptionMethod::Unknown => EncryptionMethod::Unknown, } } @@ -40,6 +42,7 @@ pub fn get_method_key_length(method: EncryptionMethod) -> usize { EncryptionMethod::Aes128Ctr => 16, EncryptionMethod::Aes192Ctr => 24, EncryptionMethod::Aes256Ctr => 32, + EncryptionMethod::Sm4Ctr => 16, unknown => panic!("bad EncryptionMethod {:?}", unknown), } } diff --git a/components/encryption/src/io.rs b/components/encryption/src/io.rs index 6f7d28f61b8..d62542cb16a 100644 --- a/components/encryption/src/io.rs +++ b/components/encryption/src/io.rs @@ -377,6 +377,7 @@ pub fn create_aes_ctr_crypter( EncryptionMethod::Aes128Ctr => OCipher::aes_128_ctr(), EncryptionMethod::Aes192Ctr => OCipher::aes_192_ctr(), EncryptionMethod::Aes256Ctr => OCipher::aes_256_ctr(), + EncryptionMethod::Sm4Ctr => OCipher::sm4_ctr(), }; let crypter = OCrypter::new(cipher, mode, key, Some(iv.as_slice()))?; Ok((cipher, crypter)) @@ -525,6 +526,7 @@ mod tests { EncryptionMethod::Aes128Ctr, EncryptionMethod::Aes192Ctr, EncryptionMethod::Aes256Ctr, + EncryptionMethod::Sm4Ctr, ]; let ivs = [ Iv::new_ctr(), @@ -593,6 +595,7 @@ mod tests { EncryptionMethod::Aes128Ctr, EncryptionMethod::Aes192Ctr, EncryptionMethod::Aes256Ctr, + EncryptionMethod::Sm4Ctr, ]; let mut plaintext = vec![0; 10240]; OsRng.fill_bytes(&mut plaintext); @@ -628,6 +631,7 @@ mod tests { EncryptionMethod::Aes128Ctr, EncryptionMethod::Aes192Ctr, EncryptionMethod::Aes256Ctr, + EncryptionMethod::Sm4Ctr, ]; let mut plaintext = vec![0; 10240]; OsRng.fill_bytes(&mut plaintext); @@ -700,6 +704,7 @@ mod tests { EncryptionMethod::Aes128Ctr, EncryptionMethod::Aes192Ctr, EncryptionMethod::Aes256Ctr, + EncryptionMethod::Sm4Ctr, ]; let iv = Iv::new_ctr(); let mut plain_text = vec![0; 10240]; diff --git a/components/engine_rocks/src/encryption.rs b/components/engine_rocks/src/encryption.rs index a8ec54673b3..94c13e811a9 100644 --- a/components/engine_rocks/src/encryption.rs +++ b/components/engine_rocks/src/encryption.rs @@ -64,6 +64,7 @@ fn convert_encryption_method(input: EncryptionMethod) -> DBEncryptionMethod { EncryptionMethod::Aes128Ctr => DBEncryptionMethod::Aes128Ctr, EncryptionMethod::Aes192Ctr => DBEncryptionMethod::Aes192Ctr, EncryptionMethod::Aes256Ctr => DBEncryptionMethod::Aes256Ctr, + EncryptionMethod::Sm4Ctr => DBEncryptionMethod::Sm4Ctr, EncryptionMethod::Unknown => DBEncryptionMethod::Unknown, } } diff --git a/components/engine_rocks/src/options.rs b/components/engine_rocks/src/options.rs index c1610f64224..eca2a9ed33a 100644 --- a/components/engine_rocks/src/options.rs +++ b/components/engine_rocks/src/options.rs @@ -16,7 +16,7 @@ impl RocksReadOptions { impl From for RocksReadOptions { fn from(opts: engine_traits::ReadOptions) -> Self { let mut r = RawReadOptions::default(); - r.fill_cache(opts.fill_cache()); + r.set_fill_cache(opts.fill_cache()); RocksReadOptions(r) } } @@ -59,7 +59,7 @@ impl From for RocksReadOptions { fn build_read_opts(iter_opts: engine_traits::IterOptions) -> RawReadOptions { let mut opts = RawReadOptions::new(); - opts.fill_cache(iter_opts.fill_cache()); + opts.set_fill_cache(iter_opts.fill_cache()); opts.set_max_skippable_internal_keys(iter_opts.max_skippable_internal_keys()); if iter_opts.key_only() { opts.set_titan_key_only(true); diff --git a/components/engine_rocks/src/sst.rs b/components/engine_rocks/src/sst.rs index 58f300a8ec2..df0c2c26dfa 100644 --- a/components/engine_rocks/src/sst.rs +++ b/components/engine_rocks/src/sst.rs @@ -222,9 +222,15 @@ impl SstWriterBuilder for RocksSstWriterBuilder { }; // TODO: 0 is a valid value for compression_level if self.compression_level != 0 { - // other three fields are default value. - // see: https://github.com/facebook/rocksdb/blob/8cb278d11a43773a3ac22e523f4d183b06d37d88/include/rocksdb/advanced_options.h#L146-L153 - io_options.set_compression_options(-14, self.compression_level, 0, 0, 0); + // other 4 fields are default value. + io_options.set_compression_options( + -14, + self.compression_level, + 0, // strategy + 0, // max_dict_bytes + 0, // zstd_max_train_bytes + 1, // parallel_threads + ); } io_options.compression(compress_type); // in rocksdb 5.5.1, SstFileWriter will try to use bottommost_compression and diff --git a/components/engine_traits/src/encryption.rs b/components/engine_traits/src/encryption.rs index 51b19c05907..41a0f97fb36 100644 --- a/components/engine_traits/src/encryption.rs +++ b/components/engine_traits/src/encryption.rs @@ -53,4 +53,5 @@ pub enum EncryptionMethod { Aes128Ctr = 2, Aes192Ctr = 3, Aes256Ctr = 4, + Sm4Ctr = 5, } diff --git a/components/raftstore/src/engine_store_ffi/interfaces.rs b/components/raftstore/src/engine_store_ffi/interfaces.rs index 8185d0a88fa..906c7223b19 100644 --- a/components/raftstore/src/engine_store_ffi/interfaces.rs +++ b/components/raftstore/src/engine_store_ffi/interfaces.rs @@ -33,6 +33,7 @@ pub mod root { Aes128Ctr = 2, Aes192Ctr = 3, Aes256Ctr = 4, + SM4Ctr = 5, } #[repr(C)] #[derive(Debug)] @@ -443,7 +444,7 @@ pub mod root { ), >, } - pub const RAFT_STORE_PROXY_VERSION: u64 = 794398293737678384; + pub const RAFT_STORE_PROXY_VERSION: u64 = 14699247891578305166; pub const RAFT_STORE_PROXY_MAGIC_NUMBER: u32 = 324508639; } } diff --git a/components/raftstore/src/store/fsm/peer.rs b/components/raftstore/src/store/fsm/peer.rs index ea3f610b162..aae344e7a07 100644 --- a/components/raftstore/src/store/fsm/peer.rs +++ b/components/raftstore/src/store/fsm/peer.rs @@ -2492,6 +2492,9 @@ where ExtraMessageType::MsgHibernateResponse => { self.on_hibernate_response(msg.get_from_peer()); } + ExtraMessageType::MsgRejectRaftLogCausedByMemoryUsage => { + unimplemented!() + } } } diff --git a/components/tikv_alloc/Cargo.toml b/components/tikv_alloc/Cargo.toml index 2ebbd4da1bc..086744cab8f 100644 --- a/components/tikv_alloc/Cargo.toml +++ b/components/tikv_alloc/Cargo.toml @@ -35,15 +35,15 @@ optional = true features = ["bundled"] [dependencies.tikv-jemalloc-ctl] -version = "0.4.0" +version = "0.5.0" optional = true [dependencies.tikv-jemalloc-sys] -version = "0.4.0" +version = "0.5.0" optional = true features = ["stats"] [dependencies.tikv-jemallocator] -version = "0.4.0" +version = "0.5.0" optional = true features = ["unprefixed_malloc_on_supported_platforms", "stats"] diff --git a/engine_tiflash/src/encryption.rs b/engine_tiflash/src/encryption.rs index 2eddc0e85a3..9493fbd7b89 100644 --- a/engine_tiflash/src/encryption.rs +++ b/engine_tiflash/src/encryption.rs @@ -64,6 +64,7 @@ fn convert_encryption_method(input: EncryptionMethod) -> DBEncryptionMethod { EncryptionMethod::Aes128Ctr => DBEncryptionMethod::Aes128Ctr, EncryptionMethod::Aes192Ctr => DBEncryptionMethod::Aes192Ctr, EncryptionMethod::Aes256Ctr => DBEncryptionMethod::Aes256Ctr, + EncryptionMethod::Sm4Ctr => DBEncryptionMethod::Sm4Ctr, EncryptionMethod::Unknown => DBEncryptionMethod::Unknown, } } diff --git a/engine_tiflash/src/options.rs b/engine_tiflash/src/options.rs index c1610f64224..eca2a9ed33a 100644 --- a/engine_tiflash/src/options.rs +++ b/engine_tiflash/src/options.rs @@ -16,7 +16,7 @@ impl RocksReadOptions { impl From for RocksReadOptions { fn from(opts: engine_traits::ReadOptions) -> Self { let mut r = RawReadOptions::default(); - r.fill_cache(opts.fill_cache()); + r.set_fill_cache(opts.fill_cache()); RocksReadOptions(r) } } @@ -59,7 +59,7 @@ impl From for RocksReadOptions { fn build_read_opts(iter_opts: engine_traits::IterOptions) -> RawReadOptions { let mut opts = RawReadOptions::new(); - opts.fill_cache(iter_opts.fill_cache()); + opts.set_fill_cache(iter_opts.fill_cache()); opts.set_max_skippable_internal_keys(iter_opts.max_skippable_internal_keys()); if iter_opts.key_only() { opts.set_titan_key_only(true); diff --git a/engine_tiflash/src/sst.rs b/engine_tiflash/src/sst.rs index 58f300a8ec2..df0c2c26dfa 100644 --- a/engine_tiflash/src/sst.rs +++ b/engine_tiflash/src/sst.rs @@ -222,9 +222,15 @@ impl SstWriterBuilder for RocksSstWriterBuilder { }; // TODO: 0 is a valid value for compression_level if self.compression_level != 0 { - // other three fields are default value. - // see: https://github.com/facebook/rocksdb/blob/8cb278d11a43773a3ac22e523f4d183b06d37d88/include/rocksdb/advanced_options.h#L146-L153 - io_options.set_compression_options(-14, self.compression_level, 0, 0, 0); + // other 4 fields are default value. + io_options.set_compression_options( + -14, + self.compression_level, + 0, // strategy + 0, // max_dict_bytes + 0, // zstd_max_train_bytes + 1, // parallel_threads + ); } io_options.compression(compress_type); // in rocksdb 5.5.1, SstFileWriter will try to use bottommost_compression and diff --git a/etc/config-template.toml b/etc/config-template.toml index ab805b077a2..a5f394dc87d 100644 --- a/etc/config-template.toml +++ b/etc/config-template.toml @@ -1020,8 +1020,9 @@ ## Configurations for encryption at rest. Experimental. [security.encryption] ## Encryption method to use for data files. -## Possible values are "plaintext", "aes128-ctr", "aes192-ctr" and "aes256-ctr". Value other than -## "plaintext" means encryption is enabled, in which case master key must be specified. +## Possible values are "plaintext", "aes128-ctr", "aes192-ctr", "aes256-ctr" and "sm4-ctr". +## Value other than "plaintext" means encryption is enabled, in which case +## master key must be specified. # data-encryption-method = "plaintext" ## Specifies how often TiKV rotates data encryption key. diff --git a/raftstore-proxy/ffi/src/RaftStoreProxyFFI/@version b/raftstore-proxy/ffi/src/RaftStoreProxyFFI/@version index c47666fc7bd..6593eefcca8 100644 --- a/raftstore-proxy/ffi/src/RaftStoreProxyFFI/@version +++ b/raftstore-proxy/ffi/src/RaftStoreProxyFFI/@version @@ -1,3 +1,3 @@ #pragma once #include -namespace DB { constexpr uint64_t RAFT_STORE_PROXY_VERSION = 794398293737678384ull; } \ No newline at end of file +namespace DB { constexpr uint64_t RAFT_STORE_PROXY_VERSION = 14699247891578305166ull; } \ No newline at end of file diff --git a/raftstore-proxy/ffi/src/RaftStoreProxyFFI/EncryptionFFI.h b/raftstore-proxy/ffi/src/RaftStoreProxyFFI/EncryptionFFI.h index fde4afbc113..67a5e85ee1a 100644 --- a/raftstore-proxy/ffi/src/RaftStoreProxyFFI/EncryptionFFI.h +++ b/raftstore-proxy/ffi/src/RaftStoreProxyFFI/EncryptionFFI.h @@ -15,6 +15,7 @@ enum class EncryptionMethod : uint8_t { Aes128Ctr, Aes192Ctr, Aes256Ctr, + SM4Ctr, }; struct FileEncryptionInfoRaw { FileEncryptionRes res; diff --git a/src/config.rs b/src/config.rs index 19dd27e8304..0ace710bfc4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -128,7 +128,10 @@ pub struct TitanCfConfig { pub max_gc_batch_size: ReadableSize, #[online_config(skip)] pub discardable_ratio: f64, + // deprecated. #[online_config(skip)] + #[doc(hidden)] + #[serde(skip_serializing)] pub sample_ratio: f64, #[online_config(skip)] pub merge_small_file_threshold: ReadableSize, @@ -139,7 +142,10 @@ pub struct TitanCfConfig { pub range_merge: bool, #[online_config(skip)] pub max_sorted_runs: i32, + // deprecated. #[online_config(skip)] + #[doc(hidden)] + #[serde(skip_serializing)] pub gc_merge_rewrite: bool, } @@ -172,13 +178,11 @@ impl TitanCfConfig { opts.set_min_gc_batch_size(self.min_gc_batch_size.0 as u64); opts.set_max_gc_batch_size(self.max_gc_batch_size.0 as u64); opts.set_discardable_ratio(self.discardable_ratio); - opts.set_sample_ratio(self.sample_ratio); opts.set_merge_small_file_threshold(self.merge_small_file_threshold.0 as u64); opts.set_blob_run_mode(self.blob_run_mode.into()); opts.set_level_merge(self.level_merge); opts.set_range_merge(self.range_merge); opts.set_max_sorted_runs(self.max_sorted_runs); - opts.set_gc_merge_rewrite(self.gc_merge_rewrite); opts } } @@ -472,7 +476,7 @@ macro_rules! build_cf_opt { .set_pin_l0_filter_and_index_blocks_in_cache($opt.pin_l0_filter_and_index_blocks); if $opt.use_bloom_filter { block_base_opts.set_bloom_filter( - $opt.bloom_filter_bits_per_key, + $opt.bloom_filter_bits_per_key as f64, $opt.block_based_bloom_filter, ); block_base_opts.set_whole_key_filtering($opt.whole_key_filtering); @@ -493,6 +497,7 @@ macro_rules! build_cf_opt { 0, /* strategy */ $opt.bottommost_zstd_compression_dict_size, $opt.bottommost_zstd_compression_sample_size, + 1, // parallel_threads ); cf_opts.set_write_buffer_size($opt.write_buffer_size.0); cf_opts.set_max_write_buffer_number($opt.max_write_buffer_number); @@ -1098,8 +1103,8 @@ impl DbConfig { self.use_direct_io_for_flush_and_compaction, ); opts.enable_pipelined_write(self.enable_pipelined_write); - let enable_pipelined_commit = !self.enable_pipelined_write && !self.enable_unordered_write; - opts.enable_pipelined_commit(enable_pipelined_commit); + let enable_multi_batch_write = !self.enable_pipelined_write && !self.enable_unordered_write; + opts.enable_multi_batch_write(enable_multi_batch_write); opts.enable_unordered_write(self.enable_unordered_write); opts.set_info_log(RocksdbLogger::default()); opts.set_info_log_level(self.info_log_level.into()); diff --git a/src/coprocessor/tracker.rs b/src/coprocessor/tracker.rs index a12f4ee0c71..1ef9612b2e6 100644 --- a/src/coprocessor/tracker.rs +++ b/src/coprocessor/tracker.rs @@ -197,9 +197,9 @@ impl Tracker { let mut exec_details = kvrpcpb::ExecDetails::default(); let mut td = kvrpcpb::TimeDetail::default(); - td.set_process_wall_time_ms(time::duration_to_ms(measure) as i64); - td.set_wait_wall_time_ms(time::duration_to_ms(self.wait_time) as i64); - td.set_kv_read_wall_time_ms(self.scan_process_time_ms as i64); + td.set_process_wall_time_ms(time::duration_to_ms(measure)); + td.set_wait_wall_time_ms(time::duration_to_ms(self.wait_time)); + td.set_kv_read_wall_time_ms(self.scan_process_time_ms); exec_details.set_time_detail(td.clone()); let detail = self.total_storage_stats.scan_detail(); diff --git a/src/server/service/kv.rs b/src/server/service/kv.rs index 6d578334dff..2ed6438a7ba 100644 --- a/src/server/service/kv.rs +++ b/src/server/service/kv.rs @@ -1341,10 +1341,9 @@ fn future_get( stats.stats.write_scan_detail(scan_detail_v2); stats.perf_stats.write_scan_detail(scan_detail_v2); let time_detail = exec_detail_v2.mut_time_detail(); - time_detail.set_kv_read_wall_time_ms(duration_ms as i64); - time_detail.set_wait_wall_time_ms(stats.latency_stats.wait_wall_time_ms as i64); - time_detail - .set_process_wall_time_ms(stats.latency_stats.process_wall_time_ms as i64); + time_detail.set_kv_read_wall_time_ms(duration_ms); + time_detail.set_wait_wall_time_ms(stats.latency_stats.wait_wall_time_ms); + time_detail.set_process_wall_time_ms(stats.latency_stats.process_wall_time_ms); match val { Some(val) => resp.set_value(val), None => resp.set_not_found(true), @@ -1421,10 +1420,9 @@ fn future_batch_get( stats.stats.write_scan_detail(scan_detail_v2); stats.perf_stats.write_scan_detail(scan_detail_v2); let time_detail = exec_detail_v2.mut_time_detail(); - time_detail.set_kv_read_wall_time_ms(duration_ms as i64); - time_detail.set_wait_wall_time_ms(stats.latency_stats.wait_wall_time_ms as i64); - time_detail - .set_process_wall_time_ms(stats.latency_stats.process_wall_time_ms as i64); + time_detail.set_kv_read_wall_time_ms(duration_ms); + time_detail.set_wait_wall_time_ms(stats.latency_stats.wait_wall_time_ms); + time_detail.set_process_wall_time_ms(stats.latency_stats.process_wall_time_ms); resp.set_pairs(pairs.into()); } Err(e) => { diff --git a/tests/integrations/server/status_server.rs b/tests/integrations/server/status_server.rs index a739e387a1e..199d6f55789 100644 --- a/tests/integrations/server/status_server.rs +++ b/tests/integrations/server/status_server.rs @@ -46,14 +46,7 @@ fn test_region_meta_endpoint() { assert!(router.is_some()); let mut status_server = unsafe { - let helperset = &*cluster - .global_engine_helper_set - .as_ref() - .unwrap() - .engine_store_server_helper; - let helperptr = helperset as *const EngineStoreServerHelper; StatusServer::new( - &*helperptr, 1, ConfigController::default(), Arc::new(SecurityConfig::default()),