Skip to content

Commit 83ced41

Browse files
Siflukoktonos
authored andcommitted
Drop support for Zookeeper Authority
The Zookeeper backend has largely fallen by the wayside, with Consul being the choice for clustering. Removing this backend for the Authority will remove the maintenance burden of maintaining vestigial functionality. Change-Id: Ia361bb8da8c9794e3ad7d06a8c976e01ba1e069b Reviewed-on: https://gerrit.readyset.name/c/readyset/+/5064 Tested-by: Buildkite CI Reviewed-by: Jason Brown <[email protected]>
1 parent a56cc1b commit 83ced41

File tree

28 files changed

+87
-822
lines changed

28 files changed

+87
-822
lines changed

Cargo.lock

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

benchmarks/src/bin/extend_recipe.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ use readyset_data::Dialect;
77
#[derive(Parser)]
88
#[clap(name = "extend_recipe")]
99
struct ExtendRecipe {
10-
#[clap(short, long, env("AUTHORITY_ADDRESS"), default_value("127.0.0.1:2181"))]
10+
#[clap(short, long, env("AUTHORITY_ADDRESS"), default_value("127.0.0.1:8500"))]
1111
authority_address: String,
1212
#[clap(
1313
long,
1414
env("AUTHORITY"),
15-
default_value("zookeeper"),
16-
value_parser = ["consul", "zookeeper"]
15+
default_value("consul"),
16+
value_parser = ["consul"]
1717
)]
1818
authority: AuthorityType,
1919
#[clap(short, long, env("DEPLOYMENT"))]

benchmarks/src/bin/extend_recipe_write_prop.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ use readyset_data::Dialect;
88
#[derive(Parser)]
99
#[clap(name = "extend_recipe_write_propagation")]
1010
struct ExtendRecipeWritePropagation {
11-
#[clap(short, long, env("AUTHORITY_ADDRESS"), default_value("127.0.0.1:2181"))]
11+
#[clap(short, long, env("AUTHORITY_ADDRESS"), default_value("127.0.0.1:8500"))]
1212
authority_address: String,
1313
#[clap(
1414
long,
1515
env("AUTHORITY"),
16-
default_value("zookeeper"),
17-
value_parser = ["consul", "zookeeper"]
16+
default_value("consul"),
17+
value_parser = ["consul"]
1818
)]
1919
authority: AuthorityType,
2020
#[clap(short, long, env("DEPLOYMENT"), value_parser = NonEmptyStringValueParser::new())]

benchmarks/src/bin/reader.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ struct NoriaClientOpts {
2929
long,
3030
required_if_eq("database-type", "noria"),
3131
env("AUTHORITY_ADDRESS"),
32-
default_value("127.0.0.1:2181")
32+
default_value("127.0.0.1:8500")
3333
)]
3434
authority_address: String,
3535

3636
#[clap(
3737
long,
3838
env("AUTHORITY"),
3939
required_if_eq("database-type", "noria"),
40-
default_value("zookeeper"),
41-
value_parser = ["consul", "zookeeper"]
40+
default_value("consul"),
41+
value_parser = ["consul"]
4242
)]
4343
authority: AuthorityType,
4444

