upload-vacuum-v3: do not look for caibx files in the sysupdate/ dir

it's the desync store itself and definitely will not contain any caibx
files.

this should improve timeout scenarios during pruning
This commit is contained in:
Harald Sitter
2026-04-22 09:22:48 +02:00
parent 3cc058c642
commit 48688af30a

View File

@@ -108,25 +108,43 @@ func downloadCaibxFiles(client *minio.Client) (caibxFiles []string, err error) {
log.Println("Downloading caibx files from", bucketName)
os.RemoveAll("caibx-files")
objects := client.ListObjects(ctx, bucketName, minio.ListObjectsOptions{
Recursive: true,
})
for object := range objects {
for object := range client.ListObjects(ctx, bucketName, minio.ListObjectsOptions{
Recursive: false,
}) {
if object.Err != nil {
log.Fatalln(object.Err)
}
if !strings.HasSuffix(object.Key, ".caibx") {
if !strings.HasSuffix(object.Key, "/") {
// Not a dir.
continue
}
log.Println("Downloading caibx", object.Key)
path := filepath.Join("caibx-files", object.Key)
err := client.FGetObject(ctx, bucketName, object.Key, path, minio.GetObjectOptions{})
if err != nil {
log.Fatalln(errors.New("Failed to download caibx " + object.Key + ": " + err.Error()))
if object.Key == "sysupdate/" {
// The store itself wont contain any caibx files.
continue
}
for object := range client.ListObjects(ctx, bucketName, minio.ListObjectsOptions{
Prefix: object.Key,
Recursive: true,
}) {
if object.Err != nil {
log.Fatalln(object.Err)
}
if !strings.HasSuffix(object.Key, ".erofs.caibx") {
continue
}
log.Println("Downloading caibx", object.Key)
path := filepath.Join("caibx-files", object.Key)
err := client.FGetObject(ctx, bucketName, object.Key, path, minio.GetObjectOptions{})
if err != nil {
log.Fatalln(errors.New("Failed to download caibx " + object.Key + ": " + err.Error()))
}
caibxFiles = append(caibxFiles, path)
}
caibxFiles = append(caibxFiles, path)
}
return