RE: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server - Mailing list pgsql-hackers

From Hayato Kuroda (Fujitsu)
Subject RE: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server
Date
Msg-id OS9PR01MB12149873B1F63BDBB3E5012CAF5ED2@OS9PR01MB12149.jpnprd01.prod.outlook.com
Whole thread
In response to Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server
List pgsql-hackers
Dear Jeff,

I went through the 0003 patch. Apart from HINT message, I found that error code
ERRCODE_CONNECTION_FAILURE is always used. Should we report the original errcode
of the root cause? Or it's OK because the observed outcome is the cannot-connect
error?

Another comment:


```
+               conninfo = ForeignServerConnectionString(subowner, server);
+               Assert(conninfo != NULL);
```

Do we have to consider the case that ForeignServerConnectionString() returns NULL
without any ERRORs? For the production build, the Assert() would be skipped and
the segmentation fault would happen in the `if (!conninfo)` part.
I checked the doc [1] but there are no specifications for it.

[1]:
https://www.postgresql.org/docs/devel/sql-createforeigndatawrapper.html#:~:text=ereport(ERROR)%20function.-,CONNECTION%20connection_function,-connection_function%20is%20the

Best regards,
Hayato Kuroda
FUJITSU LIMITED


pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: Why clearing the VM doesn't require registering vm buffer in wal record
Next
From: Sungwoo Chang
Date:
Subject: Re: Fwd: dsm_registry: Add detach and destroy features