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

get_latest_snapshot() doesn't find the latest snapshot #8

Open
the-nando opened this issue Apr 30, 2022 · 0 comments
Open

get_latest_snapshot() doesn't find the latest snapshot #8

the-nando opened this issue Apr 30, 2022 · 0 comments

Comments

@the-nando
Copy link

the-nando commented Apr 30, 2022

This commit introduced stable numerical sorting in get_latest_snapshot() but it doesn't seem to be working as it should. Given this directory's content:

root@solana1:/opt/solana-bigtable# find /mnt/data/snapshots -name snapshot-\*.tar\*
/mnt/data/snapshots/snapshot-131873380-7cQMZQPjxzmfYhCB5xbH8atKGoUdcQTVm3fvKojpThyf.tar.zst
/mnt/data/snapshots/snapshot-131847476-zzqcB1f36J8SvyeWTKd7Sns6Z2sYJJZbEAb6TmDbGdk.tar.zst
/mnt/data/snapshots/snapshot-131761946-82Ey2xMXvpr6EbJZrxF9a716kfscg6mqjyabfcBZup5B.tar.zst
root@solana1:/opt/solana-bigtable#

I would expect the last snapshot to be found to be snapshot-131873380-7cQMZQPjxzmfYhCB5xbH8atKGoUdcQTVm3fvKojpThyf.tar.zst but instead:

root@solana1:/opt/solana-bigtable# find /mnt/data/snapshots -name snapshot-\*.tar\* | sort -ns | tail -n1
/mnt/data/snapshots/snapshot-131761946-82Ey2xMXvpr6EbJZrxF9a716kfscg6mqjyabfcBZup5B.tar.zst
root@solana1:/opt/solana-bigtable#

Leaving only the numerical sorting by removing the last-resort sorting fixes the issues:

root@solana1:/opt/solana-bigtable# find /mnt/data/snapshots -name snapshot-\*.tar\* | sort -n | tail -n1
/mnt/data/snapshots/snapshot-131873380-7cQMZQPjxzmfYhCB5xbH8atKGoUdcQTVm3fvKojpThyf.tar.zst
root@solana1:/opt/solana-bigtable#
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

No branches or pull requests

1 participant