Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
91698: ui: txn insights v2 r=xinhaoz a=xinhaoz

Closes #91696
Closes #88847

For the next version of txn insights, we want to show
the insights of the stmts involved in the txn. This
commit aggregates stmt insights to show at the txn
level on the txn insights overview page and the details
page.

Previously, the txn insights only showed contention
information, which we pull from a different source
(contention registry over insights system). To preserve
the information we were already showing, the aggregated
stmt insights were merged with the previous data.

Some considerations to be addressed in future PRs:
1. We don't currently track txn start and end time
in the insights system. Since there is no guarantee that
a txn in the contention registry has an entry in the insights
system, there is currently a gap in execution details for
txn contention insights being displayed.

2. For insights we only display the most recent txn execution
for a txn fingerprint that has an insight. Since the insights
system does not track txn end time, we can't know which
executed more recently when we have a txn from the contention
response and one from the insights response with the same
fingerprint, so for now we default to showing the contention
insight.

Release note (ui change): Txn insights pages now show insights
about slow execution with unknown causes, plan regressions,
index recommendations, and failed executions. The following
fields have also been added on the details page, but are not
available for txns where the insight is 'High Contention':
- User name
- Session ID
- rows processed
- rows read
- rows written
- retries
- last retry reason
- Full scan
- Transaction priority


<img width="1529" alt="image" src="https://user-images.githubusercontent.com/20136951/201197631-d617b418-57eb-4aff-aaf6-0bc426591f53.png">
<img width="1392" alt="image" src="https://user-images.githubusercontent.com/20136951/201197674-db90b47a-cf52-4cb8-a19d-3c22d0668e77.png">

Image below contains a fixed bug seen in loom where time spent waiting showed NaN
<img width="1525" alt="image" src="https://user-images.githubusercontent.com/20136951/201198013-e3f7cc78-f711-4759-88f6-e3f7f16da328.png">

https://www.loom.com/share/640d0e464d1c40978d44ea1df8ac4581


CC Console Insight pages:
https://www.loom.com/share/4b01cef66aec4c1aa5a7f44b9a962237

91837: deps: update to cockroach-go 2.2.18 r=rafiss a=rafiss

The testserver changes are needed to support mixed version logic tests.

informs #72451

Release note: None

91866: jobsprotectedccl: skip flaky test r=miretskiy a=knz

Informs #91865. 

Co-authored-by: Xin Hao Zhang <[email protected]>
Co-authored-by: Rafi Shamim <[email protected]>
Co-authored-by: Raphael 'kena' Poss <[email protected]>
  • Loading branch information
