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

ui: show data when max size reached #97153

Merged
merged 1 commit into from
Feb 16, 2023
Merged

Conversation

maryliag
Copy link
Contributor

@maryliag maryliag commented Feb 15, 2023

Previously, when the sql api returned a max size reached error, we were just showing the error, but not the data that was also being returned.

This PR creates a new function to format the return of the api calls, so when is a max size error it doesn't throw an error, but still pass that info so we can display a warning on the pages.

This commit updates the Insights Workload > Statement page
with the new behaviour.
Following PRs will update other usages of the sql api.

Screenshot 2023-02-16 at 11 06 23 AM

https://www.loom.com/share/9d9a24c486ce466ab355e1040af095c9

Part Of: #96184
Release note (ui change): Still show data on the console
(with a warning) for Statement Insights when we reach a
"max size exceed" error from the sql api.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@maryliag maryliag force-pushed the max-size branch 3 times, most recently from 56a7c7a to 496aacb Compare February 15, 2023 23:34
@maryliag maryliag marked this pull request as ready for review February 15, 2023 23:37
@maryliag maryliag requested review from a team, kevin-v-ngo and dongniwang February 15, 2023 23:37
@maryliag maryliag removed the request for review from a team February 15, 2023 23:39
Copy link
Contributor

@j82w j82w left a comment

Choose a reason for hiding this comment

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

Reviewed 13 of 13 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dongniwang, @kevin-v-ngo, and @maryliag)


pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts line 156 at r1 (raw file):

  if (sqlResultsAreEmpty(result)) {
    return formatApiResult([], result.error, "retrieving insights information");

Should the query be modified to order by the cpu usage or some other value so the most impactful insights are always loaded?

Copy link
Contributor Author

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dongniwang, @j82w, and @kevin-v-ngo)


pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts line 156 at r1 (raw file):

Previously, j82w (Jake) wrote…

Should the query be modified to order by the cpu usage or some other value so the most impactful insights are always loaded?

Created a follow-up task to update insights all around: #97243

Previously, when the sql api returned a max size reached
error, we were just showing the error, but not the data
that was also being returned.

This PR creates a new function to format the return of
the api calls, so when is a max size error it doesn't
throw an error, but still pass that info so we can display
a warning on the pages.

This commit updates the Insights Workload > Statement page
with the new behaviour.
Following PRs will update other usages of the sql api.

Part Of: cockroachdb#96184
Release note (ui change): Still show data on the console
(with a warning) for Statement Insights when we reach a
"max size exceed" error from the sql api.
Copy link
Member

@xinhaoz xinhaoz left a comment

Choose a reason for hiding this comment

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

🔥 🔥

@@ -60,6 +60,11 @@ export type SqlExecutionErrorMessage = {
source: { file: string; line: number; function: "string" };
};

export type ApiResponse<ResultType> = {
Copy link
Member

Choose a reason for hiding this comment

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

nit: just a super small preference thing, feel free to leave; I prefer SqlApiResponse here, it's a bit more indicative of what we're using to get the results.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanna get this in, so I will update on my next PR (taking advantage of all tests that passed already :D )

@maryliag
Copy link
Contributor Author

TFTR!
bors r+

@craig
Copy link
Contributor

craig bot commented Feb 16, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Feb 16, 2023

Build succeeded:

@craig craig bot merged commit 377fe75 into cockroachdb:master Feb 16, 2023
@blathers-crl
Copy link

blathers-crl bot commented Feb 16, 2023

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from a6fd886 to blathers/backport-release-22.2-97153: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 22.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants