File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
libsql-server/src/namespace/configurator Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -935,6 +935,14 @@ impl Replicator {
935
935
} ) ?;
936
936
tracing:: trace!( "Local change counter: {change_counter}" ) ;
937
937
938
+ // TODO: we shouldn't leak the connection here but for some reason when this connection get
939
+ // dropped it seems to checkpoint the database
940
+ if std:: env:: var ( "LIBSQL_BOTTOMLESS_DISABLE_INIT_CHECKPOINTING" ) . is_ok ( )
941
+ || std:: env:: var ( "LIBSQL_DISABLE_INIT_CHECKPOINTING" ) . is_ok ( )
942
+ {
943
+ std:: mem:: forget ( conn) ;
944
+ }
945
+
938
946
Ok ( change_counter. to_be_bytes ( ) )
939
947
}
940
948
Original file line number Diff line number Diff line change @@ -84,9 +84,16 @@ pub(super) async fn make_primary_connection_maker(
84
84
85
85
let bottomless_replicator = match primary_config. bottomless_replication {
86
86
Some ( ref options) => {
87
- tracing:: debug!( "Checkpointing before initializing bottomless" ) ;
88
- crate :: replication:: primary:: logger:: checkpoint_db ( & db_path. join ( "data" ) ) ?;
89
- tracing:: debug!( "Checkpointed before initializing bottomless" ) ;
87
+ // TODO: figure out why we really need this the fixme above is not clear enough but
88
+ // disabling this allows us to prevent checkpointing of the wal file.
89
+ if !std:: env:: var ( "LIBSQL_DISABLE_INIT_CHECKPOINTING" ) . is_ok ( ) {
90
+ tracing:: debug!( "Checkpointing before initializing bottomless" ) ;
91
+ crate :: replication:: primary:: logger:: checkpoint_db ( & db_path. join ( "data" ) ) ?;
92
+ tracing:: debug!( "Checkpointed before initializing bottomless" ) ;
93
+ } else {
94
+ tracing:: warn!( "Disabling initial checkpoint before bottomless" ) ;
95
+ }
96
+
90
97
let options = make_bottomless_options ( options, bottomless_db_id, name. clone ( ) ) ;
91
98
let ( replicator, did_recover) =
92
99
init_bottomless_replicator ( db_path. join ( "data" ) , options, & restore_option) . await ?;
You can’t perform that action at this time.
0 commit comments