4 people committed Nov 14, 2022
4 parents bc06ae6 + a2c3d54 + 7c850c1 + b416b00 commit 15612ab
Show file tree
Hide file tree
Showing 48 changed files with 1,731 additions and 1,466 deletions.
6 changes: 3 additions & 3 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1342,10 +1342,10 @@ def go_deps():
name = "com_github_cockroachdb_cockroach_go_v2",
build_file_proto_mode = "disable_global",
importpath = "github.com/cockroachdb/cockroach-go/v2",
sha256 = "98f04abc613bb08b9366a0d7719b1ac36876dbc4371013cc8cb002ff6e3c991e",
strip_prefix = "github.com/cockroachdb/cockroach-go/[email protected].17",
sha256 = "714648a107b3d7e81cc69106fe95d4619592f63f9d6e556cedf83057084dfa32",
strip_prefix = "github.com/cockroachdb/cockroach-go/[email protected].18",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/cockroach-go/v2/com_github_cockroachdb_cockroach_go_v2-v2.2.17.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/cockroach-go/v2/com_github_cockroachdb_cockroach_go_v2-v2.2.18.zip",
],
)
go_repository(
Expand Down
2 changes: 1 addition & 1 deletion build/bazelutil/distdir_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ DISTDIR_FILES = {
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/apd/v3/com_github_cockroachdb_apd_v3-v3.1.2.zip": "dde4e1e0861ab1276363eb60a6f1ac6b9f70e1a5baea1e7c7d3bd2a0b9cffad5",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/circuitbreaker/com_github_cockroachdb_circuitbreaker-v2.2.2-0.20190114160014-a614b14ccf63+incompatible.zip": "52fdb5ba6a60e9a2f1db42d5b3c4c13cc5bb3947d5ce7f1bba9b0a14de71813a",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/cmux/com_github_cockroachdb_cmux-v0.0.0-20170110192607-30d10be49292.zip": "88f6f9cf33eb535658540b46f6222f029398e590a3ff9cc873d7d561ac6debf0",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/cockroach-go/v2/com_github_cockroachdb_cockroach_go_v2-v2.2.17.zip": "98f04abc613bb08b9366a0d7719b1ac36876dbc4371013cc8cb002ff6e3c991e",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/cockroach-go/v2/com_github_cockroachdb_cockroach_go_v2-v2.2.18.zip": "714648a107b3d7e81cc69106fe95d4619592f63f9d6e556cedf83057084dfa32",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/crlfmt/com_github_cockroachdb_crlfmt-v0.0.0-20210128092314-b3eff0b87c79.zip": "452219ca74191eedc6f44a5088b5d64e6f75168b438ac9eafe2256b0db8dbcad",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/datadriven/com_github_cockroachdb_datadriven-v1.0.1.zip": "0f8fe6199b1c7c44cbd4ce9ac0f3f9e1d2f02263f409361e49445fad4a410ab8",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/errors/com_github_cockroachdb_errors-v1.9.0.zip": "ff3814544271799c80da14dadfe408efc4f66e02cbdf17b73e81614ed9f7ae43",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ require (
github.com/cockroachdb/apd/v3 v3.1.2
github.com/cockroachdb/circuitbreaker v2.2.2-0.20190114160014-a614b14ccf63+incompatible
github.com/cockroachdb/cmux v0.0.0-20170110192607-30d10be49292
github.com/cockroachdb/cockroach-go/v2 v2.2.17
github.com/cockroachdb/cockroach-go/v2 v2.2.18
github.com/cockroachdb/crlfmt v0.0.0-20210128092314-b3eff0b87c79
github.com/cockroachdb/datadriven v1.0.1
github.com/cockroachdb/errors v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ github.com/cockroachdb/circuitbreaker v2.2.2-0.20190114160014-a614b14ccf63+incom
github.com/cockroachdb/circuitbreaker v2.2.2-0.20190114160014-a614b14ccf63+incompatible/go.mod h1:v3T8+rm/HmCL0D1BwDcGaHHAQDuFPW7EsnYs2nBRqUo=
github.com/cockroachdb/cmux v0.0.0-20170110192607-30d10be49292 h1:dzj1/xcivGjNPwwifh/dWTczkwcuqsXXFHY1X/TZMtw=
github.com/cockroachdb/cmux v0.0.0-20170110192607-30d10be49292/go.mod h1:qRiX68mZX1lGBkTWyp3CLcenw9I94W2dLeRvMzcn9N4=
github.com/cockroachdb/cockroach-go/v2 v2.2.17 h1:Yjmt2MpXXjw5yYY+SWbrbVJ7wpZzhMQfO0XbDUeELb0=
github.com/cockroachdb/cockroach-go/v2 v2.2.17/go.mod h1:mzlIDDBALQfEjv/7DU12fb2AfQ/MUYTlychcMpWp9QI=
github.com/cockroachdb/cockroach-go/v2 v2.2.18 h1:bRNZWqzRSZesVYFjDAl1jgFb1jhIFIEreWIC2kPbcdY=
github.com/cockroachdb/cockroach-go/v2 v2.2.18/go.mod h1:mzlIDDBALQfEjv/7DU12fb2AfQ/MUYTlychcMpWp9QI=
github.com/cockroachdb/crlfmt v0.0.0-20210128092314-b3eff0b87c79 h1:4s0GWs4NXFK4JEeUc0Q1pRbL4oMbqh1DK70qeQ+viOA=
github.com/cockroachdb/crlfmt v0.0.0-20210128092314-b3eff0b87c79/go.mod h1:EOI6rrXIdP+4EXwM8837kmmb6IJesf7k7W6bUu8BDOg=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
Expand Down
1 change: 1 addition & 0 deletions pkg/ccl/jobsccl/jobsprotectedtsccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ go_test(
"//pkg/sql/catalog/descpb",
"//pkg/testutils",
"//pkg/testutils/serverutils",
"//pkg/testutils/skip",
"//pkg/testutils/sqlutils",
"//pkg/testutils/testcluster",
"//pkg/util/hlc",
Expand Down
3 changes: 3 additions & 0 deletions pkg/ccl/jobsccl/jobsprotectedtsccl/jobs_protected_ts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
Expand Down Expand Up @@ -132,6 +133,8 @@ WHERE
func TestJobsProtectedTimestamp(t *testing.T) {
defer leaktest.AfterTest(t)()

skip.WithIssue(t, 91865) // flaky test

ctx := context.Background()
tc := testcluster.StartTestCluster(t, 1, base.TestClusterArgs{
ServerArgs: base.TestServerArgs{
Expand Down
Loading

0 comments on commit 15612ab

Please sign in to comment.