Skip to content

cluster-ui: add sql api request wrapper and clusterLocks request#85080

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
xinhaoz:cluster-locks
Aug 8, 2022
Merged

cluster-ui: add sql api request wrapper and clusterLocks request#85080
craig[bot] merged 1 commit intocockroachdb:masterfrom
xinhaoz:cluster-locks

Conversation

@xinhaoz
Copy link
Copy Markdown
Contributor

@xinhaoz xinhaoz commented Jul 26, 2022

This commit allows DB Console to use the SQL over HTTP API from
/api/v2/sql/. A new fetch wrapper providing the custom header
necessary for the API and using content type JSON has been added.

The clusterLocksApi components added in this commit use the above
SQL api functions to query from the crdb_internal.cluster_locks
table.

Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@xinhaoz
Copy link
Copy Markdown
Contributor Author

xinhaoz commented Jul 27, 2022

This is waiting on #84617 to merge.

Copy link
Copy Markdown

@ericharmeling ericharmeling 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 doing this work! I was able to use it as a basis for #84612. Doing the same for the details page too.

Reviewed 3 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @xinhaoz)

@xinhaoz xinhaoz marked this pull request as ready for review August 2, 2022 22:42
This commit allows DB Console to use the SQL over HTTP API from
`/api/v2/sql/`. A new fetch wrapper providing the custom header
necessary for the API and using content type JSON has been added.

The clusterLocksApi components added in this commit use the above
SQL api functions to query from the `crdb_internal.cluster_locks`
table.

Release note: None
@xinhaoz
Copy link
Copy Markdown
Contributor Author

xinhaoz commented Aug 8, 2022

TFTR!
bors r+

@craig craig bot merged commit d58473e into cockroachdb:master Aug 8, 2022
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 8, 2022

Build succeeded:

craig bot pushed a commit that referenced this pull request Aug 11, 2022
81995: colexec: derive a tracing span in materializer when collecting stats r=yuzefovich a=yuzefovich

If we don't do this, then the stats would be attached to the span of
the materializer's user, and if that user itself has a lot of
payloads to attach (e.g. a joinReader attaching the KV keys it looked
up), then the stats might be dropped based on the maximum size of
structured payload per tracing span of 10KiB (see
`tracing.maxStructuredBytesPerSpan`). Deriving a separate span
guarantees that the stats won't be dropped.

This required some changes to make a test - that makes too many
assumptions about tracing infra - work.

Release note: None

84358: sql/tests: TestRandomSyntaxSchemaChangeColumn use a resettable timeout r=fqazi a=fqazi

fixes #65736

Previously, TestRandomSyntaxSchemaChangeColumn had a fixed
timeout, which meant that if schema change got stuck behind
each other, this timeout may not have been sufficient. Previously,
we tried bumping up this timeout, but this is not the most reliable
for this test. To address this, this patch introduces the concept of
resettable timeouts, which states that the timeout expires only if
no other statements are complete within the given timeout (otherwise,
its recalculated since the completion of the last statement. To avoid
potential starvation there is a limit on the number of resets,
which guarantees eventual expiry if a query is always bypassed.

Release note: None

85081: ui/cluster-ui: add wait time insights to active executions r=xinhaoz a=xinhaoz

Closes: #79127
Closes: #79131

This commit introduces a new section, 'Wait Time Insights' to the
active stmts/txns details pages. The section is included if the txn
being viewed is experiencing contention and includes info on the
blocked schema, table, index name, time spent blocking, and the
executions blocking or waiting for the viewed execution.

The section is powered by querying the `crdb_internal.cluster_locks`
table via the SQL api in `/api/v2/`. The table informatioin is
refreshed at an interval of 10s while on active execution pages,
and is requested along with session information (to give info on
active txns/stmts).

Only users having VIEWACTIVITY or higher permissions can view this
feature.

Refactor note: to remove  duplication across shared selector logic
in the active txn components, `activeExecutionsCommon.selectors.ts`
has been created. This file exports  combiner functions for active
txn selectors. The combiner func step contains the bulk of the logic
to transform data from the redux state to component props, thus future
changes to this logic will not need to be duplicated across packages.

Release note (ui change): A new section, 'Wait Time Insights' has
been added to the active statement and transaction details page.
The section is included if the txn being viewed is experiencing
contention and includes info on the blocked schema, table, index
name, time spent blocking, and the txns blocking or waiting for the
viewed txn.  Only users having `VIEWACTIVITY` or higher can view
this feature. The column 'Time Spent Waiting' has been added to
the active executions tables that shows the total amount of time
an execution has been waiting for a lock.

--------------
### Note to reviewers: only the 2nd commit is relevant, see first commit here: #85080

https://www.loom.com/share/53d8a74f9c9041a9b967e32dc370a153

Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: Faizan Qazi <faizan@cockroachlabs.com>
Co-authored-by: Xin Hao Zhang <xzhang@cockroachlabs.com>
@xinhaoz xinhaoz deleted the cluster-locks branch August 11, 2022 14:39
craig bot pushed a commit that referenced this pull request Aug 12, 2022
84612: ui: add insights overview page v1 r=maryliag a=ericharmeling

This commit adds the v1 Insights page to the DB Console, via the cluster-ui package. The v1 Insights page only includes a Transactions Insights overview page, populated with information served a new "endpoint" built on top of the SQL-over-HTTP API.

Note this PR is dependent on the changes in #84617 and #85080.

After #84998 is merged with all the needed columns, we can rewrite the insights API to query the internal insights table.

Fixes #83774.

Release note (ui change): Added new Insights page to DB Console

85757: backupccl,importer: remove `at_current_time` cluster settings r=adityamaru a=erikgrinaker

Release note (ops change): The cluster settings
`bulkio.restore_at_current_time.enabled` and
`bulkio.import_at_current_time.enabled`, which were introduced in 22.1
and defaulted to `true`, have been retired. They are now in effect
always enabled.

Co-authored-by: Eric Harmeling <eric.harmeling@cockroachlabs.com>
Co-authored-by: Erik Grinaker <grinaker@cockroachlabs.com>
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