Skip to content

Commit 8e426d7

Browse files
authored
Merge pull request #311 from doyoubi/UpgradeRust
Upgrade rust to 1.55
2 parents 9803c35 + 658704c commit 8e426d7

File tree

7 files changed

+21
-9
lines changed

7 files changed

+21
-9
lines changed

conf/server-proxy.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ slowlog_sample_rate = 1000
1212
thread_number = 2
1313

1414
backend_conn_num = 2
15-
backend_batch_strategy = "fixed"
15+
# "disabled" should be good enough for most cases.
16+
# For larger throughput with pipline enabled,
17+
# we can try "fixed" or "dynamic" for higher throughput.
18+
backend_batch_strategy = "disabled"
1619
# In bytes
1720
backend_flush_size = 1024
1821
# In nanoseconds

examples/Dockerfile-undermoon-release

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Use https://crates.io/crates/cargo-chef to cache dependencies.
22

3-
FROM rust:1.51-buster as planner
3+
FROM rust:1.55-buster as planner
44
WORKDIR /undermoon
55
RUN cargo install cargo-chef
66
COPY src /undermoon/src
77
COPY Cargo.toml Cargo.lock /undermoon/
88
RUN cargo chef prepare --recipe-path recipe.json
99

10-
FROM rust:1.51-buster as cacher
10+
FROM rust:1.55-buster as cacher
1111
WORKDIR /undermoon
1212
RUN cargo install cargo-chef
1313
COPY --from=planner /undermoon/recipe.json recipe.json
1414
RUN cargo chef cook --release --recipe-path recipe.json
1515

16-
FROM rust:1.51-buster as builder
16+
FROM rust:1.55-buster as builder
1717
WORKDIR /undermoon
1818
COPY src /undermoon/src
1919
COPY Cargo.toml Cargo.lock /undermoon/

examples/Dockerfile-undermoon-test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Use https://crates.io/crates/cargo-chef to cache dependencies.
22

3-
FROM rust:1.51-buster as planner
3+
FROM rust:1.55-buster as planner
44
WORKDIR /undermoon
55
RUN cargo install cargo-chef
66
COPY src /undermoon/src
77
COPY Cargo.toml Cargo.lock /undermoon/
88
RUN cargo chef prepare --recipe-path recipe.json
99

10-
FROM rust:1.51-buster as cacher
10+
FROM rust:1.55-buster as cacher
1111
WORKDIR /undermoon
1212
RUN cargo install cargo-chef
1313
COPY --from=planner /undermoon/recipe.json recipe.json
1414
RUN cargo chef cook --recipe-path recipe.json
1515

16-
FROM rust:1.51-buster as builder
16+
FROM rust:1.55-buster as builder
1717
WORKDIR /undermoon
1818
COPY src /undermoon/src
1919
COPY Cargo.toml Cargo.lock /undermoon/

src/bin/server_proxy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ fn gen_conf() -> Result<ServerProxyConfig, &'static str> {
6565
"disabled" => BatchStrategy::Disabled,
6666
"fixed" => BatchStrategy::Fixed,
6767
"dynamic" => BatchStrategy::Dynamic,
68-
_ => BatchStrategy::Fixed,
68+
_ => BatchStrategy::Disabled,
6969
})
70-
.unwrap_or_else(|_| BatchStrategy::Fixed);
70+
.unwrap_or_else(|_| BatchStrategy::Disabled);
7171
let backend_flush_size =
7272
NonZeroUsize::new(s.get::<usize>("backend_flush_size").unwrap_or(1024))
7373
.ok_or("backend_flush_size")?;

src/migration/manager.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use std::sync::Arc;
2525
type TaskRecord<T> = Either<Arc<dyn MigratingTask<Task = T>>, Arc<dyn ImportingTask<Task = T>>>;
2626
struct MgrTask<T: CmdTask> {
2727
task: TaskRecord<T>,
28+
#[allow(dyn_drop)]
2829
_stop_handle: Option<Box<dyn Drop + Send + Sync + 'static>>,
2930
}
3031
type ClusterTask<T> = HashMap<MigrationTaskMeta, Arc<MgrTask<T>>>;

src/migration/scan_task.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ where
449449
self.range_map.contains_slot(slot)
450450
}
451451

452+
#[allow(dyn_drop)]
452453
fn get_stop_handle(&self) -> Option<Box<dyn Drop + Send + Sync + 'static>> {
453454
let handle = MigratingTaskHandle {
454455
task: self.task.clone(),
@@ -644,6 +645,7 @@ where
644645
self.range_map.contains_slot(slot)
645646
}
646647

648+
#[allow(dyn_drop)]
647649
fn get_stop_handle(&self) -> Option<Box<dyn Drop + Send + Sync + 'static>> {
648650
let handle = ImportingTaskHandle {
649651
meta: self.meta.clone(),

src/migration/task.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ pub trait MigratingTask: ThreadSafe {
100100
) -> BoxFuture<Result<(), ClusterSendError<BlockingHintTask<Self::Task>>>>;
101101
fn get_state(&self) -> MigrationState;
102102
fn contains_slot(&self, slot: usize) -> bool;
103+
// Rust implements `drop` for all types.
104+
// We just explicitly tag `Drop` here for better understanding.
105+
#[allow(dyn_drop)]
103106
fn get_stop_handle(&self) -> Option<Box<dyn Drop + Send + Sync + 'static>>;
104107
}
105108

@@ -114,6 +117,9 @@ pub trait ImportingTask: ThreadSafe {
114117
) -> Result<(), ClusterSendError<BlockingHintTask<Self::Task>>>;
115118
fn get_state(&self) -> MigrationState;
116119
fn contains_slot(&self, slot: usize) -> bool;
120+
// Rust implements `drop` for all types.
121+
// We just explicitly tag `Drop` here for better understanding.
122+
#[allow(dyn_drop)]
117123
fn get_stop_handle(&self) -> Option<Box<dyn Drop + Send + Sync + 'static>>;
118124
fn handle_switch(
119125
&self,

0 commit comments

Comments
 (0)