-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
server: report the SQL instance ID as log tag sqli
#72607
Conversation
cfbc3a5
to
75257ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
TFYR! bors r=rimadeodhar |
Build succeeded: |
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 <[email protected]>
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 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 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 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
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
sql
to
sqli
, which is easier to search for and recognize.Release note: None