[MDEV-21046] Print server version to error log instead of stderr during startup process Created: 2019-11-13 Updated: 2023-04-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.2.29, 10.3.20, 10.4.10 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
It would be great if MariaDB printed the server version to the error log earlier during the startup process than it currently does. The server does print the server version immediately during the startup process at this line of code: https://github.com/MariaDB/server/blob/mariadb-10.2.29/sql/mysqld.cc#L4326 However, this output does not go to the error log. Instead, this output is printed to stderr before stderr is redirected to the error log. For example, we can see this happening if we check with strace:
This means that if the server is started with systemd (which is the most common startup method now), then the output goes to the systemd journal. For example:
We should probably fix this code, so that the output properly goes to the error log. We may also want to modify the message, so that it includes the information requested in Currently, MariaDB only prints the server version to the error log after it has been completely initialized, and it is ready for connections. For example:
However, if the server has to go through crash recovery, or if the server is using Galera and it has to perform an SST or IST, then the user may have to wait a long time to see this message get printed in the error log. I don't think this is sufficient. |
| Comments |
| Comment by Aleksey Midenkov [ 2023-01-27 ] |
|
At least there should be --quiet option to keep STDERR clean. |