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

release-23.1: cluster-ui: handle partial response errors on the databases page #110342

Merged
merged 1 commit into from Sep 11, 2023

Conversation

THardy98
Copy link
Contributor

@THardy98 THardy98 commented Sep 11, 2023

Backport 1/1 commits from #109245.

/cc @cockroachdb/release


Part of: #102386

Demos (Note: these demos show this same logic applied to both the database details and database table pages as well):
DB-Console

Prior to this change, any query error in the reponse payload for the
databases page would cause the page to render an error. This was
problematic as some queries used to power the databases page directly
query system tables, meaning only ADMIN users could access the page.
This change allows the databases page to handle network responses with
query errors, consequently allowing non-admin users to view the data
they are privy to.

On the databases page, two types of requests are made:

  • a single request to fetch all database names
  • a request to fetch the database details for each database name

The error handling for these requests has changed as such:

  • if we encounter a network or a non size-related query error when
    requesting database names, render a page error
  • if we encounter a 'max size' query error when requesting database
    names, render an alert that we're showing partial results
  • if we encounter any error requesting a database's details, render a
    Caution icon next to the database's name to indicate there was an
    issue getting results, the Caution icon has a tooltip providing a
    general explanation as to what the issue is
  • network errors when fetching database details provide no data for the
    database's table row, consequently the row of statistics for that
    database is unavailable, the network error message is provided in the
    Caution icon tooltip
  • query errors when fetching database details are scoped to the row
    cells for that query, which are unavailable
  • unavailable cells have a tooltip that highlight the error for that
    cell as well

Note: the change in planner.go allows users to see span statistics for any table, not just tables a user has SELECT privileges for. This is particularly useful for the databases page where users need to see the span statistics for a database, but only have SELECT privileges on a subset of tables. Regardless, span statistics are gated by VIEWACTIVITY, not SELECT privileges.

Release note (ui change): Allow non-admin users to view the databases
page.

Release justification: UI improvement (regression fix)

Part of: cockroachdb#102386

Prior to this change, any query error in the reponse payload for the
databases page would cause the page to render an error. This was
problematic as some queries used to power the databases page directly
query `system` tables, meaning only `ADMIN` users could access the page.
This change allows the databases page to handle network responses with
query errors, consequently allowing non-admin users to view the data
they are privy to.

On the databases page, two types of requests are made:
- a single request to fetch all database names
- a request to fetch the database details for each database name

The error handling for these requests has changed as such:
- if we encounter a network or a non size-related query error when
  requesting database names, render a page error

- if we encounter a 'max size' query error when requesting database
  names, render an alert that we're showing partial results

- if we encounter any error requesting a database's details, render a
  `Caution` icon next to the database's name to indicate there was an
issue getting results, the `Caution` icon has a tooltip providing a
general explanation as to what the issue is

- network errors when fetching database details provide no data for the
  database's table row, consequently the row of statistics for that
database is `unavailable`, the network error message is provided in the
`Caution` icon tooltip

- query errors when fetching database details are scoped to the row
  cells for that query, which are `unavailable`

- `unavailable` cells have a tooltip that highlight the error for that
  cell as well

Release note (ui change): Allow non-admin users to view the databases
page.
@THardy98 THardy98 requested a review from a team September 11, 2023 15:27
@THardy98 THardy98 requested a review from a team as a code owner September 11, 2023 15:27
@blathers-crl
Copy link

blathers-crl bot commented Sep 11, 2023

Thanks for opening a backport.

Please check the backport criteria before merging:

  • Patches should only be created for serious issues or test-only changes.
  • Patches should not break backwards-compatibility.
  • Patches should change as little code as possible.
  • Patches should not change on-disk formats or node communication protocols.
  • Patches should not add new functionality.
  • Patches must not add, edit, or otherwise modify cluster versions; or add version gates.
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
  • There is a high priority need for the functionality that cannot wait until the next release and is difficult to address in another way.
  • The new functionality is additive-only and only runs for clusters which have specifically “opted in” to it (e.g. by a cluster setting).
  • New code is protected by a conditional check that is trivial to verify and ensures that it only runs for opt-in clusters.
  • The PM and TL on the team that owns the changed code have signed off that the change obeys the above rules.

Add a brief release justification to the body of your PR to justify this backport.

Some other things to consider:

  • What did we do to ensure that a user that doesn’t know & care about this backport, has no idea that it happened?
  • Will this work in a cluster of mixed patch versions? Did we test that?
  • If a user upgrades a patch version, uses this feature, and then downgrades, what happens?

@blathers-crl blathers-crl bot added the backport Label PR's that are backports to older release branches label Sep 11, 2023
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

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

:lgtm:

Reviewed 4 of 12 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@THardy98 THardy98 merged commit 0381f1f into cockroachdb:release-23.1 Sep 11, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Label PR's that are backports to older release branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants