Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] - Add storage limit check to file migration plugin (ideally to core too) "[FEATURE REQUEST]" . #963

Open
tomekduda opened this issue Jan 26, 2025 · 4 comments
Assignees
Labels
feature-request New feature request or a change in the existing functionality to-be-closed The issue is about to be closed

Comments

@tomekduda
Copy link

Is your feature request related to a problem? Please describe.

I am seeding a developer sandbox (200 MB data storage, 200 MB file storage) with production data. I'm using core:ExportFiles, the (slightly anonymised) relevant bit of export.json is below, I'm already limiting files to 1 MB size

{
    "operation": "Upsert",
    "externalId": "Name",
    "query": "SELECT all FROM FileApproval__c",
    "master": false,
    "afterAddons": [
        {
        "module": "core:ExportFiles",
        "args": {
            "operation": "Upsert",
            "maxFileSize": 1048576,
            "deleteOldData": true
        }
        }
    ],
    "deleteOldData": true
}

Of course there's no total cap so after a while the storage starts to skyrocket:

Image

And logs indicate the plugin dutifully tries to load:

WARNING: [13:52:45.239] [WARN] [Batch# REST:Insert] {ContentVersion} Completed with issues. 17 records processed, 17 records failed.
[13:52:45.242] {ContentVersion} The Insert API operation has been completed.
[13:52:45.360] [core:ExportFiles] {FileApproval__c} Processing chunk #81 of 15 items.
[13:52:45.903] In progress... Completed 0/15 records.
[13:52:46.393] In progress... Completed 10/15 records.
[13:52:47.124] In progress... Completed 15/15 records.
[13:52:47.128] {ContentVersion} The Insert API operation has been started using REST API.
WARNING: [13:52:55.103] [WARN] [Batch# REST:Insert] {ContentVersion} Completed with issues. 15 records processed, 15 records failed.
[13:52:55.108] {ContentVersion} The Insert API operation has been completed.

Describe the solution you'd like

I don't know what's easier / makes most sense?

  • Perhaps a new config option for the core:ExportFiles to stop after inserting X megabytes? Default zero meaning no limit?
  • "stop after using 95% of the org storage"?
  • or if it detects a 100% fail rate - can it run a REST call? sf api request rest 'services/data/v62.0/limits' for my situation returns
"DataStorageMB": {
  "Max": 200,
  "Remaining": 182
},
"FileStorageMB": {
  "Max": 200,
  "Remaining": -69
}

It wouldn't be perfect as storage statistics have couple minutes delay (so I imagine even detecting "95% reached" would not work in real life) - but it'd beat waiting through a step I know won't get any better.

@tomekduda tomekduda added the feature-request New feature request or a change in the existing functionality label Jan 26, 2025
@hknokh
Copy link
Collaborator

hknokh commented Jan 26, 2025

Hello, @tomekduda

Thank you for your feature request.
I will review it as soon as possible and provide updates as they become available.

Cheers

Copy link

This case has been marked as 'to-be-closed', since it has no activity for the 3 days.
It will be automatically closed in another 3 days of inactivity.

@github-actions github-actions bot added the to-be-closed The issue is about to be closed label Jan 30, 2025
@hknokh2
Copy link
Contributor

hknokh2 commented Jan 31, 2025

Hello, thanks for the idea.
I will put it on the track for the future development.
For now I don't plan to add new features to the project, but may be later.
Cheers.

@github-actions github-actions bot removed the to-be-closed The issue is about to be closed label Feb 1, 2025
Copy link

github-actions bot commented Feb 5, 2025

This case has been marked as 'to-be-closed', since it has no activity for the 3 days.
It will be automatically closed in another 3 days of inactivity.

@github-actions github-actions bot added the to-be-closed The issue is about to be closed label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature request or a change in the existing functionality to-be-closed The issue is about to be closed
Projects
None yet
Development

No branches or pull requests

3 participants