Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Improve logging of problems during db connection #1489

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kamil-holubicki
Copy link

Problem:
Some error logs indicate only the error returned by the server without the information about the server identity itself.
On the other hand there are also logs which display the server identity together with the returned error.

Cause:
There is an utility layer implemented by golib/sqlutils which intercepts database queries. Some queries done by orchestrator go through this layer and some don't.
sqlutils layer in case of query error prints out the query to the stdout

Solution:
golib/sqlutils layer is not aware of the server identity it operates on. It proxies creation of sql.DB object and then uses this object for queries execution.

Logger interface has been introduced. golib/sqlutils client can register its own logger which will be used instead of internal logging when the error occurs during usage of the related sql.DB object.

I am taking time off from maintaining this repo. I will not be reviewing pull requests.

Details in https://code.openark.org/blog/mysql/reducing-my-oss-involvement-and-how-it-affects-orchestrator-gh-ost

Related issue: https://github.com/openark/orchestrator/issues/0123456789

Description

This PR [briefly explain what is does]

Some error logs indicate only the error returned by the server without
the information about the server identity itself.
On the other hand there are also logs which display the server identity
together with the returned error.

Cause:
There is an utility layer implemented by golib/sqlutils which intercepts
database queries. Some queries done by orchestrator go through this
layer and some don't.
sqlutils layer in case of query error prints out the query to the stdout

Solution:
golib/sqlutils layer is not aware of the server identity it operates on.
It proxies creation of sql.DB object and then uses this object for
queries execution.

Logger interface has been introduced. golib/sqlutils client can register
its own logger which will be used instead of internal logging when the
error occurs during usage of the related sql.DB object.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant