Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gupsi-0002xZ-V6 for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Feb 2019 02:39:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gupsh-0001nC-M0 for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Feb 2019 02:39:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gupsh-0001j5-8l for pgsql-hackers@lists.postgresql.org; Sat, 16 Feb 2019 02:39:07 +0000 Received: from mail-it1-x142.google.com ([2607:f8b0:4864:20::142]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gupsZ-00053V-W6 for pgsql-hackers@postgresql.org; Sat, 16 Feb 2019 02:39:06 +0000 Received: by mail-it1-x142.google.com with SMTP id r11so28829456itc.2 for ; Fri, 15 Feb 2019 18:38:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=SoK0n8fjIHVgPugWzUpMZIOPKAB6byoQFV+Rau/UHkw=; b=Us9uteFBYUqoCIzrfJbnu3016R1X0+DTnpoW1cHO/KezcJw3gUPdvcf45T4NQ72mFg kLoaHv0TA8iTN4dbeapSfBQmtkglTu1YNweijTSgFHGkUtgLwthTW1q8qDaGydEm4b6O +3BgQvn3ob9uI7R3Rzyw2y0RO3fyuh2CD4yrcvq9fLzzIctnqOT3BTqj0w0KkXZL56xq Cov7AsoaqJzpOs68lI3H5ssyk96dirn31X/+0Hm4xvOwR60iFSAV2lq5THNr5ZppGEat xEHxsu+8vfwYWBmwA33qu0RzYlXsmreX1Nsr8zgOhTH+gXBSwgjjtpzc/y/RaVaLT3Vp 8zUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=SoK0n8fjIHVgPugWzUpMZIOPKAB6byoQFV+Rau/UHkw=; b=Pty0uF2E5/0BIsdg7lH6wVIhlyKh/QyLotEZUF5OFEfMIjs0WLrQQNjUQwtGoOqEnT tUiIzSXihK2E53an2nStxbkttYvrQNQf8bOCg1k6Jp7uUv4qlVXDQV0EOqLG27z7a1IF 3N4x348ZUwXz/hd9mE07J9Qp40vX5J0epvFdOL+450/Bl550g4+/gWYUGsmgUCKvj3dN gS0smdZvKuIK1yB7PczYBU0aY0Q2Y8lTWFBnjqp1OUwg4L1HS/yz5fCs+NUi6K18C0c4 eHn93GAmG23tTDZ8W9jpdqgGVHH1AhY2y0BIlF0ZNOeJMplLgI8P7lUl1gRqkb0TPRRD pULA== X-Gm-Message-State: AHQUAuZtsSNc9z4rs2VBuqp8xEAvOItHPa8ivDuvn3MTHd+QpAxeN6MY zBA0Dggb6u5L75PImoxhe3kOmQ== X-Google-Smtp-Source: AHgI3IYurFPGvukCCTXHa9wDEX+Wv3QH9g6zIGvziIKYdpClRMzQWijynsGMP1F0YDKtvGrtMF3T8Q== X-Received: by 2002:a5d:8719:: with SMTP id u25mr7379636iom.2.1550284737310; Fri, 15 Feb 2019 18:38:57 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id q64sm3307376iod.48.2019.02.15.18.38.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Feb 2019 18:38:56 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 08D66800BD7; Fri, 15 Feb 2019 20:38:54 -0600 (CST) Date: Fri, 15 Feb 2019 20:38:54 -0600 From: Justin Pryzby To: pgsql-hackers@postgresql.org Cc: Thomas Munro Subject: REL_11_STABLE: dsm.c - cannot unpin a segment that is not pinned Message-ID: <20190216023854.GF30291@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I saw this error once last week while stress testing to reproduce earlier bugs, but tentatively thought it was a downstream symptom of those bugs (since fixed), and now wanted to check that #15585 and others were no longer reproducible. Unfortunately I got this error while running same test case [2] as for previous bug ('could not attach'). 2019-02-14 23:40:41.611 MST [32287] ERROR: cannot unpin a segment that is not pinned On commit faf132449c0cafd31fe9f14bbf29ca0318a89058 (REL_11_STABLE including both of last week's post-11.2 DSA patches), I reproduced twice, once within ~2.5 hours, once within 30min. I'm not able to reproduce on master running overnight and now 16+hours. See also: pg11.1: dsa_area could not attach to segment - resolved by commit 6c0fb941892519ad6b8873e99c4001404fb9a128 [1] https://www.postgresql.org/message-id/20181231221734.GB25379%40telsasoft.com pg11.1: dsa_area could not attach to segment: [2] https://www.postgresql.org/message-id/20190211040132.GV31721%40telsasoft.com BUG #15585: infinite DynamicSharedMemoryControlLock waiting in parallel query [3] https://www.postgresql.org/message-id/flat/15585-324ff6a93a18da46%40postgresql.org dsa_allocate() faliure - resolved by commit 7215efdc005e694ec93678a6203dbfc714d12809 (also doesn't affect master) [4] https://www.postgresql.org/message-id/flat/CAMAYy4%2Bw3NTBM5JLWFi8twhWK4%3Dk_5L4nV5%2BbYDSPu8r4b97Zg%40mail.gmail.com #0 0x00007f96a589e277 in raise () from /lib64/libc.so.6 #1 0x00007f96a589f968 in abort () from /lib64/libc.so.6 #2 0x000000000088b6f7 in errfinish (dummy=dummy@entry=0) at elog.c:555 #3 0x000000000088eee8 in elog_finish (elevel=elevel@entry=22, fmt=fmt@entry=0xa52cb0 "cannot unpin a segment that is not pinned") at elog.c:1376 #4 0x00000000007578b2 in dsm_unpin_segment (handle=1780672242) at dsm.c:914 #5 0x00000000008aee15 in dsa_release_in_place (place=0x7f96a6991640) at dsa.c:618 #6 0x00000000007571a9 in dsm_detach (seg=0x2470f78) at dsm.c:731 #7 0x0000000000509233 in DestroyParallelContext (pcxt=0x24c18c0) at parallel.c:900 #8 0x000000000062db65 in ExecParallelCleanup (pei=0x25aacf8) at execParallel.c:1154 #9 0x0000000000640588 in ExecShutdownGather (node=node@entry=0x2549b60) at nodeGather.c:406 #10 0x0000000000630208 in ExecShutdownNode (node=0x2549b60) at execProcnode.c:767 #11 0x000000000067724f in planstate_tree_walker (planstate=planstate@entry=0x2549a48, walker=walker@entry=0x6301c0 , context=context@entry=0x0) at nodeFuncs.c:3739 #12 0x00000000006301dd in ExecShutdownNode (node=0x2549a48) at execProcnode.c:749 #13 0x000000000067724f in planstate_tree_walker (planstate=planstate@entry=0x25495d0, walker=walker@entry=0x6301c0 , context=context@entry=0x0) at nodeFuncs.c:3739 #14 0x00000000006301dd in ExecShutdownNode (node=0x25495d0) at execProcnode.c:749 #15 0x000000000067724f in planstate_tree_walker (planstate=planstate@entry=0x25494b8, walker=walker@entry=0x6301c0 , context=context@entry=0x0) at nodeFuncs.c:3739 #16 0x00000000006301dd in ExecShutdownNode (node=0x25494b8) at execProcnode.c:749 #17 0x000000000067724f in planstate_tree_walker (planstate=planstate@entry=0x25492a8, walker=walker@entry=0x6301c0 , context=context@entry=0x0) at nodeFuncs.c:3739 #18 0x00000000006301dd in ExecShutdownNode (node=node@entry=0x25492a8) at execProcnode.c:749 #19 0x0000000000628fbd in ExecutePlan (execute_once=, dest=0xd96e60 , direction=, numberTuples=0, sendTuples=true, operation=CMD_SELECT, use_parallel_mode=, planstate=0x25492a8, estate=0x2549038) at execMain.c:1787 #20 standard_ExecutorRun (queryDesc=0x2576990, direction=, count=0, execute_once=) at execMain.c:364 #21 0x00000000005c635f in ExplainOnePlan (plannedstmt=plannedstmt@entry=0x2579820, into=into@entry=0x0, es=es@entry=0x2529170, queryString=queryString@entry=0x243f348 "explain analyze SELECT colcld.child c, parent p, array_agg(colpar.attname::text ORDER BY colpar.attnum) cols, array_agg(format_type(colpar.atttypid, colpar.atttypmod) ORDER BY colpar.attnum) AS types "..., params=params@entry=0x0, queryEnv=queryEnv@entry=0x0, planduration=planduration@entry=0x7fff1048afa0) at explain.c:535 #22 0x00000000005c665f in ExplainOneQuery (query=, cursorOptions=, into=0x0, es=0x2529170, queryString=0x243f348 "explain analyze SELECT colcld.child c, parent p, array_agg(colpar.attname::text ORDER BY colpar.attnum) cols, array_agg(format_type(colpar.atttypid, colpar.atttypmod) ORDER BY colpar.attnum) AS types "..., params=0x0, queryEnv=0x0) at explain.c:371 #23 0x00000000005c6bbe in ExplainQuery (pstate=pstate@entry=0x2461bd8, stmt=stmt@entry=0x24f87a8, queryString=queryString@entry=0x243f348 "explain analyze SELECT colcld.child c, parent p, array_agg(colpar.attname::text ORDER BY colpar.attnum) cols, array_agg(format_type(colpar.atttypid, colpar.atttypmod) ORDER BY colpar.attnum) AS types "..., params=params@entry=0x0, queryEnv=queryEnv@entry=0x0, dest=dest@entry=0x2461b40) at explain.c:254 #24 0x0000000000782a5d in standard_ProcessUtility (pstmt=0x24f8930, queryString=0x243f348 "explain analyze SELECT colcld.child c, parent p, array_agg(colpar.attname::text ORDER BY colpar.attnum) cols, array_agg(format_type(colpar.atttypid, colpar.atttypmod) ORDER BY colpar.attnum) AS types "..., context=PROCESS_UTILITY_TOPLEVEL, params=0x0, queryEnv=0x0, dest=0x2461b40, completionTag=0x7fff1048b160 "") at utility.c:675 #25 0x000000000077fcc6 in PortalRunUtility (portal=0x24a4bd8, pstmt=0x24f8930, isTopLevel=, setHoldSnapshot=, dest=0x2461b40, completionTag=0x7fff1048b160 "") at pquery.c:1178 #26 0x0000000000780b03 in FillPortalStore (portal=portal@entry=0x24a4bd8, isTopLevel=isTopLevel@entry=true) at pquery.c:1038 #27 0x0000000000781638 in PortalRun (portal=portal@entry=0x24a4bd8, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true, run_once=run_once@entry=true, dest=dest@entry=0x2512490, #28 0x000000000077d27f in exec_simple_query ( query_string=0x243f348 "explain analyze SELECT colcld.child c, parent p, array_agg(colpar.attname::text ORDER BY colpar.attnum) cols, array_agg(format_type(colpar.atttypid, colpar.atttypmod) ORDER BY colpar.attnum) AS types "...) at postgres.c:1145 #29 0x000000000077e5b2 in PostgresMain (argc=, argv=argv@entry=0x24691b8, dbname=0x24690b0 "postgres", username=) at postgres.c:4182 #30 0x000000000047cdf3 in BackendRun (port=0x24613a0) at postmaster.c:4361 #31 BackendStartup (port=0x24613a0) at postmaster.c:4033 #32 ServerLoop () at postmaster.c:1706 #33 0x0000000000706449 in PostmasterMain (argc=argc@entry=20, argv=argv@entry=0x2439ba0) at postmaster.c:1379 #34 0x000000000047ddd1 in main (argc=20, argv=0x2439ba0) at main.c:228