Skip to content

Commit

Permalink
adapt to upgrade-near-8.2
Browse files Browse the repository at this point in the history
Signed-off-by: CalvinNeo <[email protected]>
  • Loading branch information
CalvinNeo committed Jun 14, 2024
1 parent d43affd commit d341b80
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 67 deletions.
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,6 @@ else
# Caller is responsible for setting up test engine features
endif

ifneq ($(NO_CLOUD),1)
ENABLE_FEATURES += cloud-aws
ENABLE_FEATURES += cloud-gcp
ENABLE_FEATURES += cloud-azure
endif

export DOCKER_FILE ?= Dockerfile
export DOCKER_IMAGE_NAME ?= pingcap/tikv
export DOCKER_IMAGE_TAG ?= latest
Expand Down
2 changes: 1 addition & 1 deletion components/engine_panic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ license = "Apache-2.0"
testexport = []

[dependencies]
encryption = { workspace = true }
engine_traits = { workspace = true }
kvproto = { workspace = true }
encryption = { workspace = true }
raft = { workspace = true }
tikv_alloc = { workspace = true }
# FIXME: Remove this dep from the engine_traits interface
Expand Down
2 changes: 1 addition & 1 deletion components/engine_rocks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ package = "rocksdb"
features = ["encryption"]

[dev-dependencies]
proptest = "1.0.0"
rand = "0.8"
toml = "0.5"
proptest = "1.0.0"
2 changes: 1 addition & 1 deletion components/engine_traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ testexport = []
[dependencies]
case_macros = { workspace = true }
collections = { workspace = true }
encryption = { workspace = true }
error_code = { workspace = true }
fail = "0.5"
file_system = { workspace = true }
Expand All @@ -21,7 +22,6 @@ lazy_static = "1.0"
log_wrappers = { workspace = true }
protobuf = "2"
raft = { workspace = true }
encryption = { workspace = true }
serde = "1.0"
slog = { workspace = true }
slog-global = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion components/engine_traits_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ engine_traits = { workspace = true }
kvproto = { workspace = true }
panic_hook = { workspace = true }
tempfile = "3.0"
tikv_alloc = { workspace = true }
test_util = { workspace = true }
tikv_alloc = { workspace = true }
16 changes: 8 additions & 8 deletions components/hybrid_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ path = "tests/failpoints/mod.rs"
required-features = ["failpoints"]

[dependencies]
engine_traits = { workspace = true }
txn_types = { workspace = true }
tikv_util = { workspace = true }
crossbeam = "0.8"
engine_rocks = { workspace = true }
engine_traits = { workspace = true }
fail = "0.5"
lazy_static = "1.4.0"
online_config = { workspace = true }
prometheus = { version = "0.13", default-features = false, features = ["nightly"] }
prometheus-static-metric = "0.5"
region_cache_memory_engine = { workspace = true }
slog = { workspace = true }
slog-global = { workspace = true }
tempfile = "3.0"
prometheus = { version = "0.13", default-features = false, features = ["nightly"] }
prometheus-static-metric = "0.5"
lazy_static = "1.4.0"
crossbeam = "0.8"
fail = "0.5"
tikv_util = { workspace = true }
txn_types = { workspace = true }

[dev-dependencies]
tempfile = "3.0"
2 changes: 1 addition & 1 deletion components/raft_log_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ license = "Apache-2.0"
failpoints = ["raft-engine/failpoints"]

[dependencies]
codec = { workspace = true }
encryption = { workspace = true }
engine_traits = { workspace = true }
codec = { workspace = true }
file_system = { workspace = true }
kvproto = { workspace = true }
lazy_static = "1.4.0"
Expand Down
40 changes: 20 additions & 20 deletions components/region_cache_memory_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,40 @@ path = "tests/failpoints/mod.rs"
required-features = ["failpoints"]

