Skip to content

Commit e5b8c31

Browse files
committed
comment out libsql-wal replica configurator
1 parent ded5ba7 commit e5b8c31

File tree

3 files changed

+79
-72
lines changed

3 files changed

+79
-72
lines changed

libsql-server/src/lib.rs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -745,21 +745,27 @@ where
745745
});
746746

747747
let make_wal_manager = Arc::new(move || EitherWAL::B(wal.clone()));
748-
let mut configurators = NamespaceConfigurators::empty();
748+
// let mut configurators = NamespaceConfigurators::empty();
749+
750+
// match client_config {
751+
// Some(_) => todo!("configure replica"),
752+
// // configure primary
753+
// None => self.configure_primary_common(
754+
// base_config,
755+
// &mut configurators,
756+
// make_wal_manager,
757+
// migration_scheduler_handle,
758+
// scripted_backup,
759+
// ),
760+
// }
749761

750-
match client_config {
751-
Some(_) => todo!("configure replica"),
752-
// configure primary
753-
None => self.configure_primary_common(
754-
base_config,
755-
&mut configurators,
756-
make_wal_manager,
757-
migration_scheduler_handle,
758-
scripted_backup,
759-
),
760-
}
761-
762-
Ok(configurators)
762+
self.configurators_common(
763+
base_config,
764+
client_config,
765+
make_wal_manager,
766+
migration_scheduler_handle,
767+
scripted_backup,
768+
)
763769
}
764770

765771
#[cfg(feature = "durable-wal")]

libsql-server/src/namespace/configurator/libsql_wal_replica.rs

Lines changed: 58 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -46,63 +46,64 @@ impl ConfigureNamespace for LibsqlWalReplicaConfigurator {
4646
store: NamespaceStore,
4747
broadcaster: BroadcasterHandle,
4848
) -> Pin<Box<dyn Future<Output = crate::Result<Namespace>> + Send + 'a>> {
49-
Box::pin(async move {
50-
tracing::debug!("creating replica namespace");
51-
let db_path = self.base.base_path.join("dbs").join(name.as_str());
52-
let channel = self.channel.clone();
53-
let uri = self.uri.clone();
54-
55-
let rpc_client = ReplicationLogClient::with_origin(channel.clone(), uri.clone());
56-
// TODO! setup replication
57-
58-
let mut join_set = JoinSet::new();
59-
let namespace = name.clone();
60-
61-
let stats = make_stats(
62-
&db_path,
63-
&mut join_set,
64-
db_config.clone(),
65-
self.base.stats_sender.clone(),
66-
name.clone(),
67-
applied_frame_no_receiver.clone(),
68-
)
69-
.await?;
70-
71-
let connection_maker = MakeWriteProxyConn::new(
72-
db_path.clone(),
73-
self.base.extensions.clone(),
74-
channel.clone(),
75-
uri.clone(),
76-
stats.clone(),
77-
broadcaster,
78-
db_config.clone(),
79-
applied_frame_no_receiver,
80-
self.base.max_response_size,
81-
self.base.max_total_response_size,
82-
primary_current_replication_index,
83-
None,
84-
resolve_attach_path,
85-
self.make_wal_manager.clone(),
86-
)
87-
.await?
88-
.throttled(
89-
self.base.max_concurrent_connections.clone(),
90-
Some(DB_CREATE_TIMEOUT),
91-
self.base.max_total_response_size,
92-
self.base.max_concurrent_requests,
93-
);
94-
95-
Ok(Namespace {
96-
tasks: join_set,
97-
db: Database::Replica(ReplicaDatabase {
98-
connection_maker: Arc::new(connection_maker),
99-
}),
100-
name: name.clone(),
101-
stats,
102-
db_config_store: db_config,
103-
path: db_path.into(),
104-
})
105-
})
49+
todo!()
50+
// Box::pin(async move {
51+
// tracing::debug!("creating replica namespace");
52+
// let db_path = self.base.base_path.join("dbs").join(name.as_str());
53+
// let channel = self.channel.clone();
54+
// let uri = self.uri.clone();
55+
//
56+
// let rpc_client = ReplicationLogClient::with_origin(channel.clone(), uri.clone());
57+
// // TODO! setup replication
58+
//
59+
// let mut join_set = JoinSet::new();
60+
// let namespace = name.clone();
61+
//
62+
// let stats = make_stats(
63+
// &db_path,
64+
// &mut join_set,
65+
// db_config.clone(),
66+
// self.base.stats_sender.clone(),
67+
// name.clone(),
68+
// applied_frame_no_receiver.clone(),
69+
// )
70+
// .await?;
71+
//
72+
// let connection_maker = MakeWriteProxyConn::new(
73+
// db_path.clone(),
74+
// self.base.extensions.clone(),
75+
// channel.clone(),
76+
// uri.clone(),
77+
// stats.clone(),
78+
// broadcaster,
79+
// db_config.clone(),
80+
// applied_frame_no_receiver,
81+
// self.base.max_response_size,
82+
// self.base.max_total_response_size,
83+
// primary_current_replication_index,
84+
// None,
85+
// resolve_attach_path,
86+
// self.make_wal_manager.clone(),
87+
// )
88+
// .await?
89+
// .throttled(
90+
// self.base.max_concurrent_connections.clone(),
91+
// Some(DB_CREATE_TIMEOUT),
92+
// self.base.max_total_response_size,
93+
// self.base.max_concurrent_requests,
94+
// );
95+
//
96+
// Ok(Namespace {
97+
// tasks: join_set,
98+
// db: Database::Replica(ReplicaDatabase {
99+
// connection_maker: Arc::new(connection_maker),
100+
// }),
101+
// name: name.clone(),
102+
// stats,
103+
// db_config_store: db_config,
104+
// path: db_path.into(),
105+
// })
106+
// })
106107
}
107108

108109
fn cleanup<'a>(

libsql-server/src/namespace/configurator/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use super::{
2020

2121
pub mod fork;
2222
mod helpers;
23-
mod libsql_wal_replica;
23+
// mod libsql_wal_replica;
2424
mod primary;
2525
mod replica;
2626
mod schema;

0 commit comments

Comments
 (0)