From 48688af30a2ec997a8db65fbdd36e67e2a92b61b Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Wed, 22 Apr 2026 09:22:48 +0200 Subject: [PATCH] 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 --- upload-vacuum-v3/main.go | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/upload-vacuum-v3/main.go b/upload-vacuum-v3/main.go index 45fc3c4..6acb1ba 100644 --- a/upload-vacuum-v3/main.go +++ b/upload-vacuum-v3/main.go @@ -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