Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autosnapshot when the last slot in an epoch doesn't contain a block #66

Merged
merged 2 commits into from
Nov 20, 2022

Conversation

buffalu
Copy link
Contributor

@buffalu buffalu commented Nov 19, 2022

Fix:

  • starting at the last slot in the epoch, loop backwards until there's a block that returns a result and take a snapshot there.

@@ -122,8 +122,8 @@ create_snapshot_for_slot() {
# for some reason solana-ledger-tool error doesn't cause this script to exit out, so check status here
exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "solana-ledger-tool returned $exit_status"
exit $exit_status
echo "solana-ledger-tool returned $exit_status"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this check not get executed due to set -eux on line 9?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eg

#!/bin/bash

set -exu
function foo {
  rm aldskjdjkldlkjadskjldkjlskjlkjdlslkjda
  echo $?
}

foo

echo 'finished'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

➜  ~ bash demo.sh
+ foo
+ rm aldskjdjkldlkjadskjldkjlskjlkjdlslkjda
rm: cannot remove 'aldskjdjkldlkjadskjldkjlskjlkjdlslkjda': No such file or directory
➜  ~ echo $?
1

the echo finished never runs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah im not totally sure why it doesn't work, there's a comment above it.

segfaultdoc
segfaultdoc previously approved these changes Nov 19, 2022
@buffalu buffalu merged commit b9643ed into master Nov 20, 2022
@buffalu buffalu deleted the lb/fix_autosnapshot branch November 20, 2022 00:01
@buffalu buffalu restored the lb/fix_autosnapshot branch November 20, 2022 00:01
@buffalu buffalu deleted the lb/fix_autosnapshot branch November 20, 2022 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants