Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions cmd/utils/app/publishable_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ func CheckFilesForSchema(schema state.SnapNameSchema, params CheckFilesParams) (
// - each data file has corresponding index/bt etc.1
// - versions: between min supported version and max
// - lastFileTo check
// - sum = maxTo check (probably redundant if no gaps/overlaps)

// collect all data files
dataFiles := make([]state.SnapInfo, 0)
sumRange := uint64(0)
if err := filepath.WalkDir(schema.DataDirectory(), func(path string, info fs.DirEntry, err error) error {
if err != nil {
if os.IsNotExist(err) { //it's ok if some file get removed during walk
Expand All @@ -61,7 +59,6 @@ func CheckFilesForSchema(schema state.SnapNameSchema, params CheckFilesParams) (
return nil
}

sumRange += res.To - res.From
dataFiles = append(dataFiles, *res)

return nil
Expand Down Expand Up @@ -89,10 +86,6 @@ func CheckFilesForSchema(schema state.SnapNameSchema, params CheckFilesParams) (
return 0, false, fmt.Errorf("last %s snapshot file must end at %d, found at %d (file: %s)", schema.DataTag(), params.checkLastFileTo, dataFiles[len(dataFiles)-1].To, dataFiles[len(dataFiles)-1].Name)
}

if sumRange != dataFiles[len(dataFiles)-1].To-dataFiles[0].From {
return 0, false, fmt.Errorf("sum of ranges of %s snapshot files (%d) does not match last 'to' value (%d)", schema.DataTag(), sumRange, dataFiles[len(dataFiles)-1].To)
}

prevFrom, prevTo := dataFiles[0].From, dataFiles[0].To
for i := 1; i < len(dataFiles); i++ {
df := dataFiles[i]
Expand Down
Loading