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 1ifaTP-000094-T8 for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Dec 2019 02:14:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ifaSQ-0003DN-Oy for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Dec 2019 02:13:30 +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 1ifaSQ-0003DG-DO for pgsql-hackers@lists.postgresql.org; Fri, 13 Dec 2019 02:13:30 +0000 Received: from mail-yb1-xb2b.google.com ([2607:f8b0:4864:20::b2b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ifaSM-0004cw-Tp for pgsql-hackers@postgresql.org; Fri, 13 Dec 2019 02:13:29 +0000 Received: by mail-yb1-xb2b.google.com with SMTP id 63so268979yba.2 for ; Thu, 12 Dec 2019 18:13:26 -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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=trKe8mS3Pxk34se8nDH2eSqPxt86lnXlUK7KHHwh1Wk=; b=bCF1J2f2ioYwGDhZBZsTVIiw34wDvQpfenImHNIgvhfZ8Q9c7YB7Hh8NLt/gyDFcVY gZq8hCLrAOUlr90mH1lZbMT4UouYl0aYdUjho+v9Q62Njn1N+fUwJrZC/lGYUU7kgN9T OF5KLYiOge0eXObCgLLMvtNTTVjQtYL6Dg1H3B2hKkcK3GZJKZT3m7hw6HLFtbHUPAnT OIyMof43utzf0gqb5b4aS1P88x5VWj5WNVvUpApLUGB4vo0mrFkQ/ok6wNYTi3yIQzU4 2Q1TWhti5ziSP8EsDXTsj9phOqkBKs8p02v+EuhxcSDQy8q6rUss12+pb7qbdO9NlxGO XOdg== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=trKe8mS3Pxk34se8nDH2eSqPxt86lnXlUK7KHHwh1Wk=; b=nhs5C0gX6CBzJbh//rEEfeEfa9Ubt5gUpwlQ4ROVXiG1EKk3BwgDSGgX+q+mQjcgRK 7I1uyumd5PPZph+no0zKHfF6o7ut76jNivbS6E8rjomTQ3r8Fe8ghxBPup6n4oberScX Ee0pYDsOKzYpC/zXdXZqj4teaU6IftLAV0CvrZ2voK2eJK/q74PjPa+CXPBRtazAnagP UliOtpJ7W18L8B2S0EJMmFFBYLjagdiJCwpQF2sPAiVmkcC4vFh2tL4D5qHpzKpIx3N9 4PgjhWMplO2jqdNvuffs1fPKTLhBKUOnil/OpSlpr83071Lh7xNYBgNuTvSTHwbBVb8y Vs1Q== X-Gm-Message-State: APjAAAVzOH79hvpfyp6HwUBaxb+LSOHkpCxVtsJW2D93rJ7DZXATJ2ec Inpq3vbceuTCta+k78OetSEY2w== X-Google-Smtp-Source: APXvYqzKlnz2a9N4kFokWPZIY33p+0x8xU/lzY4ZTOQk2xBmW1RlHJyBEzVs/8WeCVDGbX5nPWCORQ== X-Received: by 2002:a25:2f49:: with SMTP id v70mr3834788ybv.161.1576203204883; Thu, 12 Dec 2019 18:13:24 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id d10sm2067623ywd.107.2019.12.12.18.13.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Dec 2019 18:13:23 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id CA65F800A79; Thu, 12 Dec 2019 20:13:22 -0600 (CST) Date: Thu, 12 Dec 2019 20:13:22 -0600 From: Justin Pryzby To: Thomas Munro Cc: pgsql-hackers , "Bossart, Nathan" Subject: Re: shared tempfile was not removed on statement_timeout (unreproducible) Message-ID: <20191213021322.GS2082@telsasoft.com> References: <20191212180506.GR2082@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Dec 13, 2019 at 03:03:47PM +1300, Thomas Munro wrote: > On Fri, Dec 13, 2019 at 7:05 AM Justin Pryzby wrote: > > I have a nagios check on ancient tempfiles, intended to catch debris left by > > crashed processes. But triggered on this file: > > > > $ sudo find /var/lib/pgsql/12/data/base/pgsql_tmp -ls > > 142977 4 drwxr-x--- 3 postgres postgres 4096 Dec 12 11:32 /var/lib/pgsql/12/data/base/pgsql_tmp > > 169868 4 drwxr-x--- 2 postgres postgres 4096 Dec 7 01:35 /var/lib/pgsql/12/data/base/pgsql_tmp/pgsql_tmp11025.0.sharedfileset > > 169347 5492 -rw-r----- 1 postgres postgres 5619712 Dec 7 01:35 /var/lib/pgsql/12/data/base/pgsql_tmp/pgsql_tmp11025.0.sharedfileset/0.0 > > 169346 5380 -rw-r----- 1 postgres postgres 5505024 Dec 7 01:35 /var/lib/pgsql/12/data/base/pgsql_tmp/pgsql_tmp11025.0.sharedfileset/1.0 > > > > I found: > > 2019-12-07 01:35:56 | 11025 | postgres | canceling statement due to statement timeout | CLUSTER pg_stat_database_snap USI > > 2019-12-07 01:35:56 | 11025 | postgres | temporary file: path "base/pgsql_tmp/pgsql_tmp11025.0.sharedfileset/2.0", size 5455872 | CLUSTER pg_stat_database_snap USI > > Hmm. But then... maybe the two log lines you quoted should > be the other way around for that. And, it's actually the other way around, when I order BY something better than left(log_time::text,19). postgres=# SELECT log_time pid, session_line ln, pid, database db, left(message,99), left(query,33) FROM jrn_postgres_log WHERE user_name IS NOT NULL AND log_time BETWEEN '2019-12-07 01:35' AND '2019-12-07 01:36' ORDER BY 1,2; 2019-12-07 01:35:56.626-06 | 1 | 11025 | postgres | temporary file: path "base/pgsql_tmp/pgsql_tmp11025.0.sharedfileset/2.0", size 5455872 | CLUSTER pg_stat_database_snap USI 2019-12-07 01:35:56.626-06 | 2 | 11025 | postgres | canceling statement due to statement timeout | CLUSTER pg_stat_database_snap USI