Skip to content

tracing: tenant redaction test uses tracing knobs#73821

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
dhartunian:use-with-statement-trace
Dec 16, 2021
Merged

tracing: tenant redaction test uses tracing knobs#73821
craig[bot] merged 1 commit intocockroachdb:masterfrom
dhartunian:use-with-statement-trace

Conversation

@dhartunian
Copy link
Copy Markdown
Collaborator

@dhartunian dhartunian commented Dec 14, 2021

Previously, the tenant redaction test manually read back the results of
traces in SQL. Since we have a testing knob for this purpose it makes
sense to use it here and collect the traces in a more straightforward
way.

This test now also uses the trace.redactability.enabled cluster
setting instead of setting the redactability flag on the tracer to test
that the cluster setting is correctly connected.

Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:LGTM:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @andreimatei and @dhartunian)


pkg/ccl/kvccl/kvtenantccl/tenant_trace_test.go, line 66 at r1 (raw file):

				SQLExecutor: &sql.ExecutorTestingKnobs{
					WithStatementTrace: func(trace tracing.Recording, stmt string) {
						if stmt == "CREATE TABLE kv(k STRING PRIMARY KEY, v STRING)" {

please factor out the stmt into a constant


pkg/ccl/kvccl/kvtenantccl/tenant_trace_test.go, line 74 at r1 (raw file):

		},
	}
	tc := serverutils.StartNewTestCluster(t, 1, args)

since you're here - how come this is a TestCluster with one node and node more simply a TestServer?

@dhartunian dhartunian force-pushed the use-with-statement-trace branch 2 times, most recently from c7a7d25 to 1ddfb2f Compare December 16, 2021 14:29
Copy link
Copy Markdown
Collaborator Author

@dhartunian dhartunian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also discovered bug last night that was created in the backport that prevents the cluster setting update from getting picked up correctly. I changed this test to use the cluster setting instead of setting flag on tracer directly, and then will backport to this test change to release-21.2 which will motivate the fix.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @andreimatei)


pkg/ccl/kvccl/kvtenantccl/tenant_trace_test.go, line 66 at r1 (raw file):

Previously, andreimatei (Andrei Matei) wrote…

please factor out the stmt into a constant

Done.


pkg/ccl/kvccl/kvtenantccl/tenant_trace_test.go, line 74 at r1 (raw file):

Previously, andreimatei (Andrei Matei) wrote…

since you're here - how come this is a TestCluster with one node and node more simply a TestServer?

Done.

Previously, the tenant redaction test manually read back the results of
traces in SQL. Since we have a testing knob for this purpose it makes
sense to use it here and collect the traces in a more straightforward
way.

This test now also uses the `trace.redactability.enabled` cluster
setting instead of setting the redactability flag on the tracer to test
that the cluster setting is correctly connected.

Release note: None
@dhartunian dhartunian force-pushed the use-with-statement-trace branch from 1ddfb2f to 815b9ee Compare December 16, 2021 15:28
@dhartunian
Copy link
Copy Markdown
Collaborator Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 16, 2021

Build succeeded:

@craig craig bot merged commit db6851b into cockroachdb:master Dec 16, 2021
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 16, 2021

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 815b9ee to blathers/backport-release-21.2-73821: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 21.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

dhartunian added a commit to dhartunian/cockroach that referenced this pull request Dec 16, 2021
This commit identifies and resolves a bug on this branch that misplaced
the code that updated the `trace-redactability.enabled` cluster setting.
The test change described below fails without this change.

Includes backport from cockroachdb#73821:

Previously, the tenant redaction test manually read back the results of
traces in SQL. Since we have a testing knob for this purpose it makes
sense to use it here and collect the traces in a more straightforward
way.

This test now also uses the `trace.redactability.enabled` cluster
setting instead of setting the redactability flag on the tracer to test
that the cluster setting is correctly connected.

Resolves cockroachdb#73938

Release note: None
@dhartunian dhartunian deleted the use-with-statement-trace branch November 14, 2022 16:37
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.

3 participants