Save snapshots followed by accounts to avoid stale account data (#4847)
* save snapshots before account stores * update comment
This commit is contained in:
parent
97c97db97e
commit
44a572416d
|
@ -489,7 +489,13 @@ while true; do
|
||||||
new_state_archive="$SOLANA_RSYNC_CONFIG_DIR"/new_state.tgz
|
new_state_archive="$SOLANA_RSYNC_CONFIG_DIR"/new_state.tgz
|
||||||
(
|
(
|
||||||
rm -rf "$new_state_dir" "$new_state_archive"
|
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"
|
cd "$new_state_dir"
|
||||||
tar zcfS "$new_state_archive" ./*
|
tar zcfS "$new_state_archive" ./*
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue