Re: pg11.1: dsa_area could not attach to segment
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Sergei Kornilov <sk@zsrv.org>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2019-02-12T02:36:14Z
Lists: pgsql-hackers
On Mon, Feb 11, 2019 at 08:14:28PM -0600, Justin Pryzby wrote:
> > Can we please see the stderr output of dsa_dump(area), added just
> > before the PANIC? Can we see the value of "handle" when the error is
> > raised, and the directory listing for /dev/shm (assuming Linux) after
> > the crash (maybe you need restart_after_crash = off to prevent
> > automatic cleanup)?
>
> PANIC: dsa_area could not attach to segment index:8 handle:1076305344
>
> I think it needs to be:
>
> | if (segment == NULL) {
> | LWLockRelease(DSA_AREA_LOCK(area));
> | dsa_dump(area);
> | elog(PANIC, "dsa_area could not attach to segment index:%zd handle:%d", index, handle);
> | }
>
> ..but that triggers recursion:
Here's my dsa_log (which is repeated many times and 400kB total)..
dsa_area handle 0:
max_total_segment_size: 18446744073709551615
total_segment_size: 15740928
refcnt: 2
pinned: f
segment bins:
segment bin 0 (at least -2147483648 contiguous pages free):
segment index 2, usable_pages = 256, contiguous_pages = 0, mapped at 0x7f56ff9d5000
segment index 0, usable_pages = 0, contiguous_pages = 0, mapped at 0x7f56ffbd6840
segment bin 3 (at least 4 contiguous pages free):
segment index 7, usable_pages = 510, contiguous_pages = 6, mapped at 0x7f56ff0b4000
segment index 6, usable_pages = 510, contiguous_pages = 6, mapped at 0x7f56ff2b4000
segment index 5, usable_pages = 510, contiguous_pages = 5, mapped at 0x7f56ff4b4000
segment index 4, usable_pages = 510, contiguous_pages = 5, mapped at 0x7f56ff6b4000
segment index 3, usable_pages = 255, contiguous_pages = 6, mapped at 0x7f56ff8b4000
segment index 1, usable_pages = 255, contiguous_pages = 6, mapped at 0x7f56ffad6000
segment bin 10 (at least 512 contiguous pages free):
Note negative pages. Let me know if you want more of it (span descriptors?)
Justin
Commits
-
Fix race in dsm_attach() when handles are reused.
- 6c0fb9418925 12.0 landed
- bd195071fd2b 9.4.22 landed
- b7c8766d3480 9.5.17 landed
- cb0680573f7b 9.6.13 landed
- cb3d674e1709 10.8 landed
- faf132449c0c 11.3 landed
-
Refactor pid, random seed and start time initialization.
- 197e4af9d5da 12.0 cited