mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 16:43:21 +00:00
Only check last directory when discovering checkpoint number (#5756)
* Only check last directory when discovering checkpoint number Signed-off-by: Devin Trejo <dtrejo@palantir.com> * Comments for checkpointNum Signed-off-by: Devin Trejo <dtrejo@palantir.com>
This commit is contained in:
parent
3cde8a9941
commit
d77f2aa29c
@ -526,7 +526,8 @@ func (w *WALWatcher) readCheckpoint(checkpointDir string) error {
|
||||
|
||||
func checkpointNum(dir string) (int, error) {
|
||||
// Checkpoint dir names are in the format checkpoint.000001
|
||||
chunks := strings.Split(dir, ".")
|
||||
// dir may contain a hidden directory, so only check the base directory
|
||||
chunks := strings.Split(path.Base(dir), ".")
|
||||
if len(chunks) != 2 {
|
||||
return 0, errors.Errorf("invalid checkpoint dir string: %s", dir)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user