This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
V3: extract parallelized commit processing into common utility class #401
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dtivel
requested review from
joelverhagen,
agr,
loic-sharma,
xavierdecoster,
shishirx34,
ryuyu,
chenriksson,
cristinamanum,
skofman1 and
scottbommarito
November 13, 2018 19:22
joelverhagen
approved these changes
Nov 13, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one 🥇. It is perhaps worth noting to posterity that the aim of this PR is to maintain as many assumptions as possible that are guaranteed by our current implementation. For example, the part about tracking the minimum commit timestamp of a batch before filtering out non-latest leaves per package identity... this is not strictly necessary to maintain contract of any of our V3 resources but is essentially done by today's implementation of, say, catalog2registration. |
agr
reviewed
Nov 13, 2018
agr
reviewed
Nov 13, 2018
agr
reviewed
Nov 13, 2018
agr
reviewed
Nov 13, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Progress on https://github.com/NuGet/Engineering/issues/1843.
At a high level this change aims to do 3 things:
Here is the general approach for parallelizing catalog commits in jobs like Catalog2Registration and Catalog2Dnx:
Where
P
represents a package ID andT
a commit timestamp, suppose we have the following catalog commits for fixed timestamp rangeT₀-T₃
:Each column contains all catalog commits for its corresponding package ID (not identity).
Each column is represented by a
CatalogCommitBatchTask
instance. Each group of columns sharing the same minimum commit timestamp is represented by aCatalogCommitBatchTasks
instance. In the above example, there will be 3CatalogCommitBatchTasks
instances:P₀
andP₁
, since they share the same minimum commit timestampT₀
P₂
P₃
RegistrationCollector
(and presumablyDnxCatalogCollector
in the future) processesmaxConcurrentBatches
columns in parallel. The default is 10.Only when all processing for a
CatalogCommitBatchTasks
instance completes successfully will aCommitCollector
update its cursor. In the above example, the cursor will be updated as follows:P₀-T₀
andP₁-T₀
succeed, update the cursor toT₀
.P₂-T₁
succeeds, update the cursor toT₁
. Successful completion ofP₀-T₁
is implied by completion of the previous step.P₃-T₂
succeeds, update the cursor toT₃
. Successful completion ofP₀-T₁
andP₂-T₁
is implied by completion of the previous step. Note that since this is the last work item for the given time range, the cursor is not updated toT₂
but instead the maximum commit timestamp for the entire commit timestamp range.This PR adds 2 improvements over the existing implementation:
T₃
instead of firstT₂
and thenT₃
.P₀-T₀
,P₀-T₁
, andP₁-T₀
would be skipped.