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>
pull/5775/head
Devin Trejo 5 years ago committed by Tom Wilkie
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…
Cancel
Save