On Fri, Feb 3, 2023 at 5:38 PM Hayato Kuroda (Fujitsu) <kuroda.hay...@fujitsu.com> wrote: > > Dear Amit, Sawada-san, > > > > IIUC there is no difference between smart shutdown and fast shutdown > > > in logical replication walsender, but reading the doc[1], it seems to > > > me that in the smart shutdown mode, the server stops existing sessions > > > normally. For example, If the client is psql that gets stuck for some > > > reason and the network buffer gets full, the smart shutdown waits for > > > a backend process to send all results to the client. I think the > > > logical replication walsender should follow this behavior for > > > consistency. One idea is to distinguish smart shutdown and fast > > > shutdown also in logical replication walsender so that we disconnect > > > even without the done message in fast shutdown mode, but I'm not sure > > > it's worthwhile. > > > > > > > The main problem we want to solve here is to avoid shutdown failing in > > case walreceiver/applyworker is busy waiting for some lock or for some > > other reason as shown in the email [1]. > >
For this problem isn't using -t (timeout) avoid it? So, if there is a pending WAL, users can always use -t option to allow the shutdown to complete. Now, I agree that it is not very clear how much time to specify but a user has some option to allow the shutdown to complete. I am not telling that teaching walsenders about shutdown modes is completely a bad idea but it doesn't seem necessary to allow shutdowns to complete. -- With Regards, Amit Kapila.