Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 0ba8ba1

Browse files
authored
Merge pull request #525 from libsql/basic-replication
basic replication
2 parents c40482d + cc9c2c1 commit 0ba8ba1

File tree

30 files changed

+845
-748
lines changed

30 files changed

+845
-748
lines changed

Cargo.lock

Lines changed: 21 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libsqlx-server/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ edition = "2021"
77

88
[dependencies]
99
async-bincode = { version = "0.7.1", features = ["tokio"] }
10+
async-trait = "0.1.71"
1011
axum = "0.6.18"
1112
base64 = "0.21.2"
1213
bincode = "1.3.3"
13-
bytes = "1.4.0"
14+
bytes = { version = "1.4.0", features = ["serde"] }
1415
clap = { version = "4.3.11", features = ["derive"] }
1516
color-eyre = "0.6.2"
1617
futures = "0.3.28"
@@ -26,6 +27,7 @@ regex = "1.9.1"
2627
serde = { version = "1.0.166", features = ["derive", "rc"] }
2728
serde_json = "1.0.100"
2829
sha2 = "0.10.7"
30+
sha3 = "0.10.8"
2931
sled = "0.34.7"
3032
thiserror = "1.0.43"
3133
tokio = { version = "1.29.1", features = ["full"] }
@@ -34,7 +36,7 @@ tokio-util = "0.7.8"
3436
toml = "0.7.6"
3537
tracing = "0.1.37"
3638
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
37-
uuid = { version = "1.4.0", features = ["v4"] }
39+
uuid = { version = "1.4.0", features = ["v4", "serde"] }
3840

3941
[dev-dependencies]
4042
turmoil = "0.5.5"

libsqlx-server/src/allocation/config.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use serde::{Deserialize, Serialize};
22

3+
use crate::linc::NodeId;
4+
35
/// Structural supertype of AllocConfig, used for checking the meta version. Subsequent version of
46
/// AllocConfig need to conform to this prototype.
57
#[derive(Debug, Serialize, Deserialize)]
@@ -10,12 +12,12 @@ struct ConfigVersion {
1012
#[derive(Debug, Serialize, Deserialize)]
1113
pub struct AllocConfig {
1214
pub max_conccurent_connection: u32,
13-
pub id: String,
15+
pub db_name: String,
1416
pub db_config: DbConfig,
1517
}
1618

1719
#[derive(Debug, Serialize, Deserialize)]
1820
pub enum DbConfig {
1921
Primary {},
20-
Replica { primary_node_id: String },
22+
Replica { primary_node_id: NodeId },
2123
}

0 commit comments

Comments
 (0)