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

sql: Allow users to grab a diagnostics bundle without accessing the UI #48597

Closed
piyush-singh opened this issue May 8, 2020 · 1 comment · Fixed by #50924
Closed

sql: Allow users to grab a diagnostics bundle without accessing the UI #48597

piyush-singh opened this issue May 8, 2020 · 1 comment · Fixed by #50924
Assignees
Labels
A-sql-optimizer SQL logical planning and optimizations. A-sql-ui Why is my query slow? C-investigation Further steps needed to qualify. C-label will change.

Comments

@piyush-singh
Copy link

While demoing the EXPLAIN ANALYZE (DEBUG) feature to the SE team today, they noted that the feature requires users to click a link to the UI to download the diagnostics bundle. Some of our customers do not have access to the Admin UI for their clusters, so the team was asking about a method to grab the data from the system tables directly without requiring users to go out to the UI.

@RaduBerinde mentioned there might be a way to grab the binary info from the system table and process it into the diagnostics zip file in the CLI. cc @awoods187

@blathers-crl

This comment has been minimized.

@blathers-crl blathers-crl bot added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label May 8, 2020
@piyush-singh piyush-singh added A-sql-optimizer SQL logical planning and optimizations. C-investigation Further steps needed to qualify. C-label will change. and removed C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. labels May 8, 2020
@awoods187 awoods187 added the A-sql-ui Why is my query slow? label May 27, 2020
@RaduBerinde RaduBerinde self-assigned this Jun 17, 2020
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this issue Jul 3, 2020
This change adds a `statement-diag` command, with the following subcommands:
```
  list        list available bundles and outstanding activation requests
  download    download statement diagnostics bundle into a zip file
  delete      delete a statement diagnostics bundle
  cancel      cancel an outstanding activation request
```

Fixes cockroachdb#48597.

Release note (cli change): A new set of `statement-diag` CLI commands that can
be used to manage statement diagnostics.
craig bot pushed a commit that referenced this issue Jul 9, 2020
50924: cli: add commands for managing statement diagnostics r=RaduBerinde a=RaduBerinde

This change adds a `statement-diag` command, with the following subcommands:
```
  list        list available bundles and outstanding activation requests
  download    download statement diagnostics bundle into a zip file
  delete      delete a statement diagnostics bundle
  cancel      cancel an outstanding activation request
```

Fixes #48597.

Release note (cli change): A new set of `statement-diag` CLI commands that can
be used to manage statement diagnostics.

51065: importccl: fix target column ordering bug for PGDUMP import r=mjibson a=Anzoteh96

The current implementation assumes that the target columns of a PGDUMP query is the same as how they are created in the case where target columns are declared in PGDUMP file. This PR addresses it by detecting the target columns in the PGDUMP statement itself if this is the case. In addition, given that the target columns may not be well-determined at the formation of a new `DatumRowConverter`, so the check of unsupported default column expression is also moved to the `DatumRowConverter.Row()` function. 

Fixed #51159 

Release note: None

51121: sql: move parallelize scans control in the execbuilder r=RaduBerinde a=RaduBerinde

Parallel scans refers to disabling scan batch limits, which allows the
distsender to issue requests to multiple ranges in parallel. This is
only safe to use when there is a known upper bound for the number of
results.

Currently we plumb maxResults to the scanNode and TableReader, and
each execution component runs similar logic to decide whether to
parallelize.

This change cleans this up by centralizing this decision inside the
execbuilder. In the future, we may want the coster to be aware of this
parallelization as well.

For simplicity, we drop the cluster setting that controls this (it was
added for fear of problems but it has been on by default for a long
time).

Release note: None

51163: jobs: do not include cancel jobs as running for scheduled jobs r=pbardea a=pbardea

Previously, the query that the job scheduling system would use to detect
if there were any already running jobs would include canceled jobs due
to using a the alternative spelling: 'cancelled'.

This commit changes the query to use the enums instead of manually
listing their state. It also adds a test to ensure that jobs are still
run, regardless of the wait policy when all previous runs are in a
terminal state.

Release note: None

51194: pgwire: de-strictify extended protocol handling r=jordanlewis a=jordanlewis

Fixes #33693.
Fixes #41511.

Previously, the protocol handler didn't permit simple queries during the
extended protocol mode. I think this was done because the spec vaguely
says that extended protocol commands must be ended with a SYNC command:
https://www.postgresql.org/docs/9.3/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY

However, an examination of the PostgreSQL source code shows that the
extended protocol mode bit is only used for error recovery. If an error
is encountered during extended protocol mode in Postgres, all commands
are skipped until the next Sync.

CockroachDB never implemented that behavior - instead, it used the
extended protocol mode bit only to reject simple queries if they came
before the Sync.

This commit removes the extended protocol mode bit, as the use case we
used it for was incorrect. It's unclear to me whether we need to re-add
the bit for dealing with error cases, but we haven't needed it yet.
Adding that might be follow-on work, and won't come in this PR.

Release note (bug fix): prevent spurious "SimpleQuery not allowed while
in extended protocol mode" errors.

51218: Fix typo in txn.commits metric help text r=nvanbenschoten a=a-robinson

Sorry for the mostly useless change, but it bothered me :)

51226: opt: fix error in case of casted NULL arguments to AddGeometryColumn r=rytaft a=rytaft

This commit fixes an error that occurred when `AddGeometryColumn` was
called with `NULL` arguments that were cast to the type specified by the
function signature. #50992 already fixed the case when `AddGeometryColumn`
was called with bare `NULL` arguments, since those were detected by `TypeCheck`.
`TypeCheck` does not detect `NULL` arguments if they are cast to the correct
type.

This commit fixes the error by adding an explicit check in the `optbuilder`
that each argument is not null before calling the `SQLFn` of the
`AddGeometryColumn` overload.

Informs #50296

Release note (bug fix): Fixed an internal error that occurred when
AddGeometryColumn was called with NULL arguments. This now results in
a no-op and returns NULL.

Co-authored-by: Radu Berinde <[email protected]>
Co-authored-by: anzoteh96 <[email protected]>
Co-authored-by: Paul Bardea <[email protected]>
Co-authored-by: Jordan Lewis <[email protected]>
Co-authored-by: Alex Robinson <[email protected]>
Co-authored-by: Rebecca Taft <[email protected]>
@craig craig bot closed this as completed in 49e6d39 Jul 9, 2020
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this issue Jul 9, 2020
This change adds a `statement-diag` command, with the following subcommands:
```
  list        list available bundles and outstanding activation requests
  download    download statement diagnostics bundle into a zip file
  delete      delete statement diagnostics bundles
  cancel      cancel outstanding activation requests
```

Fixes cockroachdb#48597.

Release note (cli change): A new set of `statement-diag` CLI commands that can
be used to manage statement diagnostics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-optimizer SQL logical planning and optimizations. A-sql-ui Why is my query slow? C-investigation Further steps needed to qualify. C-label will change.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants