Skip to content

Commit

Permalink
test replica restart
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinPostma committed Nov 13, 2023
1 parent b9b47ee commit 675f4d9
Show file tree
Hide file tree
Showing 4 changed files with 542 additions and 1 deletion.
1 change: 1 addition & 0 deletions libsql-server/src/http/admin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ where
.with_graceful_shutdown(shutdown.notified())
.await
.context("Could not bind admin HTTP API server")?;

Ok(())
}

Expand Down
4 changes: 3 additions & 1 deletion libsql-server/src/namespace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ impl Namespace<ReplicaDatabase> {

// force a handshake now, to retrieve the primary's current replication index
match replicator.try_perform_handshake().await {
Err(libsql_replication::replicator::Error::Meta(libsql_replication::meta::Error::LogIncompatible)) => {
Err(libsql_replication::replicator::Error::Meta(
libsql_replication::meta::Error::LogIncompatible,
)) => {
tracing::error!("trying to replicate incompatible logs, reseting replica");
(reset)(ResetOp::Reset(name.clone()));
}
Expand Down
2 changes: 2 additions & 0 deletions libsql-server/tests/cluster/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ use common::net::{init_tracing, TestServer, TurmoilAcceptor, TurmoilConnector};

use crate::common::{http::Client, net::SimServer, snapshot_metrics};

mod replica_restart;

fn make_cluster(sim: &mut Sim, num_replica: usize, disable_namespaces: bool) {
init_tracing();
let tmp = tempdir().unwrap();
Expand Down
Loading

0 comments on commit 675f4d9

Please sign in to comment.