Thread: Shared memory error

Shared memory error

From
Sonam Sharma
Date:
Hi Team,

Getting below error when any query is running from jdbc side :

Error : could not open memory segment "/PostgreSQL.1511679208" : No such file or directory 

Yesterday I have extended the /dev/shm filesystem and the query ran. But today again the issue is repeating.

Can someone please help 

Re: Shared memory error

From
Sonam Sharma
Date:
I have set the dynamic_shared_memory_type to none which was set as POSIX. For now we are not seeing the error... Can someone please explain what is the impact of setting it as none .

On Wed, Jun 3, 2020, 8:28 PM Sonam Sharma <sonams1209@gmail.com> wrote:
Hi Team,

Getting below error when any query is running from jdbc side :

Error : could not open memory segment "/PostgreSQL.1511679208" : No such file or directory 

Yesterday I have extended the /dev/shm filesystem and the query ran. But today again the issue is repeating.

Can someone please help 

Re: Shared memory error

From
Adrian Klaver
Date:
On 6/3/20 7:58 AM, Sonam Sharma wrote:
> Hi Team,
> 
> Getting below error when any query is running from jdbc side :
> 
> Error : could not open memory segment "/PostgreSQL.1511679208" : No such 
> file or directory
> 
> Yesterday I have extended the /dev/shm filesystem and the query ran. But 
> today again the issue is repeating.
> 
> Can someone please help


To get any useful help you will need to provide:

1) Postgres version

2) JDBC driver version

3) OS and version

4) Is this only with one query and if so what is it doing?

-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: Shared memory error

From
Sonam Sharma
Date:


On Wed, Jun 3, 2020, 11:29 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 6/3/20 7:58 AM, Sonam Sharma wrote:
> Hi Team,
>
> Getting below error when any query is running from jdbc side :
>
> Error : could not open memory segment "/PostgreSQL.1511679208" : No such
> file or directory
>
> Yesterday I have extended the /dev/shm filesystem and the query ran. But
> today again the issue is repeating.
>
> Can someone please help


To get any useful help you will need to provide:

1) Postgres version : 11.2

2) JDBC driver version : need to check on this

3) OS and version : Linux  Red Hat 7.6 

4) Is this only with one query and if so what is it doing? : No , few queries work, few fails .. mostly all are complex select queries.

Please let me know if any other info is required..

Re: Shared memory error

From
Sonam Sharma
Date:
Updated jdbc version also 

On Wed, Jun 3, 2020, 11:46 PM Sonam Sharma <sonams1209@gmail.com> wrote:


On Wed, Jun 3, 2020, 11:29 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 6/3/20 7:58 AM, Sonam Sharma wrote:
> Hi Team,
>
> Getting below error when any query is running from jdbc side :
>
> Error : could not open memory segment "/PostgreSQL.1511679208" : No such
> file or directory
>
> Yesterday I have extended the /dev/shm filesystem and the query ran. But
> today again the issue is repeating.
>
> Can someone please help


To get any useful help you will need to provide:

1) Postgres version : 11.2

2) JDBC driver version : spring-boot-starter-jdbc -1.5.0.Release

3) OS and version : Linux  Red Hat 7.6 

4) Is this only with one query and if so what is it doing? : No , few queries work, few fails .. mostly all are complex select queries.

Please let me know if any other info is required..

Re: Shared memory error

From
Sonam Sharma
Date:
Can someone please help on this

On Wed, Jun 3, 2020, 11:27 PM Sonam Sharma <sonams1209@gmail.com> wrote:
I have set the dynamic_shared_memory_type to none which was set as POSIX. For now we are not seeing the error... Can someone please explain what is the impact of setting it as none .

On Wed, Jun 3, 2020, 8:28 PM Sonam Sharma <sonams1209@gmail.com> wrote:
Hi Team,

Getting below error when any query is running from jdbc side :

Error : could not open memory segment "/PostgreSQL.1511679208" : No such file or directory 

Yesterday I have extended the /dev/shm filesystem and the query ran. But today again the issue is repeating.

Can someone please help 

Re: Shared memory error

From
Naresh g
Date:
Hi,

If the dynamic shared memory segment type is POSIX then dynamic shared memory control segment in your case it is PostgreSQL.1511679208 is stored in /dev/shm 

 The file you mentioned will be created at the time of PostgreSQL startup and cleared automatically on successful shutdown.

Complete case study depicted your error is found here 


Regards

On Thu, Jun 4, 2020 at 12:39 PM Sonam Sharma <sonams1209@gmail.com> wrote:
Can someone please help on this

On Wed, Jun 3, 2020, 11:27 PM Sonam Sharma <sonams1209@gmail.com> wrote:
I have set the dynamic_shared_memory_type to none which was set as POSIX. For now we are not seeing the error... Can someone please explain what is the impact of setting it as none .

On Wed, Jun 3, 2020, 8:28 PM Sonam Sharma <sonams1209@gmail.com> wrote:
Hi Team,

Getting below error when any query is running from jdbc side :

Error : could not open memory segment "/PostgreSQL.1511679208" : No such file or directory 

Yesterday I have extended the /dev/shm filesystem and the query ran. But today again the issue is repeating.

Can someone please help 

Re: Shared memory error

From
Thomas Munro
Date:
On Thu, Jun 4, 2020 at 6:18 AM Sonam Sharma <sonams1209@gmail.com> wrote:
>>> 1) Postgres version : 11.2

FYI This is missing over a year's worth of bugfixes.  That said, I
don't know of anything fixed that has this symptom.

>>> 4) Is this only with one query and if so what is it doing? : No , few queries work, few fails .. mostly all are
complexselect queries.
 

It's a long shot, because I expect you're running the usual packages
under a user set up by the package to be a "system" user, but just in
case: there is one known way for POSIX shm to be unlinked while you're
still using it: systemd.  For example, this might happen if you have
cronjobs running as the same user.  Some more info:

https://www.postgresql.org/docs/11/kernel-resources.html#SYSTEMD-REMOVEIPC

Do you see any other errors around this one, in the PostgreSQL logs?



Re: Shared memory error

From
Thomas Munro
Date:
>> Do you see any other errors around this one, in the PostgreSQL logs?
> No , only this is the error from db and jdbc end .. and queries are failing

If you need a workaround right now you could always set
max_parallel_workers_per_gather=0 so that it doesn't try to use
parallel query.  That could make some queries run more slowly.

When you say you extended the /dev/shm filesystem, what are the mount
options, or how did you configure it?  It's interesting that the
problem went away for a while when you did that.



Re: Shared memory error

From
Sonam Sharma
Date:
The dynamic_shared_memory_type was set to POSIX . Because of this it was using tmpfs /dev/shm. When the query was running I saw the file system was filling. So I  extended the file system and luckily the query worked for that time

On Thu, Jun 4, 2020, 5:12 PM Thomas Munro <thomas.munro@gmail.com> wrote:
>> Do you see any other errors around this one, in the PostgreSQL logs?
> No , only this is the error from db and jdbc end .. and queries are failing

If you need a workaround right now you could always set
max_parallel_workers_per_gather=0 so that it doesn't try to use
parallel query.  That could make some queries run more slowly.

When you say you extended the /dev/shm filesystem, what are the mount
options, or how did you configure it?  It's interesting that the
problem went away for a while when you did that.

Re: Shared memory error

From
Thomas Munro
Date:
On Fri, Jun 5, 2020 at 1:00 AM Sonam Sharma <sonams1209@gmail.com> wrote:
> The dynamic_shared_memory_type was set to POSIX . Because of this it was using tmpfs /dev/shm. When the query was
runningI saw the file system was filling. So I  extended the file system and luckily the query worked for that time
 

Oh, hmm.  When you say "filling", maybe you hit the leaking shm
problem that was fixed in 11.7, that requires messages somewhere in
your log about lack of DSM slots?  I don't have an explanation for the
exact the error you're seeing though.  It's a bit tricky to speculate
on older releases with so many bug fixes missing though.  Please let
us know if you still see the problem after your next scheduled
upgrade.