Skip to content

Commit

Permalink
debug #888, debug TestLongListRemote
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Jul 26, 2024
1 parent b79a0fb commit 0644b5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ jobs:
RUN_PARALLEL: 4
GOROOT: ${{ env.GOROOT_1_22_X64 }}
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
# TEST_LOG_LEVEL: "debug"
# options for advanced debug CI/CD
# RUN_TESTS: "TestIntegrationS3"
# LOG_LEVEL: "debug"
RUN_TESTS: "TestLongListRemote"
LOG_LEVEL: "debug"
# TEST_LOG_LEVEL: "debug"
# GCS_DEBUG: "true"
# SFTP_DEBUG: "true"
# AZBLOB_DEBUG: "true"
Expand Down
8 changes: 6 additions & 2 deletions pkg/storage/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func (bd *BackupDestination) BackupList(ctx context.Context, parseMetadata bool,
if err != nil {
return nil, err
}
cacheMiss := false
err = bd.Walk(ctx, "/", false, func(ctx context.Context, o RemoteFile) error {
backupName := strings.Trim(o.Name(), "/")
if !parseMetadata || (parseMetadataOnly != "" && parseMetadataOnly != backupName) {
Expand Down Expand Up @@ -231,6 +232,7 @@ func (bd *BackupDestination) BackupList(ctx context.Context, parseMetadata bool,
}
goodBackup := Backup{m, "", mf.LastModified()}
listCache[backupName] = goodBackup
cacheMiss = true
result = append(result, goodBackup)
return nil
})
Expand All @@ -244,8 +246,10 @@ func (bd *BackupDestination) BackupList(ctx context.Context, parseMetadata bool,
sort.SliceStable(result, func(i, j int) bool {
return result[i].UploadDate.Before(result[j].UploadDate)
})
if err = bd.saveMetadataCache(ctx, listCache, result); err != nil {
return nil, fmt.Errorf("bd.saveMetadataCache return error: %v", err)
if cacheMiss {
if err = bd.saveMetadataCache(ctx, listCache, result); err != nil {
return nil, fmt.Errorf("bd.saveMetadataCache return error: %v", err)
}
}
return result, nil
}
Expand Down

0 comments on commit 0644b5e

Please sign in to comment.