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

util/log: more misc cleanups #57000

Merged
merged 3 commits into from
Nov 25, 2020
Merged

Conversation

knz
Copy link
Contributor

@knz knz commented Nov 22, 2020

Helps towards #51987
See individual commits for details.

@knz knz requested review from itsbilal and a team November 22, 2020 12:06
@knz knz requested a review from a team as a code owner November 22, 2020 12:06
@knz knz requested review from miretskiy and removed request for a team November 22, 2020 12:06
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 10 of 10 files at r1, 13 of 13 files at r2, 43 of 43 files at r3.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @knz, @miretskiy, and @tbg)


pkg/util/log/flags.go, line 92 at r2 (raw file):

		// for folk to close the terminal where they launched 'cockroach
		// start --background'.
		// We keep this true for now for backward-compatibility.

Probably worth turning this into a TODO(knz): Disable this when called with --background. Or like elsewhere, you could just have it be TODO(knz): Make this configurable.

knz added 3 commits November 25, 2020 20:07
Prior to this patch, whether to number log entries (a feature used for
audit log) was defined per channel.

Foreseeing a future where the same sink (e.g. a single file) is used
by multiple channels, we want to make sure that the same counter value
is not reused for multiple entries written to the same sink. So the
numbering is really a property of the sink, not the channel.

This patch effects the change.

Release note: None
The parameters "threshold" and "formatter" are actually defined for
all sinks. So they do not need to live "inside" the `logSink`.

This patch extracts them to the `sinkInfo` which further simplifies
the code.

Release note: None
Previously, all the crash reporting code was inside the 'log' package
directly. This forced 'log' to import the cluster setting machinery,
and the test files to import the entire code base to instantiate test
servers. As a result, re-building running unit tests was fairly long.

This patch alleviates the situation by moving the crash reporting
machinery into its own sub-package 'logcrash'.

Release note: None
Copy link
Contributor Author

@knz knz left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @itsbilal, @miretskiy, and @tbg)


pkg/util/log/flags.go, line 92 at r2 (raw file):

Previously, itsbilal (Bilal Akhtar) wrote…

Probably worth turning this into a TODO(knz): Disable this when called with --background. Or like elsewhere, you could just have it be TODO(knz): Make this configurable.

Good idea. Done.

@knz knz force-pushed the 20201112-log-cleanup2 branch from 74864da to 2c66148 Compare November 25, 2020 19:10
@knz
Copy link
Contributor Author

knz commented Nov 25, 2020

TFYR!

bors r=itsbilal

@craig
Copy link
Contributor

craig bot commented Nov 25, 2020

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Nov 25, 2020

Build succeeded:

@craig craig bot merged commit 52c79da into cockroachdb:master Nov 25, 2020
@knz knz deleted the 20201112-log-cleanup2 branch November 25, 2020 20:38
irfansharif added a commit to irfansharif/cockroach that referenced this pull request Nov 26, 2020
This reverts cockroachdb#57000, which introduced a race to crdb. Was able to
reproduce it using

  make stressrace PKG=./pkg/sql/pgwire TESTS=TestConnResultsBufferSize

The buggy commit in question appears to be ffd7f68.

Release note: None
craig bot pushed a commit that referenced this pull request Nov 26, 2020
57178: Revert "util/log: more misc cleanups" r=irfansharif a=irfansharif

This reverts #57000, which introduced a race to crdb. Was able to
reproduce it using

  make stressrace PKG=./pkg/sql/pgwire TESTS=TestConnResultsBufferSize

The buggy commit in question appears to be ffd7f68.
Touches #57162 and #57161.

Release note: None

Co-authored-by: irfan sharif <[email protected]>
knz added a commit to knz/cockroach that referenced this pull request Nov 30, 2020
This re-instates cockroachdb#57000, as it did not "introduce a race in crdb"

(Instead it merely outlined a bug in a test, which is to be fixed in a
subsequent commit.)

Release note: None
craig bot pushed a commit that referenced this pull request Nov 30, 2020
56395: sqlsmith: add schema-related operations r=jordanlewis a=jordanlewis

User-defined schemas are now supported in sqlsmith. UDSs will be
randomly generated, and new tables will be randomly included in the
available UDSs. Queries will select from any table, including those
inside of UDSs as well.

Closes #54961.

Release note: None

57222: Revert "Revert "util/log: more misc cleanups"" r=irfansharif a=knz

Reverts  #57178. 

This re-instates #57000, as it did not "introduce a race in crdb"
The description in #57178 was incorrect - instead #57161 / #57162 merely outlined a bug in some tests, which remains to be fixed.

This PR also includes a temporary workaround for said test bug.

Fixes #57162. 
Fixes #57161 (presumably - although the symptoms there don't align).



Co-authored-by: Jordan Lewis <[email protected]>
Co-authored-by: Raphael 'kena' Poss <[email protected]>
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