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

[YSQL] Capture stderr in failed postgres process start #12659

Open
tylarb opened this issue May 26, 2022 · 1 comment
Open

[YSQL] Capture stderr in failed postgres process start #12659

tylarb opened this issue May 26, 2022 · 1 comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@tylarb
Copy link
Contributor

tylarb commented May 26, 2022

Jira Link: DB-552

Description

Currently, we only capture the error code on a postgres process start, like:

PostgreSQL server exited with code 256

This is a problem in the case of a postgres process failing to start before it can log to postgres.log because then there's no way to see the failure message, which would be printed to stderr.

In one case, we got lucky and could run the full postgres command on the command line itself...

/home/yugabyte/yb-software/yugabyte-2.12.3.0-b19-centos-x86_64/postgres/bin/postgres -D /mnt/d0/pg_data -p 5433 -h 0.0.0.0 -k /tmp/.yb.8228272234018189749 -c unix_socket_permissions=0700 -c logging_collector=on -c log_directory=/mnt/d0/yb-data/tserver/logs -c yb_pg_metrics.node_name=yb-cloud-c-xroisrzkkjezdcudxrxaj6sff4-n2 -c yb_pg_metrics.port=13000 -c config_file=/mnt/d0/pg_data/ysql_pg.conf -c hba_file=/mnt/d0/pg_data/ysql_hba.conf

Showing us the actual issue...

postgres: superuser_reserved_connections (3) plus max_wal_senders (10) must be less than max_connections (2)

so it would be great if we could capture the stderr of postgres process failures to speed resolution of this type of issue.

@tylarb tylarb added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels May 26, 2022
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels May 26, 2022
@yugabyte-ci yugabyte-ci removed the status/awaiting-triage Issue awaiting triage label Jul 27, 2022
@foucher
Copy link
Contributor

foucher commented Apr 25, 2024

  1. This problem occurs for initdb as well.
  2. It may be possible to deal with this by altering class PgWrapper to do an append-redirect (2>>) to <processname>_<pid>.STDERR (pid to differentiate different instantiations of the same process) in the log directory at the time of creating the process, and then tools might transparently pick it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

3 participants