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

exec_log: --vmodule=exec_log=2 does not log SQL query strings #64685

Closed
rafiss opened this issue May 4, 2021 · 3 comments · Fixed by #64894
Closed

exec_log: --vmodule=exec_log=2 does not log SQL query strings #64685

rafiss opened this issue May 4, 2021 · 3 comments · Fixed by #64894
Labels
A-logging In and around the logging infrastructure. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@rafiss
Copy link
Collaborator

rafiss commented May 4, 2021

Describe the problem

I started a single node with --vmodule=exec_log=2 as described in the docs on logging. The resulting logs do not show the query string. In 20.2 and earlier, I used to be able to see the query string, which is useful for debugging.

To Reproduce

  1. Start a fresh single-node cluster with ./cockroach start-single-node --insecure --cache=25% --max-sql-memory=25% --store=store --advertise-addr=localhost --http-addr :8081 --logtostderr --vmodule=exec_log=2 2> stderr.log
  2. Open a SQL shell and run SELECT 1;
  3. Open stderr.log and search for sql/exec_log.go

The lines are in the format:

I210504 19:15:02.597933 738 sql/exec_log.go:281 ⋮ [n1,client=‹[::1]:60437›,hostnossl,user=root] 73  ‹{ExecMode:exec NumRows:1 SQLSTATE: ErrorText: Age:0.682 NumRetries:0 FullTableScan:false FullIndexScan:false TxnCounter:5}›

Expected behavior
The SQL query strings should be logged.

If I set sql.log.unstructured_entries.enabled = true then the old exec log format is used and I see the query strings.

Environment:

  • CockroachDB v21.1.0-beta.3

Context:

filed this issue upon @knz request

@rafiss rafiss added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-logging In and around the logging infrastructure. labels May 4, 2021
@knz
Copy link
Contributor

knz commented May 4, 2021

is this a ga blocker?

@rafiss
Copy link
Collaborator Author

rafiss commented May 4, 2021

i'm asking other stakeholders about that, but i am defaulting to "no" because there is a workaround by setting sql.log.unstructured_entries.enabled = true. but it still should be backported to release-21.1 later

@knz
Copy link
Contributor

knz commented May 4, 2021

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-logging In and around the logging infrastructure. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants