Skip to content

Commit

Permalink
cluster-ui: handle partial response errors on the databases page
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Thomas Hardy committed Aug 23, 2023
1 parent b8d7945 commit a3535b9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import {
} from "../queryFilter";
import { merge } from "lodash";
import { UIConfigState } from "src/store";
import { TableStatistics } from "../tableStatistics";
import {
DatabaseNameCell,
IndexRecCell,
Expand All @@ -60,6 +59,7 @@ import {
import { InlineAlert } from "@cockroachlabs/ui-components";
import {checkInfoAvailable} from "../databases";


const cx = classNames.bind(styles);
const sortableTableCx = classNames.bind(sortableTableStyles);
const booleanSettingCx = classnames.bind(booleanSettingStyles);
Expand Down

0 comments on commit a3535b9

Please sign in to comment.