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

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

@the-nando

Description

@the-nando

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#

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions