Skip to content

server, ui: show internal stats with custer setting enabled#114743

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
maryliag:return-internal
Nov 21, 2023
Merged

server, ui: show internal stats with custer setting enabled#114743
craig[bot] merged 1 commit intocockroachdb:masterfrom
maryliag:return-internal

Conversation

@maryliag
Copy link
Copy Markdown
Contributor

Previously, when the cluster setting sql.stats.response.show_internal.enabled was set to true, we were still trying to use the activity tables to return data to the UI, but that tables doesn't have data from internal stats.

This commit does that proper check to not use the Activity tables if that value is enabled.

Also, since enabling that setting means the user wants to see the internal stats, this commit also changes the UI so that it returns the internal stats, oterhwise it might be confusing selecting top 100 but the UI only showing 40 for example.

Fixes #114460

https://www.loom.com/share/8f3279ae4fd441999c24c68fb0fa8b14

Release note (bug fix): SQL Activity properly showing internal statements when cluster setting sql.stats.response.show_internal.enabled is set to true.

@maryliag maryliag requested review from a team and dhartunian and removed request for a team November 20, 2023 18:57
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@maryliag maryliag added backport-23.1.x PAST MAINTENANCE SUPPORT: 23.1 patch releases via ER request only backport-23.2.x PAST MAINTENANCE SUPPORT: 23.2 patch releases via ER request only labels Nov 20, 2023
Copy link
Copy Markdown
Contributor

@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.

Thanks for fixing 🔥 Can we add a unit test to verify the proper table is used when we have a valid activity table for the time range but show internal queries is on? Just in case this is accidentally removed or something.

);
return (
(!appNames?.length && !isInternal) ||
!appNames?.length ||
Copy link
Copy Markdown
Contributor

@xinhaoz xinhaoz Nov 20, 2023

Choose a reason for hiding this comment

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

Why was the && !isInternal removed? I thought we wanted to align with the txns page where we only show internal stmts when they are specifically selected in the app name filter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah nvm, just read that we're swapping the behaviour here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's also updated on the Txn page with the new behaviour

Copy link
Copy Markdown
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.

Test added

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dhartunian and @xinhaoz)

Previously, when the cluster setting `sql.stats.response.show_internal.enabled`
was set to true, we were still trying to use the activity tables
to return data to the UI, but that tables doesn't have data
from internal stats.

This commit does that proper check to not use the Activity
tables if that value is enabled.

Also, since enabling that setting means the user wants to see the
internal stats, this commit also changes the UI so that it returns
the internal stats, oterhwise it might be confusing selecting top 100
but the UI only showing 40 for example.

Fixes cockroachdb#114460

Release note (bug fix): SQL Activity properly showing internal
statements when cluster setting `sql.stats.response.show_internal.enabled`
is set to true.
Copy link
Copy Markdown
Contributor

@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.

LGTM!!!

@maryliag
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 21, 2023

Build succeeded:

@craig craig bot merged commit 7637b09 into cockroachdb:master Nov 21, 2023
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Nov 21, 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 8ce19b4 to blathers/backport-release-23.1-114743: 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 23.1.x failed. See errors above.


error creating merge commit from 8ce19b4 to blathers/backport-release-23.2-114743: 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 23.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

backport-23.1.x PAST MAINTENANCE SUPPORT: 23.1 patch releases via ER request only backport-23.2.x PAST MAINTENANCE SUPPORT: 23.2 patch releases via ER request only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui, server: don't use activity tables if sql.stats.response.show_internal.enabled is true

3 participants