Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Save snapshots followed by accounts to avoid stale account data (#4847)
Browse files Browse the repository at this point in the history
* save snapshots before account stores

* update comment
  • Loading branch information
sambley authored and mvines committed Jun 27, 2019
1 parent 97c97db commit 44a5724
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion multinode-demo/fullnode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,13 @@ while true; do
new_state_archive="$SOLANA_RSYNC_CONFIG_DIR"/new_state.tgz
(
rm -rf "$new_state_dir" "$new_state_archive"
cp -a "$state_dir" "$new_state_dir"
mkdir -p "$new_state_dir"
# When saving the state, its necessary to have the snapshots be saved first
# followed by the accounts folder. This would avoid conditions where incomplete
# accounts gets picked while its still in the process of being updated and are
# not frozen yet.
cp -a "$state_dir"/snapshots "$new_state_dir"
cp -a "$state_dir"/accounts "$new_state_dir"
cd "$new_state_dir"
tar zcfS "$new_state_archive" ./*
)
Expand Down

0 comments on commit 44a5724

Please sign in to comment.