Skip to content

Dead! drive: optimize performace for --max-age or --min-age - #3806

Closed
fotile96 wants to merge 1 commit into
rclone:masterfrom
fotile96:google-drive-filter
Closed

fotile96 wants to merge 1 commit into
rclone:masterfrom
fotile96:google-drive-filter

Conversation

@fotile96

@fotile96 fotile96 commented Dec 13, 2019 •

Copy link
Copy Markdown
Contributor

The Google Drive API allows to place a clause like "modifiedTime > '2012-06-04T12:00:00'" in the query param, so the filterflags --max-age and --min-age can be applied directly at the directory listing phase rather than in a filter. This is extremely helpful when we want to do an incremental backup of a remote drive with a large number of files but the number of recently changed file is small.

What is the purpose of this change?

Was the change discussed in an issue or in the forum before?

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

Comment thread backend/drive/drive.go Resolved
Comment thread fs/sync/sync.go Resolved
Comment thread backend/drive/drive.go Resolved
Comment thread backend/drive/drive.go Resolved
Comment thread fs/sync/sync.go Resolved
Comment thread fs/sync/contextkeys/contextkeys.go Resolved
Comment thread fs/sync/contextkeys/contextkeys.go Resolved
Comment thread backend/drive/drive.go Resolved
…or --min-age is specified

The Google Drive API allows to place a clause like "modifiedTime > '2012-06-04T12:00:00'" in the query param, so the filterflags --max-age and --min-age can be applied directly at the directory listing phase rather than in a filter. This is extremely helpful when we want to do an incremental backup of a remote drive with a large number of files but the number of recently changed file is small.
@ncw

ncw commented Jan 3, 2020

Copy link
Copy Markdown
Member

Apologies for the delay in reviewing this.

The approach looks very ingenious - well done :-)

I'm a bit concerned about the muddling of the layers - however that is the way of most optimizations!

I think there might be a better way of getting the info from the sync layer to the backend layer but I haven't figured it out yet.

I don't think this optimization will work with rclone sync --delete-excluded - do you?

@ivandeex

Copy link
Copy Markdown
Member

@fotile96
Did you try your patch with rclone sync --delete-excluded?
Does the integration test pass?

@ivandeex

ivandeex commented Dec 1, 2020

Copy link
Copy Markdown
Member

@fotile96 @ncw
The source repository of this PR seems gone.
Do we want to restore it?

@ncw

ncw commented Dec 2, 2020

Copy link
Copy Markdown
Member

We now have the machinery to do this patch properly. Namely we are passing the filter flags in the context. So the google drive backend could read the min age and max age directly from there.

So I think it would be worth rescuing and adjusting to the new context use (calling filter.GetConfig(ctx))

@ivandeex

ivandeex commented Dec 2, 2020

Copy link
Copy Markdown
Member

@fotile96
The recovered comit has been saved under https://github.com/ivandeex/rclone/commits/pr3806-fotile96-gdrive-optimize
I rebased it on current master.
You can fork rclone again and apply the commit to recover this PR.

@ivandeex

ivandeex commented Dec 2, 2020 •

Copy link
Copy Markdown
Member

@ncw

We now have the machinery to do this patch properly. Namely we are passing the filter flags in the context. So the google drive backend could read the min age and max age directly from there.

Yes it can, but besides filter flags the patch needs source/destination file names.
That's beyond the machinery.
ivandeex@f29908a#diff-4dbf23008061a479db91ae57841d15a25dd832da30fd9e536cd5de95f2efd1beR157

So I think it would be worth rescuing and adjusting to the new context use (calling filter.GetConfig(ctx))

Rescued.
Will not modify code a.t.m. as we're waiting for author to remember us, show up and test the result.

@ivandeex

Copy link
Copy Markdown
Member

@ncw @fotile96 This PR will have to be recreated from the saved commit since the original repository is gone.

@ivandeex ivandeex changed the title Optimize the performace of Google Drive remote source when --max-age or --min-age is specified drive: optimize performace for --max-age or --min-age (dead PR) Feb 13, 2021
@ivandeex
ivandeex marked this pull request as draft February 13, 2021 21:47
@ivandeex ivandeex changed the title drive: optimize performace for --max-age or --min-age (dead PR) Dead! drive: optimize performace for --max-age or --min-age Feb 13, 2021
@ivandeex ivandeex mentioned this pull request Feb 13, 2021
4 of 5 tasks
@ivandeex

Copy link
Copy Markdown
Member

Closing in favor of #5023

@ivandeex ivandeex closed this Feb 13, 2021
@rclone rclone locked as resolved and limited conversation to collaborators Feb 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants