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 1ge5sU-0002h2-RS for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Dec 2018 22:17:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ge5sT-0005Bc-0x for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Dec 2018 22:17:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ge5sS-0005BV-Gf for pgsql-hackers@lists.postgresql.org; Mon, 31 Dec 2018 22:17:40 +0000 Received: from mail-it1-x142.google.com ([2607:f8b0:4864:20::142]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ge5sO-0002Te-TY for pgsql-hackers@postgresql.org; Mon, 31 Dec 2018 22:17:39 +0000 Received: by mail-it1-x142.google.com with SMTP id h193so34977737ita.5 for ; Mon, 31 Dec 2018 14:17:36 -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=jHD3qGS9pwdbZcTu6Y26ToVZor6HILGzB7EBNrGwxdo=; b=AU7Na+w34AoTRdUMxvwHv8+Iz22bpyEMQLL7fijdP09tUpikGNG4GlIpsnN7VThPf4 8f5uwCJftdgasolOnvP61474l37StoCYTjbh9441DiobfDAiANGxnM2cYFf3V9NOwXCM 78MsRTDiEEWviBvReKhlsEz9cuwvBdRQkLMkMsnwlA/Xyh4kYSkhZkWP+pJMMQpGOaAO KiYx8A7w+cUOFGJb8gTc8VAzK4oIcYFnRWly8zB5610iGtxfJ9ffzyq+daqydF49JuUa GxRS6idvJsLyq1PoMur2XHijjmusIMC1Tje8pD2emz9Cu/VkvztGaFPR8PPGs7on62xq 8YDA== 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=jHD3qGS9pwdbZcTu6Y26ToVZor6HILGzB7EBNrGwxdo=; b=FlJbHZ90SyxVsjH3FwoKX/GoOfram1iJ1Mav/dBuArO8Ch6VrDxpsWIIqAQKk1QIWd ae8rDFWsMUOvSPgKT65MV5vW1HDL7sehDT9JkUhybm4DVw9tOGsa7b0gnnQEEj7gcTPU Xe7ZpE1rOND+FN0v/mbfObZTFQwaD+KWeJ9c2AvnkqaDQmKSKrKJbvHtSmzUpDt6nU2s 0czkw2qWRd23oxuzkvEbc+HgzTLi9HhPhTzFjwCMJrIuxmKlx71vNlEh1g1PoYD3Qao9 1uKTZAiqiPZdFVUV2mg7uouxNkCtdFFgGarZUR4/bLCQaUKJjF+7Vm6bP7sqGyKDbVdk ihVA== X-Gm-Message-State: AA+aEWYgfc+qI1ulRFJhpVjVdrDGOF9gHoCXLAaZWupf//a61KGGPLjG C3O3MTnMwJo1j5P4suRyLhHz1A== X-Google-Smtp-Source: AFSGD/UnJaLtJ36FPSXKgpB7fBWlNQlIja0Kn+n5OuFBmum0Be04specWuvYdDBNknldnk6rPVixoQ== X-Received: by 2002:a02:8244:: with SMTP id q4mr25606859jag.43.1546294655509; Mon, 31 Dec 2018 14:17:35 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id o21sm22544353ioa.71.2018.12.31.14.17.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Dec 2018 14:17:35 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 2E5888054BB; Mon, 31 Dec 2018 16:17:34 -0600 (CST) Date: Mon, 31 Dec 2018 16:17:34 -0600 From: Justin Pryzby To: pgsql-hackers@postgresql.org Cc: Thomas Munro Subject: pg11.1: dsa_area could not attach to segment Message-ID: <20181231221734.GB25379@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 In our query logs I saw: postgres=# SELECT log_time, session_id, session_line, left(message,99), left(query,99) FROM postgres_log WHERE error_severity='ERROR' AND message NOT LIKE 'cancel%'; -[ RECORD 1 ]+---------------------------------------------------------------------------------------------------- log_time | 2018-12-31 15:39:11.917-05 session_id | 5c2a7e6f.1fa4 session_line | 1 left | dsa_area could not attach to segment left | SELECT colcld.child c, parent p, array_agg(colpar.attname::text ORDER BY colpar.attnum) cols, array -[ RECORD 2 ]+---------------------------------------------------------------------------------------------------- log_time | 2018-12-31 15:39:11.917-05 session_id | 5c2a7e6f.1fa3 session_line | 4 left | dsa_area could not attach to segment left | SELECT colcld.child c, parent p, array_agg(colpar.attname::text ORDER BY colpar.attnum) cols, array The full query + plan is: |ts=# explain 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 |FROM queued_alters qa |JOIN pg_attribute colpar ON to_regclass(qa.parent)=colpar.attrelid AND colpar.attnum>0 AND NOT colpar.attisdropped |JOIN (SELECT *, attrelid::regclass::text AS child FROM pg_attribute) colcld ON to_regclass(qa.child) =colcld.attrelid AND colcld.attnum>0 AND NOT colcld.attisdropped |WHERE colcld.attname=colpar.attname AND colpar.atttypid!=colcld.atttypid |GROUP BY 1,2 |ORDER BY |parent LIKE 'unused%', -- Do them last |regexp_replace(colcld.child, '.*_((([0-9]{4}_[0-9]{2})_[0-9]{2})|(([0-9]{6})([0-9]{2})?))$', '\3\5') DESC, | regexp_replace(colcld.child, '.*_', '') DESC |LIMIT 1; |QUERY PLAN |Limit (cost=67128.06..67128.06 rows=1 width=307) | -> Sort (cost=67128.06..67137.84 rows=3912 width=307) | Sort Key: (((qa_1.parent)::text ~~ 'unused%'::text)), (regexp_replace((((pg_attribute.attrelid)::regclass)::text), '.*_((([0-9]{4}_[0-9]{2})_[0-9]{2})|(([0-9]{6})([0-9]{2})?))$'::text, '\3\5'::text)) DESC, (regexp_replace((((pg_attribute.attrelid)::regclass)::text), '.*_'::text, ''::text)) DESC | -> GroupAggregate (cost=66893.34..67108.50 rows=3912 width=307) | Group Key: (((pg_attribute.attrelid)::regclass)::text), qa_1.parent | -> Sort (cost=66893.34..66903.12 rows=3912 width=256) | Sort Key: (((pg_attribute.attrelid)::regclass)::text), qa_1.parent | -> Gather (cost=40582.28..66659.91 rows=3912 width=256) | Workers Planned: 2 | -> Parallel Hash Join (cost=39582.28..65268.71 rows=1630 width=256) | Hash Cond: (((to_regclass((qa_1.child)::text))::oid = pg_attribute.attrelid) AND (colpar.attname = pg_attribute.attname)) | Join Filter: (colpar.atttypid <> pg_attribute.atttypid) | -> Nested Loop (cost=0.43..25614.89 rows=11873 width=366) | -> Parallel Append (cost=0.00..12.00 rows=105 width=292) | -> Parallel Seq Scan on queued_alters_child qa_1 (cost=0.00..11.47 rows=147 width=292) | -> Parallel Seq Scan on queued_alters qa (cost=0.00..0.00 rows=1 width=292) | -> Index Scan using pg_attribute_relid_attnum_index on pg_attribute colpar (cost=0.43..242.70 rows=114 width=78) | Index Cond: ((attrelid = (to_regclass((qa_1.parent)::text))::oid) AND (attnum > 0)) | Filter: (NOT attisdropped) | -> Parallel Hash (cost=33651.38..33651.38 rows=395365 width=72) | -> Parallel Seq Scan on pg_attribute (cost=0.00..33651.38 rows=395365 width=72) | Filter: ((NOT attisdropped) AND (attnum > 0)) | queued_alters is usually empty, and looks like it would've last been nonempty on 2018-12-10. ts=# \d queued_alters Table "public.queued_alters" Column | Type | Collation | Nullable | Default --------+-----------------------+-----------+----------+--------- child | character varying(64) | | | parent | character varying(64) | | | Indexes: "queued_alters_child_parent_key" UNIQUE CONSTRAINT, btree (child, parent) Number of child tables: 1 (Use \d+ to list them.) I found this other log at that time: 2018-12-31 15:39:11.918-05 | 30831 | 5bf38e71.786f | 5 | background worker "parallel worker" (PID 8100) exited with exit code 1 Which is the postmaster, or its PID in any case.. [pryzbyj@telsasoft-db ~]$ ps -wwwf 30831 UID PID PPID C STIME TTY STAT TIME CMD postgres 30831 1 0 Nov19 ? S 62:44 /usr/pgsql-11/bin/postmaster -D /var/lib/pgsql/11/data postgres=# SELECT log_time, pid, session_line, left(message,99) FROM postgres_log WHERE session_id='5bf38e71.786f' ; log_time | pid | session_line | left ----------------------------+-------+--------------+------------------------------------------------------------------------- 2018-12-31 15:39:11.918-05 | 30831 | 5 | background worker "parallel worker" (PID 8100) exited with exit code 1 2018-12-31 15:39:11.935-05 | 30831 | 6 | background worker "parallel worker" (PID 8101) exited with exit code 1 2018-12-31 16:40:47.42-05 | 30831 | 7 | background worker "parallel worker" (PID 7239) exited with exit code 1 2018-12-31 16:40:47.42-05 | 30831 | 8 | background worker "parallel worker" (PID 7240) exited with exit code 1 2018-12-31 16:41:00.151-05 | 30831 | 9 | background worker "parallel worker" (PID 7371) exited with exit code 1 2018-12-31 16:41:00.151-05 | 30831 | 10 | background worker "parallel worker" (PID 7372) exited with exit code 1 2018-12-31 16:41:04.024-05 | 30831 | 11 | background worker "parallel worker" (PID 7451) exited with exit code 1 2018-12-31 16:41:04.024-05 | 30831 | 12 | background worker "parallel worker" (PID 7450) exited with exit code 1 2018-12-31 16:41:23.845-05 | 30831 | 13 | background worker "parallel worker" (PID 7658) exited with exit code 1 2018-12-31 16:41:23.845-05 | 30831 | 14 | background worker "parallel worker" (PID 7659) exited with exit code 1 2018-12-31 16:43:58.854-05 | 30831 | 15 | background worker "parallel worker" (PID 10825) exited with exit code 1 2018-12-31 16:43:58.854-05 | 30831 | 16 | background worker "parallel worker" (PID 10824) exited with exit code 1 I seem to be missing logs for session_lines 1-4 , which would've been rotated to oblivion if older than 24h. I found these: https://www.postgresql.org/message-id/flat/CAPa4P2YzgRTBHHRx2KAPUO1_xkmqQgT2xP0tS_e%3DphWvNzWdkA%40mail.gmail.com#4a1a94bc71d4c99c01babc759fe5b6ec https://www.postgresql.org/message-id/CAEepm=0Mv9BigJPpribGQhnHqVGYo2+kmzekGUVJJc9Y_ZVaYA@mail.gmail.com Which appears to have been commited so I think this error is not unexpected. |commit fd7c0fa732d97a4b4ebb58730e6244ea30d0a618 |Author: Robert Haas |Date: Mon Dec 18 12:17:37 2017 -0500 | |Fix crashes on plans with multiple Gather (Merge) nodes. I will try to reproduce and provide bt...but all I can think to do is run a tight loop around that query and hope something else comes by and tickles it a few more times. Happy Grecian newyear. Justin