-
Notifications
You must be signed in to change notification settings - Fork 301
Support HA & slow proliferation of cached value - Scenario 2 + 3 #15916
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6781b99
WIP
richard-cox d3770b5
very WIP
richard-cox 93eef9a
more WIP
richard-cox d42f064
more WIP
richard-cox 03774eb
minor refactors, plus move from resource.changes to fetchResources
richard-cox 5debeea
wgtsfsfsdfsfsdfggfgdfgdfg
richard-cox 714779e
before rework...
richard-cox 7b5ef37
not running, started split of execute and recurse
richard-cox cc7e9b2
scenarios 1-3 tested with socket...on to wrapper
richard-cox 9e08244
started wrapper
richard-cox 27c7099
updates
richard-cox 496aab9
all scenarios testdd
richard-cox a280931
Merge remote-tracking branch 'upstream/master' into pagination-ha-2
richard-cox 68c7be0
fix unit tests
richard-cox a17fdcf
tidying up, started adding unit tests
richard-cox eb433f2
more tidying up, more unit tests
richard-cox 477dd17
add tests for backoff
richard-cox 731bc57
tidying up + improving diff
richard-cox f669552
Merge remote-tracking branch 'upstream/master' into pagination-ha-2
richard-cox ab025cb
Updates following review
richard-cox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,9 @@ export default { | |
| }, | ||
|
|
||
| data() { | ||
| const sideNavServiceInitialized = sideNavService.initialized; | ||
| const maxClustersToShow = MENU_MAX_CLUSTERS; | ||
|
|
||
| sideNavService.init(this.$store); | ||
|
|
||
| const { displayVersion, fullVersion } = getVersionInfo(this.$store); | ||
|
|
@@ -43,26 +46,27 @@ export default { | |
| const provClusters = !canPagination && hasProvCluster ? this.$store.getters[`management/all`](CAPI.RANCHER_CLUSTER) : []; | ||
| const mgmtClusters = !canPagination ? this.$store.getters[`management/all`](MANAGEMENT.CLUSTER) : []; | ||
|
|
||
| if (!canPagination) { | ||
| // Reduce the impact of the initial load, but only if we're not making a request | ||
| if (!canPagination || !sideNavServiceInitialized) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix multiple request to fetch clusters when using side nav to move around
|
||
| // Reduce the impact of the initial load, or properly initialised | ||
| // Doing this here means we don't need an 'immediate' on the watches below | ||
| const args = { | ||
| pinnedIds: this.pinnedIds, | ||
| searchTerm: this.search, | ||
| unPinnedMax: this.maxClustersToShow | ||
| pinnedIds: this.$store.getters['prefs/get'](PINNED_CLUSTERS), | ||
| searchTerm: '', | ||
| unPinnedMax: maxClustersToShow | ||
| }; | ||
|
|
||
| helper.update(args); | ||
| } | ||
|
|
||
| return { | ||
| shown: false, | ||
| shown: false, | ||
| displayVersion, | ||
| fullVersion, | ||
| clusterFilter: '', | ||
| clusterFilter: '', | ||
| hasProvCluster, | ||
| maxClustersToShow: MENU_MAX_CLUSTERS, | ||
| emptyCluster: BLANK_CLUSTER, | ||
| routeCombo: false, | ||
| maxClustersToShow, | ||
| emptyCluster: BLANK_CLUSTER, | ||
| routeCombo: false, | ||
|
|
||
| canPagination, | ||
| helper, | ||
|
|
@@ -284,7 +288,6 @@ export default { | |
| // 2. When SSP is disabled (legacy) reduce fn churn (this was a known performance customer issue) | ||
|
|
||
| pinnedIds: { | ||
| immediate: true, | ||
| handler(neu, old) { | ||
| if (sameContents(neu, old)) { | ||
| return; | ||
|
|
@@ -302,20 +305,28 @@ export default { | |
|
|
||
| provClusters: { | ||
| handler(neu, old) { | ||
| if (this.canPagination) { | ||
| // Shouldn't be doing this at all if pagination is on (updates handled by TopLevelMenu pagination wrapper) | ||
| return; | ||
| } | ||
|
|
||
| // Potentially incredibly high throughput. Changes should be at least limited (slow if state change, quick if added/removed). Shouldn't get here if SSP | ||
| this.updateClusters(this.pinnedIds, neu?.length === old?.length ? 'slow' : 'quick'); | ||
| }, | ||
| deep: true, | ||
| immediate: true, | ||
| deep: true, | ||
| }, | ||
|
|
||
| mgmtClusters: { | ||
| handler(neu, old) { | ||
| if (this.canPagination) { | ||
| // Shouldn't be doing this at all if pagination is on (updates handled by TopLevelMenu pagination wrapper) | ||
| return; | ||
| } | ||
|
|
||
| // Potentially incredibly high throughput. Changes should be at least limited (slow if state change, quick if added/removed). Shouldn't get here if SSP | ||
| this.updateClusters(this.pinnedIds, neu?.length === old?.length ? 'slow' : 'quick'); | ||
| }, | ||
| deep: true, | ||
| immediate: true, | ||
| deep: true, | ||
| }, | ||
|
|
||
| hideLocalCluster() { | ||
|
|
@@ -454,16 +465,25 @@ export default { | |
| unPinnedMax: this.maxClustersToShow | ||
| }; | ||
|
|
||
| switch (speed) { | ||
| case 'slow': | ||
| this.debouncedHelperUpdateSlow(args); | ||
| break; | ||
| case 'medium': | ||
| this.debouncedHelperUpdateMedium(args); | ||
| break; | ||
| case 'quick': | ||
| this.debouncedHelperUpdateQuick(args); | ||
| break; | ||
| try { | ||
| switch (speed) { | ||
| case 'slow': | ||
| this.debouncedHelperUpdateSlow(args); | ||
| break; | ||
| case 'medium': | ||
| this.debouncedHelperUpdateMedium(args); | ||
| break; | ||
| case 'quick': | ||
| this.debouncedHelperUpdateQuick(args); | ||
| break; | ||
| } | ||
| } catch (err) { | ||
| if (this.canPagination) { | ||
| // Double bubble up errors here, errors are tracked further down | ||
| // Note that this won't pick up async errors, further tweaks are required for that | ||
| } else { | ||
| throw err; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
Oops, something went wrong.
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.
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.
this fixes a console.warning related to initial sort order being undefined in sortable table