[dependencies]
engine_traits = { workspace = true }
collections = { workspace = true }
skiplist-rs = { git = "https://github.com/tikv/skiplist-rs.git", branch = "main" }
bytes = "1.0"
collections = { workspace = true }
crossbeam = "0.8"
dashmap = "5.1"
engine_rocks = { workspace = true }
engine_traits = { workspace = true }
fail = "0.5"
futures = { version = "0.3", features = ["compat"] }
tikv_util = { workspace = true }
txn_types = { workspace = true }
hex = "0.4"
keys = { workspace = true }
kvproto = { workspace = true }
lazy_static = "1.4.0"
libc = "0.2"
log_wrappers = { workspace = true }
online_config = { workspace = true }
parking_lot = "0.12"
pd_client = { workspace = true }
dashmap = "5.1"
prometheus = { version = "0.13", default-features = false, features = ["nightly"] }
prometheus-static-metric = "0.5"
rand = "0.8"
security = { workspace = true }
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
slog-global = { workspace = true }
skiplist-rs = { git = "https://github.com/tikv/skiplist-rs.git", branch = "main" }
slog = { workspace = true }
engine_rocks = { workspace = true }
fail = "0.5"
yatp = { workspace = true }
parking_lot = "0.12"
keys = { workspace = true }
prometheus = { version = "0.13", default-features = false, features = ["nightly"] }
prometheus-static-metric = "0.5"
lazy_static = "1.4.0"
hex = "0.4"
slog-global = { workspace = true }
thiserror = "1.0"
online_config = { workspace = true }
libc = "0.2"
rand = "0.8"
tikv_util = { workspace = true }
txn_types = { workspace = true }
yatp = { workspace = true }

