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 1iw6xy-0001Sg-5z for pgsql-general@arkaria.postgresql.org; Mon, 27 Jan 2020 16:10:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iw6xx-00009W-1r for pgsql-general@arkaria.postgresql.org; Mon, 27 Jan 2020 16:10:21 +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 1iw6xw-00009M-Ld for pgsql-general@lists.postgresql.org; Mon, 27 Jan 2020 16:10:20 +0000 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iw6xu-0007BW-GW for pgsql-general@lists.postgresql.org; Mon, 27 Jan 2020 16:10:19 +0000 Received: by mail-oi1-x244.google.com with SMTP id 13so7102708oij.13 for ; Mon, 27 Jan 2020 08:10:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=0o7Y4BUfeItAVNqgyvrLCE5fZ2oQCZ0iQ/IUCRRbL+M=; b=nK6oFGZn07cxFxNrU0YmhCI3QpPBIqna+/fgLl+074xMdBeM0/u4uyETU/h9eYE92c OdglH1neRMrvw2AjmLE1bGtHISvZB0FwY9xo3jsjhEsPP6j4Q+8/7Jx2GIBmrsVc0PYV QNNfCUfNwy63TptkB32xFrWjfm4I/jNk2/r4bfM86+GgeVfvS5JcfTrXcsqyZih6UpsQ zbtUw3jYam4pNQUET2VR/IP4yqQAZRz+ByK6GRf2FFZfqWWIIc/YaWiE7KvNMy0uY/pE hzyyerArjCYnvZCiQkRQ2HSum5RAsg8aY5w0xOEsCloCnEDuHT9NpB80O7ZhTF0NUWhI ApNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=0o7Y4BUfeItAVNqgyvrLCE5fZ2oQCZ0iQ/IUCRRbL+M=; b=PY9hUNm1A/hBcyLoWzQJkXd9cEaqNWy+KN4b+6dxZbCiIqb1jFmtaqg1t28N14irhz +I3FBAyABPY4iMoc1PSIDcOQyGelfMsyxXhSG+iV/PeCMLfrNcCFKA+IS8CEpfaJYnt1 vgnei2CvO03WE59khbC0pMERIyYN4aTLDPArX1ijNM6Hq2dBfHa0ko/UVHJF9Nk1H7k6 FmsdavX1PAzhmW9s2sbWv6pklVnoq0WaccyPt0N6h+z+vhxA/6cG0EX62VLPu+MnTfL3 100MpU68zaRK8HQpFsRL0q3YrZwmlV0LuWYnAkdIaseG1nM/3TW3yqdNnKt5jhPQhc6d 2coA== X-Gm-Message-State: APjAAAXlesjusWlbz+0WSP2xBzUI6jLmfij3FtN7n/Sg+QFvl1NHqMlY 4ZnmINSO2mpiLuIKUHaRlprjxlXjLfo= X-Google-Smtp-Source: APXvYqzwaocA+pFDq+laQnSTeHbtFl+6hxsbo+vqZAXkWIs2ssIqj/epaP1o9VZjPjn1sAhumGWc1Q== X-Received: by 2002:a05:6808:312:: with SMTP id i18mr8031857oie.44.1580141417603; Mon, 27 Jan 2020 08:10:17 -0800 (PST) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id d24sm2208352otf.66.2020.01.27.08.10.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jan 2020 08:10:17 -0800 (PST) Subject: Re: temporary data after diskspace error To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: <17ed219d-b0bd-dead-2004-834d7abd6721@gmail.com> Date: Mon, 27 Jan 2020 10:10:16 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/27/20 10:05 AM, Willy-Bas Loos wrote: > Hi, > > We have a server with postgresql 9.4.12 on ubuntu. > There has been a sudden rise in the amount of disk space used by > postgresql, causing a diskspace error: > > 2020-01-22 17:24:37 CET db: ip: us: PANIC:  could not write to file > "pg_xlog/xlogtemp.23346": No space left on device > 2020-01-22 17:24:37 CET db: ip: us: LOG:  WAL writer process (PID 23346) > was terminated by signal 6: Aborted > 2020-01-22 17:24:37 CET db: ip: us: LOG:  terminating any other active > server processes > > The disk was at roughly 75% before and something or someone added  150 GB > to the database, bringing the disk space usage to 100%. > The query that got the initial error was creating a rather large table, > but it is not confirmed that this is the only source of the large-ish data > amount. But it is possible. > > Now i can see in pg_stat_database and postgresql/9.4/main/base/pgsql_tmp > that there is 90GB of temporary files in the database. > > Could the amount of temp files be caused by the unfinished query? I'm not > sure how strong Signal 6 is exactly. > > And also: How can i make postgres clean up the files? > Can it be done without restarting the cluster? > Will restarting it help? Restarting postgresql clears out pgsql_tmp.  "pg_ctl restart -D ..." should be all you need. -- Angular momentum makes the world go 'round.