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

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant