Re: emergency outage requiring database restart - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: emergency outage requiring database restart
Date
Msg-id CAHyXU0w2VZ_n+if48yLo86uo_cCMUQVCxFT92M0om9HFsn3heA@mail.gmail.com
Whole thread Raw
In response to Re: emergency outage requiring database restart  (Andres Freund <andres@anarazel.de>)
Responses Re: emergency outage requiring database restart  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Wed, Oct 26, 2016 at 1:45 PM, Andres Freund <andres@anarazel.de> wrote:
>
>
> On October 26, 2016 9:38:49 PM GMT+03:00, Merlin Moncure <mmoncure@gmail.com> wrote:
>>On Wed, Oct 26, 2016 at 1:34 PM, Andres Freund <andres@anarazel.de>
>>wrote:
>>> Any chance that plsh or the script it executes does anything with the
>>file descriptors it inherits? That'd certainly one way to get into odd
>>corruption issues.
>>
>>not sure.  it's pretty small -- see
>>https://github.com/petere/plsh/blob/master/plsh.c
>
> Afaics that could also be in your script, not just plsh. The later doesn't seem to close all file handles above
stderr,which means that all handles for relations etc week be open in your script.  If you e.g. do any unusual
redirections(2>&17 or such), that could end badly.   But I'm just on my phone, in a taxi without seatbelts, at 60mph,
soI didn't look carefully. 

gotcha :-).  see above:
*) sqshf:
#!/bin/bash
cat \ $2 \ | eval "sqsh $1 -L'datetime=%Y-%m-%d %H:%M:%S.%u' -G 7.0"

echo "Success"

*) shexec:
#!/bin/bash

eval $1

FWICT that's all that's happening here with respect to pl/sh. I'm
almost done with reproduction environment and if i get the issue I
should be able to zero in on the problem.  One final thing is that
concurrency is a contributing factor.

merlin



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: emergency outage requiring database restart
Next
From: Robert Haas
Date:
Subject: Re: Confusing docs about GetForeignUpperPaths in fdwhandler.sgml