[dev-dependencies]
tempfile = "3.0"
test_pd = { workspace = true }
test_pd_client = { workspace = true }
test_util = { workspace = true }
test_util = { workspace = true }
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ impl<T: Transport + 'static, ER: RaftEngine> ProxyForwarder<T, ER> {
}
None => {
// We can't find background pre-handle task, maybe:
// 1. We can't get snapshot from snap manager at that time.
// This is abnormal case.
// 1. We can't get snapshot from snap manager at that time. This is abnormal
// case.
// 2. We disabled background pre handling.
info!("pre-handled snapshot not found";
"peer_id" => peer_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ impl RaftLogBatch for PSEngineWriteBatch {
entries: Vec<Entry>,
) -> Result<()> {
let overwrite_to = overwrite_to.unwrap_or(0);
if let Some(last) = entries.last() && last.get_index() + 1 < overwrite_to {
if let Some(last) = entries.last()
&& last.get_index() + 1 < overwrite_to
{
for index in last.get_index() + 1..overwrite_to {
let key = keys::raft_log_key(raft_group_id, index);
self.del_page(&key).unwrap();
Expand Down
4 changes: 3 additions & 1 deletion proxy_components/engine_tiflash/src/raft_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@ impl RaftLogBatch for RocksWriteBatchVec {
entries: Vec<Entry>,
) -> Result<()> {
let overwrite_to = overwrite_to.unwrap_or(0);
if let Some(last) = entries.last() && last.get_index() + 1 < overwrite_to {
if let Some(last) = entries.last()
&& last.get_index() + 1 < overwrite_to
{
for index in last.get_index() + 1..overwrite_to {
let key = keys::raft_log_key(raft_group_id, index);
self.delete(&key).unwrap();
Expand Down
7 changes: 4 additions & 3 deletions proxy_components/engine_tiflash/src/rocks_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1343,9 +1343,10 @@ impl StatisticsReporter<RocksEngine> for RocksStatisticsReporter {
STORE_ENGINE_NUM_FILES_AT_LEVEL_VEC
.with_label_values(&[&self.name, cf, &level.to_string()])
.set(num_files as i64);
if num_files > 0 && let Some(ratio) = level_stats.weighted_compression_ratio {
let normalized_compression_ratio =
ratio / num_files as f64;
if num_files > 0
&& let Some(ratio) = level_stats.weighted_compression_ratio
{
let normalized_compression_ratio = ratio / num_files as f64;
STORE_ENGINE_COMPRESSION_RATIO_VEC
.with_label_values(&[&self.name, cf, &level.to_string()])
.set(normalized_compression_ratio);
Expand Down
40 changes: 19 additions & 21 deletions proxy_components/proxy_server/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ use std::{

use api_version::{dispatch_api_version, KvFormat};
use concurrency_manager::ConcurrencyManager;

use health_controller::HealthController;
use encryption_export::data_key_manager_from_config;
use engine_rocks::{from_rocks_compression_type, RocksEngine, RocksStatistics};
use engine_rocks_helper::sst_recovery::{RecoveryRunner, DEFAULT_CHECK_INTERVAL};
Expand All @@ -40,16 +38,12 @@ use engine_traits::{
Engines, KvEngine, MiscExt, RaftEngine, SingletonFactory, TabletContext, TabletRegistry,
CF_DEFAULT, CF_WRITE,
};

use region_cache_memory_engine::{
config::RangeCacheConfigManager, RangeCacheEngineContext, RangeCacheMemoryEngine,
RangeCacheMemoryEngineStatistics,
};
use error_code::ErrorCodeExt;
use file_system::{get_io_rate_limiter, BytesFetcher, MetricsManager as IOMetricsManager};
use futures::executor::block_on;
use grpcio::{EnvBuilder, Environment};
use grpcio_health::HealthService;
use health_controller::HealthController;
use kvproto::{
debugpb::create_debug, diagnosticspb::create_diagnostics, import_sstpb::create_import_sst,
};
Expand All @@ -69,6 +63,10 @@ use raftstore::{
SplitCheckRunner, SplitConfigManager, StoreMetaDelegate,
},
};
use region_cache_memory_engine::{
config::RangeCacheConfigManager, RangeCacheEngineContext, RangeCacheMemoryEngine,
RangeCacheMemoryEngineStatistics,
};
use resource_control::{
ResourceGroupManager, ResourceManagerService, MIN_PRIORITY_UPDATE_INTERVAL,
};
Expand All @@ -93,7 +91,8 @@ use tikv::{
service::{DebugService, DiagnosticsService},
tablet_snap::NoSnapshotCache,
ttl::TtlChecker,
KvEngineFactoryBuilder, MultiRaftServer, RaftKv, Server, CPU_CORES_QUOTA_GAUGE, GRPC_THREAD_PREFIX,
KvEngineFactoryBuilder, MultiRaftServer, RaftKv, Server, CPU_CORES_QUOTA_GAUGE,
GRPC_THREAD_PREFIX,
},
storage::{
self,
Expand Down Expand Up @@ -692,20 +691,20 @@ impl<ER: RaftEngine, F: KvFormat> TiKvServer<ER, F> {
router.clone(),
config.coprocessor.clone(),
));

// Region stats manager collects region heartbeat for use by in-memory engine.
let region_stats_manager_enabled_cb: Arc<dyn Fn() -> bool + Send + Sync> =
if cfg!(feature = "memory-engine") {
let cfg_controller_clone = cfg_controller.clone();
Arc::new(move || {
cfg_controller_clone
.get_current()
.range_cache_engine
.enabled
})
} else {
Arc::new(|| false)
};
if cfg!(feature = "memory-engine") {
let cfg_controller_clone = cfg_controller.clone();
Arc::new(move || {
cfg_controller_clone
.get_current()
.range_cache_engine
.enabled
})
} else {
Arc::new(|| false)
};
let region_info_accessor = RegionInfoAccessor::new(
coprocessor_host.as_mut().unwrap(),
region_stats_manager_enabled_cb,
Expand Down Expand Up @@ -1287,7 +1286,6 @@ impl<ER: RaftEngine, F: KvFormat> TiKvServer<ER, F> {
);
tiflash_ob.register_to(self.coprocessor_host.as_mut().unwrap());


cfg_controller.register(
tikv::config::Module::Server,
Box::new(ServerConfigManager::new(
Expand Down

0 comments on commit d341b80

Please sign in to comment.