-
Notifications
You must be signed in to change notification settings - Fork 562
Reindex logging and perf enhancements #5214
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
base: main
Are you sure you want to change the base?
Conversation
Added Performance logging in ReindexProcessingJob Added parallel processing of resources in ReindexProcessingJob increasing runtimes 2x per job Added IgnoreSearchParamHash to queryHintParameterNames collection in SearchOptionsFactory to prevent error during reindexing queries
… counters Fixing logging in ReindexProcessingJob
|
|
||
| private async Task<SearchResult> GetResourcesToReindexAsync(SearchResultReindex searchResultReindex, CancellationToken cancellationToken) | ||
| { | ||
| var stopwatch = Stopwatch.StartNew(); |
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.
My problem with detailed time logging is thar it makes a lot of clutter and makes main code not readable.
| entry.Resource.SearchParameterHash = searchParamHash; | ||
| _resourceWrapperFactory.Update(entry.Resource); | ||
| updateSearchIndices.Add(entry.Resource); | ||
| // Parallel processing of search parameter extraction |
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.
As discussed offline, we should not do this.
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.
please address my comments.
Description
This pull request introduces significant improvements to logging, error handling, and performance instrumentation in the reindex job orchestration and processing workflow. The changes provide detailed timing and progress information for each stage of the reindex process, enhance cancellation and exception handling, and optimize resource processing through parallelization. These updates will make it easier to monitor, debug, and optimize reindex jobs.
Logging and Performance Instrumentation:
ReindexProcessingJob.cs. Each major step now records elapsed time and throughput metrics for better observability. [1] [2] [3] [4] [5] [6] [7]Error and Cancellation Handling:
OperationCanceledExceptionin both orchestrator and processing jobs, ensuring logs accurately reflect whether cancellation was due to a caller request or a timeout, and added additional error logging for unexpected exceptions. [1] [2] [3] [4]Performance Optimization:
ProcessSearchResultsAsyncto use parallel processing withConcurrentBag, leveraging all available CPU cores for faster search parameter extraction and batch preparation. Added detailed logging for extraction and batch update timings. [1] [2]Minor Improvements:
KnownQueryParameterNames.IgnoreSearchParamHashto the set of query hint parameter names inSearchOptionsFactory.cs, potentially enabling new query behaviors.Related issues
Addresses AB#175355.
Testing
<style> </style>FHIR Team Checklist
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)