Skip to content
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

Refactor WatchResourcesClient response handler #5572

Merged
merged 15 commits into from
Sep 12, 2024

Conversation

ericpgreen2
Copy link
Contributor

@ericpgreen2 ericpgreen2 commented Aug 30, 2024

This PR cleans-up the WatchResources response handler, including:

  • Proceeds with resource-related query invalidations only when a resource's stateVersion changes
  • Tracks which connectors we've seen so that we can invalidate the connector list when connectors are implicitly created by the backend
  • Invalidates the connector list after a DELETE event
  • Invalidates an OLAP connector's tables list after a hard DELETE rather than a soft delete
  • Removes manual query cancellation, given the queries will naturally be cancelled when their components unmount
  • Removes the client-side concept of "Main" and "Used" resource kinds

Closes #5480, https://github.com/rilldata/rill-private-issues/issues/591, https://github.com/rilldata/rill-private-issues/issues/628

Relevant Slack convo

@ericpgreen2 ericpgreen2 self-assigned this Aug 30, 2024
@ericpgreen2 ericpgreen2 marked this pull request as ready for review September 2, 2024 15:58
@nishantmonu51 nishantmonu51 added the blocker A release blocker issue that should be resolved before a new release label Sep 3, 2024
Copy link
Collaborator

@AdityaHegde AdityaHegde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are refetching profiling queries for sources and models once when the reconcile starts and once when it ends. I didnt check a lot of edge cases, with the simplification I feel we will miss quite a few of those.

@ericpgreen2 ericpgreen2 merged commit 0595f0e into main Sep 12, 2024
7 checks passed
@ericpgreen2 ericpgreen2 deleted the refactor-watch-resources-client-response-handler branch September 12, 2024 15:15
ericpgreen2 added a commit that referenced this pull request Sep 12, 2024
* Refactor `WatchResourcesClient` response handler

* Match instance query key w/ invalidated query key

* Refetch rather than invalidate

* Clarify log during e2e test

* Remove redundant `fileArtifact.softDeleteResource()`

* Remove console log

* Remove old code

* Use `meta.stateVersion` to avoid excessive invalidations

* Readability

* Whoops – add back `stateVersion` check

* Only invalidate `OLAPListTables` when the `resultTable` has changed

* Remove duplicate state that we can get from the `previousResource`

* Account for Sources too

* Nit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker A release blocker issue that should be resolved before a new release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rill Developer: first Source does not invalidate the Connectors Explorer
3 participants