benchmarks/src/bin/write_propagation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ struct Writer {
5353
#[clap(long)]
5454
database_url: String,
5555

56-
#[clap(short, long, env("AUTHORITY_ADDRESS"), default_value("127.0.0.1:2181"))]
56+
#[clap(short, long, env("AUTHORITY_ADDRESS"), default_value("127.0.0.1:8500"))]
5757
authority_address: String,
5858

59-
#[clap(long, env("AUTHORITY"), default_value("zookeeper"), value_parser = ["consul", "zookeeper"])]
59+
#[clap(long, env("AUTHORITY"), default_value("consul"), value_parser = ["consul"])]
6060
authority: AuthorityType,
6161

6262
#[clap(short, long, env("DEPLOYMENT"), value_parser = NonEmptyStringValueParser::new())]

deny.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ skip = [
192192
# by default infinite
193193
skip-tree = [
194194
{ name = "rusty-fork", version = "0.3.0" },
195-
{ name = "zookeeper", version = "0.6.1" },
196195
{ name = "fail", version = "0.5.0" },
197196
{ name = "rust_decimal", version = "1.17.0" },
198197
{ name = "prometheus-http-query", version = "0.3.0" },

readyset-client/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ triomphe = "0.1"
6767
streaming-iterator = "0.1"
6868

6969
# consensus/
70-
zookeeper-async = "4.0.1"
7170
enum_dispatch = "0.3.7"
7271
async-trait = "0.1"
7372
consulrs = { workspace = true }

readyset-client/src/consensus/consul.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ mod tests {
10761076

10771077
authority
10781078
.become_leader(LeaderPayload {
1079-
controller_uri: url::Url::parse("http://127.0.0.1:2181").unwrap(),
1079+
controller_uri: url::Url::parse("http://127.0.0.1:8500").unwrap(),
10801080
nonce: 1,
10811081
})
10821082
.await
@@ -1118,7 +1118,7 @@ mod tests {
11181118
authority.delete_all_keys().await;
11191119

11201120
let payload = LeaderPayload {
1121-
controller_uri: url::Url::parse("http://127.0.0.1:2181").unwrap(),
1121+
controller_uri: url::Url::parse("http://127.0.0.1:8500").unwrap(),
11221122
nonce: 1,
11231123
};
11241124
let expected_leader_payload = payload.clone();
@@ -1230,7 +1230,7 @@ mod tests {
12301230
authority.delete_all_keys().await;
12311231

12321232
let payload = LeaderPayload {
1233-
controller_uri: url::Url::parse("http://127.0.0.1:2181").unwrap(),
1233+
controller_uri: url::Url::parse("http://127.0.0.1:8500").unwrap(),
12341234
nonce: 1,
12351235
};
12361236

@@ -1298,7 +1298,7 @@ mod tests {
12981298
authority.delete_all_keys().await;
12991299

13001300
let payload = LeaderPayload {
1301-
controller_uri: url::Url::parse("http://127.0.0.1:2181").unwrap(),
1301+
controller_uri: url::Url::parse("http://127.0.0.1:8500").unwrap(),
13021302
nonce: 1,
13031303
};
13041304

@@ -1349,7 +1349,7 @@ mod tests {
13491349
authority.destroy_session().await.unwrap();
13501350

13511351
let payload = LeaderPayload {
1352-
controller_uri: url::Url::parse("http://127.0.0.1:2181").unwrap(),
1352+
controller_uri: url::Url::parse("http://127.0.0.1:8500").unwrap(),
13531353
nonce: 2,
13541354
};
13551355

@@ -1581,7 +1581,7 @@ mod tests {
15811581
authority.delete_all_keys().await;
15821582

15831583
let payload = LeaderPayload {
1584-
controller_uri: url::Url::parse("http://127.0.0.1:2181").unwrap(),
1584+
controller_uri: url::Url::parse("http://127.0.0.1:8500").unwrap(),
15851585
nonce: 1,
15861586
};
15871587

readyset-client/src/consensus/local.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! LocalAuthority is replicating the abstraction over the different authority
2-
//! systems (Zookeeper, Consul, etcd) but for a single process and in memory
2+
//! systems (Consul, etcd) but for a single process and in memory
33
//! instead of requiring a server.
44
//!
55
//! As such, it is maintaining a separation between the Store and Authority. In
@@ -10,7 +10,7 @@
1010
//! from LocalAuthorityStore when it last checked in.
1111
//!
1212
//! The LocalAuthority supports ephemeral keys, instead of tying these keys to
13-
//! an active session similar to Zookeeper, the authority will drop ephemeral
13+
//! an active session similar to Consul, the authority will drop ephemeral
1414
//! keys it created when it is dropped.
1515
use std::any::Any;
1616
use std::collections::btree_map::Entry;

readyset-client/src/consensus/mod.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Trait for interacting with an conensus system (Zookeeper, Consul, etcd) to determine
1+
//! Trait for interacting with an conensus system (Consul, etcd) to determine
22
//! which ReadySet worker acts as the controller, which ReadySet workers exist, detecting failed
33
//! workers which necessitate changes, and storing cluster wide global state.
44
@@ -19,12 +19,10 @@ use url::Url;
1919
mod consul;
2020
mod local;
2121
mod standalone;
22-
pub mod zk;
2322

2423
pub use self::consul::ConsulAuthority;
2524
pub use self::local::{LocalAuthority, LocalAuthorityStore};
2625
pub use self::standalone::StandaloneAuthority;
27-
pub use self::zk::ZookeeperAuthority;
2826
use crate::ControllerDescriptor;
2927

3028
// This should be an associated type on Authority but since Authority will only have one possible
@@ -236,7 +234,6 @@ pub trait AuthorityControl: Send + Sync {
236234
#[allow(clippy::large_enum_variant)]
237235
#[enum_dispatch(AuthorityControl)]
238236
pub enum Authority {
239-
ZookeeperAuthority,
240237
ConsulAuthority,
241238
LocalAuthority,
242239
StandaloneAuthority,
@@ -245,7 +242,6 @@ pub enum Authority {
245242
/// Enum that mirrors Authority that parses command line arguments.
246243
#[derive(Clone, Debug, Eq, PartialEq, ValueEnum)]
247244
pub enum AuthorityType {
248-
Zookeeper,
249245
Consul,
250246
Local,
251247
Standalone,
@@ -255,7 +251,6 @@ impl FromStr for AuthorityType {
255251
type Err = anyhow::Error;
256252
fn from_str(s: &str) -> Result<Self, Self::Err> {
257253
match s {
258-
"zookeeper" => Ok(AuthorityType::Zookeeper),
259254
"consul" => Ok(AuthorityType::Consul),
260255
"local" => Ok(AuthorityType::Local),
261256
"standalone" => Ok(AuthorityType::Standalone),
@@ -267,7 +262,6 @@ impl FromStr for AuthorityType {
267262
impl Display for AuthorityType {
268263
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
269264
match &self {
270-
AuthorityType::Zookeeper => write!(f, "zookeeper"),
271265
AuthorityType::Consul => write!(f, "consul"),
272266
AuthorityType::Local => write!(f, "local"),
273267
AuthorityType::Standalone => write!(f, "standalone"),
@@ -278,11 +272,6 @@ impl Display for AuthorityType {
278272
impl AuthorityType {
279273
pub async fn to_authority(&self, addr: &str, deployment: &str) -> Authority {
280274
match self {
281-
AuthorityType::Zookeeper => Authority::from(
282-
ZookeeperAuthority::new(&format!("{}/{}", addr, deployment))
283-
.await
284-
.unwrap(),
285-
),
286275
AuthorityType::Consul => Authority::from(
287276
ConsulAuthority::new(&format!("http://{}/{}", addr, deployment)).unwrap(),
288277
),

readyset-client/src/consensus/standalone.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ mod tests {
313313
assert_eq!(authority.try_read("/a").await.unwrap(), Some(12));
314314

315315
let payload = LeaderPayload {
316-
controller_uri: url::Url::parse("http://127.0.0.1:2181").unwrap(),
316+
controller_uri: url::Url::parse("http://127.0.0.1:8500").unwrap(),
317317
nonce: 1,
318318
};
319319
let expected_leader_payload = payload.clone();
@@ -413,7 +413,7 @@ mod tests {
413413

414414
authority
415415
.become_leader(LeaderPayload {
416-
controller_uri: url::Url::parse("http://127.0.0.1:2181").unwrap(),
416+
controller_uri: url::Url::parse("http://127.0.0.1:8500").unwrap(),
417417
nonce: 1,
418418
})
419419
.await

0 commit comments

Comments
 (0)