-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Improve sync performance for pull-mirrors #19125
Merged
6543
merged 25 commits into
go-gitea:main
from
petergardfjall:pull-mirror-tag-sync-optimization
Mar 31, 2022
Merged
Improve sync performance for pull-mirrors #19125
6543
merged 25 commits into
go-gitea:main
from
petergardfjall:pull-mirror-tag-sync-optimization
Mar 31, 2022
Commits on Mar 31, 2022
-
optimize tag-release sync procedure for pull-mirrors
For large repositories with many tags, SyncReleasesWithTags can be a costly operation (taking several minutes to complete). The reason is two-fold 1. on sync, every upstream repo tag is compared (for changes) against existing local entries in the release table to ensure that they are up-to-date. 2. the procedure for getting each tag involves several git operations git show-ref --tags -- v8.2.4477 git cat-file -t 29ab6ce9f36660cffaad3c8789e71162e5db5d2f git cat-file -p 29ab6ce9f36660cffaad3c8789e71162e5db5d2f git rev-list --count 29ab6ce9f36660cffaad3c8789e71162e5db5d2f of which the 'git rev-list --count' can be particularly heavy. This commit optimizes performance for pull-mirrors. We utilize the fact that a pull-mirror is always identical to its upstream and rebuild the entire release table on every sync and use a batch 'git for-each-ref .. refs/tags' call to retrieve all tags in one go. For large mirror repos, with hundreds of annotated tags, this brings down the duration of the sync operation from several minutes to a few seconds. Signed-off-by: Peter Gardfjäll <peter.gardfjall.work@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for aa3a762 - Browse repository at this point
Copy the full SHA aa3a762View commit details -
optimize tag-release sync procedure for pull-mirrors
For large repositories with many tags, SyncReleasesWithTags can be a costly operation (taking several minutes to complete). The reason is two-fold 1. on sync, every upstream repo tag is compared (for changes) against existing local entries in the release table to ensure that they are up-to-date. 2. the procedure for getting each tag involves several git operations git show-ref --tags -- v8.2.4477 git cat-file -t 29ab6ce9f36660cffaad3c8789e71162e5db5d2f git cat-file -p 29ab6ce9f36660cffaad3c8789e71162e5db5d2f git rev-list --count 29ab6ce9f36660cffaad3c8789e71162e5db5d2f of which the 'git rev-list --count' can be particularly heavy. This commit optimizes performance for pull-mirrors. We utilize the fact that a pull-mirror is always identical to its upstream and rebuild the entire release table on every sync and use a batch 'git for-each-ref .. refs/tags' call to retrieve all tags in one go. For large mirror repos, with hundreds of annotated tags, this brings down the duration of the sync operation from several minutes to a few seconds. Signed-off-by: Peter Gardfjäll <peter.gardfjall.work@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 33f5a5e - Browse repository at this point
Copy the full SHA 33f5a5eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5cd3114 - Browse repository at this point
Copy the full SHA 5cd3114View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ce50be - Browse repository at this point
Copy the full SHA 4ce50beView commit details -
Configuration menu - View commit details
-
Copy full SHA for d87be92 - Browse repository at this point
Copy the full SHA d87be92View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e67646 - Browse repository at this point
Copy the full SHA 0e67646View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1fc0bb4 - Browse repository at this point
Copy the full SHA 1fc0bb4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d30da1 - Browse repository at this point
Copy the full SHA 6d30da1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c91e3d - Browse repository at this point
Copy the full SHA 5c91e3dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2847d13 - Browse repository at this point
Copy the full SHA 2847d13View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d6c962 - Browse repository at this point
Copy the full SHA 5d6c962View commit details -
Configuration menu - View commit details
-
Copy full SHA for 73bb43e - Browse repository at this point
Copy the full SHA 73bb43eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4274804 - Browse repository at this point
Copy the full SHA 4274804View commit details -
Configuration menu - View commit details
-
Copy full SHA for 638d690 - Browse repository at this point
Copy the full SHA 638d690View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38a1b66 - Browse repository at this point
Copy the full SHA 38a1b66View commit details -
Configuration menu - View commit details
-
Copy full SHA for 20f6dc5 - Browse repository at this point
Copy the full SHA 20f6dc5View commit details -
Configuration menu - View commit details
-
Copy full SHA for a5220cf - Browse repository at this point
Copy the full SHA a5220cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for fcd1de6 - Browse repository at this point
Copy the full SHA fcd1de6View commit details -
Configuration menu - View commit details
-
Copy full SHA for ef6352c - Browse repository at this point
Copy the full SHA ef6352cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f3908c - Browse repository at this point
Copy the full SHA 2f3908cView commit details -
Configuration menu - View commit details
-
Copy full SHA for aa267d2 - Browse repository at this point
Copy the full SHA aa267d2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 61eae9e - Browse repository at this point
Copy the full SHA 61eae9eView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd7f58c - Browse repository at this point
Copy the full SHA fd7f58cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c1da4e0 - Browse repository at this point
Copy the full SHA c1da4e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for b5ef68f - Browse repository at this point
Copy the full SHA b5ef68fView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.