Skip to content

Conversation

boris-ilijic
Copy link
Member

@boris-ilijic boris-ilijic commented Sep 12, 2025

PBM-1490 Powered by Pull Request Badge

This is additional improvement for #1183:

  • Enables and adds Downloader logic for the split-merge middleware by implementing the DownloadStat method across all storages and providing constructor for downloader creation.
  • Applys default maxObjSizeGB value in case of invalid configuration value (e.g. 0 or less than 0).

Downloader public methods are merged with S3 storage.
Downloader public methods are merged with GCS storage.
Method returns download statistics.
Currently it's only implemented for S3 and GCS.
Other storaget types returns zero value.
@boris-ilijic boris-ilijic changed the title PBM-1490: Enable downloader for split-merge middleware PBM-1490: Enable Downloader for split-merge middleware Sep 12, 2025
@boris-ilijic boris-ilijic force-pushed the PBM-1490-split-merge-mw-enable-downloader branch from bc8d6ba to b414148 Compare September 12, 2025 16:11
@boris-ilijic boris-ilijic force-pushed the PBM-1490-split-merge-mw-enable-downloader branch from b414148 to 5ebc206 Compare September 12, 2025 16:44
If maxObjSizeGB has invalid value (zero or less than zero) PBM will
apply default value for it (the same as it is not specified withing
config).
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables the Downloader functionality for the split-merge middleware by implementing the DownloadStat() method across all storage implementations and refactoring the physical restore process to use a unified storage configuration approach.

  • Adds DownloadStat() method to the storage interface and implements it for all storage types
  • Creates StorageWithDownloaderFromConfig() function to configure storage with downloader capabilities for S3 and GCS
  • Refactors physical restore to use the new unified storage configuration instead of type-specific downloader instantiation

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pbm/util/storage.go Adds new function to create storage with downloader configuration for S3/GCS types
pbm/storage/storage.go Extends storage interface with DownloadStat method
pbm/storage/split_merge_mw.go Implements DownloadStat method for split-merge middleware
pbm/storage/s3/s3.go Adds NewWithDownloader function and refactors downloader initialization
pbm/storage/s3/download.go Consolidates download functionality and replaces interface{} with any
pbm/storage/gcs/gcs.go Adds NewWithDownloader function for GCS storage
pbm/storage/gcs/download.go Consolidates GCS download functionality
pbm/storage/fs/fs.go Implements empty DownloadStat method for filesystem storage
pbm/storage/blackhole/blackhole.go Implements empty DownloadStat method for blackhole storage
pbm/storage/azure/azure.go Implements empty DownloadStat method for Azure storage
pbm/restore/physical.go Refactors to use new unified storage configuration approach
pbm/restore/logical_cfgsvr_full_test.go Implements DownloadStat method for test storage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@boris-ilijic boris-ilijic marked this pull request as ready for review September 12, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants