server: report the SQL instance ID as log tag sqli#72607
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Nov 11, 2021
Merged
server: report the SQL instance ID as log tag sqli#72607craig[bot] merged 1 commit intocockroachdb:masterfrom
sqli#72607craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Member
cfbc3a5 to
75257ac
Compare
rimadeodhar
approved these changes
Nov 10, 2021
Collaborator
rimadeodhar
left a comment
There was a problem hiding this comment.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @knz and @RaduBerinde)
pkg/base/node_id.go, line 242 at r1 (raw file):
func (s *SQLIDContainer) SafeValue() {} func (s *SQLIDContainer) String() string {
Loved the comments here, made it much easier to understand.
Prior to this patch, the SQL instance ID was not reported in log messages, which made it hard to distinguish log messages coming from different in-memory SQL instance servers (e.g. in tests). This patch fixes it. The patch also changes the log tag for SQL instances from just `sql` to `sqli`, which is easier to search for and recognize. Release note: None
75257ac to
bb8af18
Compare
Contributor
Author
|
TFYR! bors r=rimadeodhar |
Contributor
|
Build succeeded: |
craig bot
pushed a commit
that referenced
this pull request
Nov 11, 2021
72608: base: ensure that a SQL instance ID is not set to conflicting value r=rimadeodhar a=knz Informs #58938. First commit from #72607. Prior to this patch, a SQL instance ID container could be assigned successively different values. This would make it possible for erroneous code to mistakenly initialize the instance ID twice, without any evidence that something was amiss. This patch fixes this by using the same prevention logic that we already use for node IDs. Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net>
knz
added a commit
to knz/cockroach
that referenced
this pull request
Nov 25, 2021
This commit ensures that the same data structure can store both SQL instance IDs and Node IDs. The decision is made upon instantiation of the container which of the two types of IDs the container stores. This simplifies the code and paves the road to using a single container in servers for the purpose of identifying the server instance in traces and logs. This also revisits the change in cockroachdb#72607 by switching the tracing/logging prefix `sqli` to `nsql` for SQL instance servers. Release note: None
knz
added a commit
to knz/cockroach
that referenced
this pull request
Nov 29, 2021
This commit ensures that the same data structure can store both SQL instance IDs and Node IDs. The decision is made upon instantiation of the container which of the two types of IDs the container stores. This simplifies the code and paves the road to using a single container in servers for the purpose of identifying the server instance in traces and logs. This also revisits the change in cockroachdb#72607 by switching the tracing/logging prefix `sqli` to `nsql` for SQL instance servers. Release note: None
knz
added a commit
to knz/cockroach
that referenced
this pull request
Dec 8, 2021
This commit ensures that the same data structure can store both SQL instance IDs and Node IDs. The decision is made upon instantiation of the container which of the two types of IDs the container stores. This simplifies the code and paves the road to using a single container in servers for the purpose of identifying the server instance in traces and logs. This also revisits the change in cockroachdb#72607 by switching the tracing/logging prefix `sqli` to `nsql` for SQL instance servers. Release note: None
knz
added a commit
to knz/cockroach
that referenced
this pull request
Dec 8, 2021
This commit ensures that the same data structure can store both SQL instance IDs and Node IDs. The decision is made upon instantiation of the container which of the two types of IDs the container stores. This simplifies the code and paves the road to using a single container in servers for the purpose of identifying the server instance in traces and logs. This also revisits the change in cockroachdb#72607 by switching the tracing/logging prefix `sqli` to `nsql` for SQL instance servers. Release note: None
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Informs #58938.
Prior to this patch, the SQL instance ID was not reported in log
messages, which made it hard to distinguish log messages coming from
different in-memory SQL instance servers (e.g. in tests).
This patch fixes it.
The patch also changes the log tag for SQL instances from just
sqlto
sqli, which is easier to search for and recognize.Release note: None