@@ -793,12 +793,7 @@ impl<T: WasmInstance> WasmModuleInstance<T> {
793793
794794 // Step 10: wait for COMMIT_PERSIST from coordinator (tokio oneshot).
795795 // Sender dropped without sending ⇒ coordinator restarted / aborted ⇒ treat as abort.
796- let persist_commit = match tokio:: time:: timeout (
797- Duration :: from_secs ( 60 ) ,
798- commit_persist_rx,
799- )
800- . await
801- {
796+ let persist_commit = match tokio:: time:: timeout ( Duration :: from_secs ( 60 ) , commit_persist_rx) . await {
802797 Ok ( Ok ( ( ) ) ) => true ,
803798 Ok ( Err ( _) ) => {
804799 // Sender dropped: coordinator crashed / aborted.
@@ -851,19 +846,15 @@ impl<T: WasmInstance> WasmModuleInstance<T> {
851846 if let Err ( e) = stdb. with_auto_commit :: < _ , _ , anyhow:: Error > ( Workload :: Internal , |del_tx| {
852847 Ok ( del_tx. delete_st_2pc_state ( & prepare_id) ?)
853848 } ) {
854- log:: error!(
855- "call_reducer_prepare_and_hold: failed to delete st_2pc_state for {prepare_id}: {e}"
856- ) ;
849+ log:: error!( "call_reducer_prepare_and_hold: failed to delete st_2pc_state for {prepare_id}: {e}" ) ;
857850 }
858851 } else {
859852 // Round 2 abort: discard all deferred transactions.
860853 stdb. abort_durability_barrier ( barrier_offset) ;
861854 // Trigger module restart via the on_panic hook rather than panicking,
862855 // since we're in an async task outside the WASM executor thread.
863856 if let Some ( on_panic) = replica_ctx. on_panic . get ( ) {
864- log:: error!(
865- "2PC persistence aborted for {prepare_id}: triggering module restart"
866- ) ;
857+ log:: error!( "2PC persistence aborted for {prepare_id}: triggering module restart" ) ;
867858 on_panic ( ) ;
868859 }
869860 }
@@ -1215,7 +1206,10 @@ impl InstanceCommon {
12151206 // through), A's own tx must also be deferred. Set barrier at offset - 1
12161207 // so A's tx (at offset) is > barrier and gets deferred.
12171208 let barrier_offset = tx. next_tx_offset ( ) . saturating_sub ( 1 ) ;
1218- self . info . subscriptions . relational_db ( ) . set_durability_barrier ( barrier_offset) ;
1209+ self . info
1210+ . subscriptions
1211+ . relational_db ( )
1212+ . set_durability_barrier ( barrier_offset) ;
12191213 Some ( barrier_offset)
12201214 } else {
12211215 None
@@ -1247,7 +1241,9 @@ impl InstanceCommon {
12471241 } ;
12481242 let url = format ! (
12491243 "{}/v1/database/{}/2pc/abort/{}" ,
1250- base_url, db_identity. to_hex( ) , prepare_id,
1244+ base_url,
1245+ db_identity. to_hex( ) ,
1246+ prepare_id,
12511247 ) ;
12521248 let mut req = client. post ( & url) ;
12531249 if let Some ( ref token) = auth_token {
@@ -1258,7 +1254,10 @@ impl InstanceCommon {
12581254 log:: info!( "2PC abort: {prepare_id} on {db_identity}" ) ;
12591255 }
12601256 Ok ( resp) => {
1261- log:: error!( "2PC abort: failed for {prepare_id} on {db_identity}: status {}" , resp. status( ) ) ;
1257+ log:: error!(
1258+ "2PC abort: failed for {prepare_id} on {db_identity}: status {}" ,
1259+ resp. status( )
1260+ ) ;
12621261 }
12631262 Err ( e) => {
12641263 log:: error!( "2PC abort: transport error for {prepare_id} on {db_identity}: {e}" ) ;
@@ -1289,7 +1288,9 @@ impl InstanceCommon {
12891288 } ;
12901289 let url = format ! (
12911290 "{}/v1/database/{}/2pc/commit/{}" ,
1292- base_url, db_identity. to_hex( ) , prepare_id,
1291+ base_url,
1292+ db_identity. to_hex( ) ,
1293+ prepare_id,
12931294 ) ;
12941295 let mut req = client. post ( & url) ;
12951296 if let Some ( ref token) = auth_token {
@@ -1300,7 +1301,10 @@ impl InstanceCommon {
13001301 log:: info!( "2PC commit (Round 1): {prepare_id} on {db_identity}" ) ;
13011302 }
13021303 Ok ( resp) => {
1303- log:: error!( "2PC commit: failed for {prepare_id} on {db_identity}: status {}" , resp. status( ) ) ;
1304+ log:: error!(
1305+ "2PC commit: failed for {prepare_id} on {db_identity}: status {}" ,
1306+ resp. status( )
1307+ ) ;
13041308 }
13051309 Err ( e) => {
13061310 log:: error!( "2PC commit: transport error for {prepare_id} on {db_identity}: {e}" ) ;
@@ -1367,7 +1371,9 @@ impl InstanceCommon {
13671371 } ;
13681372 let url = format ! (
13691373 "{}/v1/database/{}/2pc/commit-persist/{}" ,
1370- base_url, db_identity. to_hex( ) , prepare_id,
1374+ base_url,
1375+ db_identity. to_hex( ) ,
1376+ prepare_id,
13711377 ) ;
13721378 let mut req = client. post ( & url) ;
13731379 if let Some ( ref token) = auth_token {
@@ -1377,16 +1383,17 @@ impl InstanceCommon {
13771383 Ok ( resp) if resp. status ( ) . is_success ( ) => {
13781384 log:: info!( "2PC commit-persist: {prepare_id} on {db_identity}" ) ;
13791385 // Round 2 complete — delete coordinator log entry.
1380- if let Err ( e) = stdb
1381- . with_auto_commit :: < _ , _ , anyhow:: Error > ( Workload :: Internal , |del_tx| {
1382- Ok ( del_tx. delete_st_2pc_coordinator_log ( prepare_id) ?)
1383- } )
1384- {
1386+ if let Err ( e) = stdb. with_auto_commit :: < _ , _ , anyhow:: Error > ( Workload :: Internal , |del_tx| {
1387+ Ok ( del_tx. delete_st_2pc_coordinator_log ( prepare_id) ?)
1388+ } ) {
13851389 log:: warn!( "delete_st_2pc_coordinator_log failed for {prepare_id}: {e}" ) ;
13861390 }
13871391 }
13881392 Ok ( resp) => {
1389- log:: error!( "2PC commit-persist: failed for {prepare_id} on {db_identity}: status {}" , resp. status( ) ) ;
1393+ log:: error!(
1394+ "2PC commit-persist: failed for {prepare_id} on {db_identity}: status {}" ,
1395+ resp. status( )
1396+ ) ;
13901397 }
13911398 Err ( e) => {
13921399 log:: error!( "2PC commit-persist: transport error for {prepare_id} on {db_identity}: {e}" ) ;
0 commit comments