-
Notifications
You must be signed in to change notification settings - Fork 7
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
MODSOURMAN-1195 Save job execution progress in batches #908
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
okolawole-ebsco
commented
May 28, 2024
@@ -103,67 +90,5 @@ private Future<JobExecution> updateJobStatusToError(String jobExecutionId, Okapi | |||
.withErrorStatus(StatusDto.ErrorStatus.FILE_PROCESSING_ERROR), params); | |||
} | |||
|
|||
private Future<Boolean> updateJobExecutionIfAllRecordsProcessed(String jobExecutionId, JobExecutionProgress progress, OkapiConnectionParams params) { |
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.
These lines were moved to the JobExecutionProgressVerticle file.
KaterynaSenchenko
approved these changes
Jun 3, 2024
JavokhirAbdullayev
approved these changes
Jun 4, 2024
JavokhirAbdullayev
requested review from
Aliaksandr-Fedasiuk,
dmytrokrutii,
VRohach,
RuslanLavrov,
RomanChernetskyi and
Maksat-Galymzhan
June 4, 2024 07:02
RuslanLavrov
reviewed
Jun 5, 2024
mod-source-record-manager-server/src/main/java/org/folio/services/progress/OptionalCodec.java
Outdated
Show resolved
Hide resolved
RuslanLavrov
approved these changes
Jun 5, 2024
Quality Gate passedIssues Measures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
Save job execution progress in batches to improve performance and scalability.
Approach
Instead of each record attempt to update job execution progress, a message is sent to an address over the Vert.x event bus. Upon successful placement of the message in the event bus, processing of the record continues.
On the consumer side, messages are group in batches by tenant ID and job execution ID. The group of messages are then reduced into a single job execution progress which is then saved into the database and overall job execution status is updated.
In local testing, update of job execution progress happens 10,000 times for a data import job of 10,000 records. Total execution time for all 10,000 database calls was 53 seconds(mean execution time for each call was 5.3 milliseconds). After this optimization, there were only 352 database calls with a total execution time of 17 milliseconds.
Advantages
Disadvantages