/// Flushes to disk all the canister heap deltas accumulated in memory
/// during one round of execution.
Flushes to disk all the canister heap deltas accumulated in memory
during one round of execution.
Flushes to disk all the canister heap deltas accumulated in memory during one round of execution .
fn flush_page_maps(&self, tip_state: &mut ReplicatedState) {
        let tip_layout = self
            .state_layout
            .tip()
            .unwrap_or_else(|err| fatal!(self.log, "Failed to access @TIP: {}", err));
        for canister in tip_state.canisters_iter_mut() {
            let canister_id = canister.canister_id();
            let canister_layout = tip_layout.canister(&canister_id).unwrap_or_else(|err| {
                fatal!(
                    self.log,
                    "Failed to access canister {} layout @TIP {}: {}",
                    canister_id,
                    tip_layout.raw_path().display(),
                    err
                )
            });
            if let Some(execution_state) = &mut canister.execution_state {
                let memory_path = &canister_layout.vmemory_0();
                execution_state
                    .wasm_memory
                    .page_map
                    .persist_round_delta(memory_path)
                    .unwrap_or_else(|err| {
                        fatal!(
                            self.log,
                            "Failed to persist page delta of canister {} to file {}: {}",
                            canister_id,
                            memory_path.display(),
                            err
                        )
                    });
                execution_state.wasm_memory.page_map.strip_round_delta();
                let stable_memory_path = &canister_layout.stable_memory_blob();
                execution_state
                    .stable_memory
                    .page_map
                    .persist_round_delta(stable_memory_path)
                    .unwrap_or_else(|err| {
                        fatal!(
                            self.log,
                            "Failed to persist stable page delta of canister {} to file {}: {}",
                            canister_id,
                            stable_memory_path.display(),
                            err
                        )
                    });
                execution_state.stable_memory.page_map.strip_round_delta();
            }
        }
    }
fn flush_page_maps ( & self , tip_state : & mut ReplicatedState ) { let tip_layout = self . state_layout . tip ( ) . unwrap_or_else ( | err | fatal ! ( self log " " err ) ) ; for canister in tip_state . canisters_iter_mut ( ) { let canister_id = canister . canister_id ( ) ; let canister_layout = tip_layout . canister ( & canister_id ) . unwrap_or_else ( | err | { fatal ! ( self log " " canister_id tip_layout raw_path ( ) display ( ) err ) } ) ; if let Some ( execution_state ) = & mut canister . execution_state { let memory_path = & canister_layout . vmemory_0 ( ) ; execution_state . wasm_memory . page_map . persist_round_delta ( memory_path ) . unwrap_or_else ( | err | { fatal ! ( self log " " canister_id memory_path display ( ) err ) } ) ; execution_state . wasm_memory . page_map . strip_round_delta ( ) ; let stable_memory_path = & canister_layout . stable_memory_blob ( ) ; execution_state . stable_memory . page_map . persist_round_delta ( stable_memory_path ) . unwrap_or_else ( | err | { fatal ! ( self log " " canister_id stable_memory_path display ( ) err ) } ) ; execution_state . stable_memory . page_map . strip_round_delta ( ) ; } } }
Flushes to disk all the canister heap deltas accumulated in memory
during one round of execution.
Flushes to disk all the canister heap deltas accumulated in memory during one round of execution .
&self
tip_state
&mut ReplicatedState