Giving more detail in pg_upgrade errormessage

Started by Daniel Gustafssonover 2 years ago4 messageshackers
Jump to latest
#1Daniel Gustafsson
daniel@yesql.se

Looking at the upgrade question in [0]CACoPQdbQTysF=EKckyFNGTdpOdXXMEsf_2ACno+bcNqQCB5raA@mail.gmail.com made me realize that we discard
potentially useful information for troubleshooting. When we check if the
cluster is properly shut down we might as well include the status from
pg_controldata in the errormessage as per the trivial (but yet untested)
proposed diff.

Is there a reason not to be verbose here as users might copy/paste this output
when asking for help?

--
Daniel Gustafsson

[0]: CACoPQdbQTysF=EKckyFNGTdpOdXXMEsf_2ACno+bcNqQCB5raA@mail.gmail.com

Attachments:

pg_upgrade_controldata.diffapplication/octet-stream; name=pg_upgrade_controldata.diff; x-unix-mode=0644Download+2-2
#2Zhang Mingli
zmlpostgres@gmail.com
In reply to: Daniel Gustafsson (#1)
Re: Giving more detail in pg_upgrade errormessage

Hi,

Is there a reason not to be verbose here as users might copy/paste this output
when asking for help?

Seems better than nothing.

[0] CACoPQdbQTysF=EKckyFNGTdpOdXXMEsf_2ACno+bcNqQCB5raA@mail.gmail.com

Full link for convenience.

[0]: /messages/by-id/CACoPQdbQTysF=EKckyFNGTdpOdXXMEsf_2ACno+bcNqQCB5raA@mail.gmail.com

Zhang Mingli
https://www.hashdata.xyz

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Daniel Gustafsson (#1)
Re: Giving more detail in pg_upgrade errormessage

Daniel Gustafsson <daniel@yesql.se> writes:

Looking at the upgrade question in [0] made me realize that we discard
potentially useful information for troubleshooting. When we check if the
cluster is properly shut down we might as well include the status from
pg_controldata in the errormessage as per the trivial (but yet untested)
proposed diff.

Is there a reason not to be verbose here as users might copy/paste this output
when asking for help?

Agreed, but I think you need to chomp the string's trailing newline,
or it'll look ugly. You might as well do that further up and remove
the newlines from the comparison strings, too.

regards, tom lane

#4Daniel Gustafsson
daniel@yesql.se
In reply to: Tom Lane (#3)
Re: Giving more detail in pg_upgrade errormessage

On 18 Jul 2023, at 18:04, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Daniel Gustafsson <daniel@yesql.se> writes:

Looking at the upgrade question in [0] made me realize that we discard
potentially useful information for troubleshooting. When we check if the
cluster is properly shut down we might as well include the status from
pg_controldata in the errormessage as per the trivial (but yet untested)
proposed diff.

Is there a reason not to be verbose here as users might copy/paste this output
when asking for help?

Agreed, but I think you need to chomp the string's trailing newline,
or it'll look ugly. You might as well do that further up and remove
the newlines from the comparison strings, too.

Yeah, the previous diff was mostly a sketch. The attached strips newline and
makes the comparisons a bit neater in the process due to that. Will apply this
trivial but seemingly useful change unless objected to.

--
Daniel Gustafsson

Attachments:

v2-0001-pg_upgrade-include-additional-detail-in-cluster-c.patchapplication/octet-stream; name=v2-0001-pg_upgrade-include-additional-detail-in-cluster-c.patch; x-unix-mode=0644Download+6-6