-
Notifications
You must be signed in to change notification settings - Fork 51
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
sql: allow multiple informers to start in parallel #99
Conversation
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.
That's a nice addition. Some comments/requests for changes.
36edbf4
to
39899ce
Compare
Creating an Informer used to block creation of any other Informers for the whole duration of the warm-up time via one mutex. This patch allows for multiple Informers to be created in parallel, with one mutex per gvk. One overall RWMutex is still kept to avoid races with Reset(). Signed-off-by: Silvio Moioli <[email protected]>
Signed-off-by: Silvio Moioli <[email protected]>
Signed-off-by: Silvio Moioli <[email protected]>
4a8a2d8
to
c58211e
Compare
Co-authored-by: Tom Lebreux <[email protected]> Signed-off-by: Silvio Moioli <[email protected]>
Signed-off-by: Silvio Moioli <[email protected]>
c58211e
to
2c2f081
Compare
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.
One comment on test, otherwise looks good. thanks!
Signed-off-by: Silvio Moioli <[email protected]>
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.
Approving to unblock merging (since the required 2 approvals have been made).
This includes various fixes to the UI Server-Side Pagination experimental feature: https://ranchermanager.docs.rancher.com/how-to-guides/advanced-user-guides/enable-experimental-features/ui-server-side-pagination - rancher/lasso#86 - rancher/lasso#90 - rancher/lasso#85 - rancher/lasso#92 - rancher/lasso#79 - rancher/lasso#97 - rancher/lasso#94 - rancher/lasso#98 - rancher/lasso#108 - rancher/lasso#99 It also includes improvements to code collecting metrics: - rancher/lasso#89 - rancher/lasso#95 And to test code: - rancher/lasso#100 - rancher/lasso#101 Signed-off-by: Silvio Moioli <[email protected]>
Creating an Informer used to block creation of any other Informers for the whole duration of the warm-up time via one mutex.
Warm-up can be long if very many resources are involved, and the behavior blocked any unrelated Steve API calls (eg. UI).
This patch allows for multiple Informers to be created in parallel, with one mutex per gvk.
One overall
RWMutex
is still kept to avoid races withReset()
.best reviewed commit-by-commit
QA notes
This patch allows for the parallelization of the creation of informers and can be verified by looking for "[DEBUG] CacheFor" log messages in rancher debug logs while navigating the UI.
In the example below, note how several Informers start at 9:30:02 and finish at different points in time, with different durations (ConfigMaps is the slowest as it was pre-loaded with 5000 objects).