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 1gsaSk-0006fq-1k for pgsql-general@arkaria.postgresql.org; Sat, 09 Feb 2019 21:47:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gsaSg-0005Y7-IK for pgsql-general@arkaria.postgresql.org; Sat, 09 Feb 2019 21:46:58 +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 1gsaSg-0005Y0-3a for pgsql-general@lists.postgresql.org; Sat, 09 Feb 2019 21:46:58 +0000 Received: from mail-it1-x141.google.com ([2607:f8b0:4864:20::141]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsaSc-0000TA-8f for pgsql-general@postgresql.org; Sat, 09 Feb 2019 21:46:56 +0000 Received: by mail-it1-x141.google.com with SMTP id b5so17727901iti.2 for ; Sat, 09 Feb 2019 13:46:53 -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:content-transfer-encoding:in-reply-to :user-agent; bh=XpVyhsmiiS8xALMqY5Tadldg9oJfJo0m+fHMbfY8P/I=; b=2OufIY3QKoCZYlj8puIBdhLLy2P445AWY3pvZCnzbTl1AJzZQvZGWxYVVvedSYCjMK WaNfx5HOQCwu45Zu9bggv2Pb/DVCtVognwdZcHatsUAojDcu6J08dqCN77yR7MGtfHYv y5D1+QYOJU2ULqwlkRfsm62W2xq8vijoPVJ9FFeuLoQW5/Hk1nM9c4KFr0nfbRAJCM9v xEWvJbqsgJ+QekoBkep6AtYtija9XlMG7ECb7E7q5VUoMhJMXDPoJCBVhZ2c8FrHtu59 NQIUpREJzGb27FEEyITYMewBwqMshYyIiMHQgL6R/4s7rgXNB/ISQt5Vz8Adm9o46C/z pC8Q== 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:content-transfer-encoding :in-reply-to:user-agent; bh=XpVyhsmiiS8xALMqY5Tadldg9oJfJo0m+fHMbfY8P/I=; b=rhzzxyoWO3XC9sTcaVu9y9GHuuoCYh92jCXyw33+vmhYxZJ3ZFM9DkPJKFnKNumeRJ NTnasSbMGt+1pkUZ9nzedl1lIQYXkVjrS4ozyOx/AGvtMZpO1A5QQ19ZLUTunwQhbIdU 2COK6fctsn3QmfQPmJ35liAlpjrGb0h9qhd3qIXwH2RtCrYABG3Bd1OKkLK/pxISFgDw Qg7g82KM2Sb1Pb6foh9pEVONnKSr9pr/Hu95nuKBDCH+jRTZnJajUU8ROCf5SXjvLLlk Tp1raISfuMtUsYHcBjjjWex4DmW/HsLZvxLpZ1FmXiSxaCt211pRHStRaZwh3sUP8Q/o jp/Q== X-Gm-Message-State: AHQUAuZanO1EOeHUAoEfizg2phs2ghbmPdv4my1qjVkdRNqTZuaP4x4q nd9QKgZ820JNC5koFox5oWqh5lnzuMY= X-Google-Smtp-Source: AHgI3Ibn5Km7aFrYkhIc123owvCehMJpLXCn379octDStdi9Va3eYHow2VXdPyUeREYI7tBAjqxRhg== X-Received: by 2002:a6b:b4cf:: with SMTP id d198mr13392227iof.96.1549748813228; Sat, 09 Feb 2019 13:46:53 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id p16sm2460233iob.85.2019.02.09.13.46.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Feb 2019 13:46:52 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 5BC9B800BD7; Sat, 9 Feb 2019 15:46:51 -0600 (CST) Date: Sat, 9 Feb 2019 15:46:51 -0600 From: Justin Pryzby To: PegoraroF10 Cc: pgsql-general@postgresql.org Subject: Re: Server goes to Recovery Mode when run a SQL Message-ID: <20190209214651.GP31721@telsasoft.com> References: <1549209182255-0.post@n3.nabble.com> <1549209942200-0.post@n3.nabble.com> <1549660293178-0.post@n3.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1549660293178-0.post@n3.nabble.com> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On Fri, Feb 08, 2019 at 02:11:33PM -0700, PegoraroF10 wrote: > *Well, now we have two queries which stops completelly our postgres server. > That problem occurs on 10.6 and 11.1 versions. > On both server the problem is the same. > Linux logs of old crash are:* > Feb 1 18:39:53 fx-cloudserver kernel: [ 502.405788] show_signal_msg: 5 > callbacks suppressedFeb 1 18:39:53 fx-cloudserver kernel: [ 502.405791] > postgres[10195]: segfault at 24 ip 0000555dc6a71cb0 sp 00007ffc5f91db38 > error 4 in postgres[555dc69b4000+6db000] "segfault" seems to mean you hit a bug, which we'll want more information to diagnose. Could you install debugging symbols ? Ubuntu calls their package postgresql-10-dbg or similar. And start server with coredumps enabled, using pg_ctl -c -D /var/lib/postgresql/10/main (or similar). Then trigger the query and hope to find a core dump in the data directory. Or possibly it'll be processed into /var/crash by apport daemon, depending if that's running and enabled (check /proc/sys/kernel/core_pattern). https://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Linux/BSD#Getting_a_trace_from_a_randomly_crashing_backend > *Linux Log of new crash, which takes several minutes to stop:* > Feb 8 15:06:40 fxReplicationServer kernel: [1363901.643121] postgres > invoked oom-killer: gfp_mask=0x24280ca, order=0, oom_score_adj=0Feb 8 > fxReplicationServer kernel: [1363901.643368] Killed process 9399 (postgres) > total-vm:16518496kB, anon-rss:11997448kB, file-rss:38096kBFeb 8 17:21:16 > fxReplicationServer kernel: [1371977.845728] postgres[10321]: segfault at 10 > ip 00005567a6069752 sp 00007ffed70be970 error 4 in In this case, you ran out of RAM, as you noticed. You should make sure ANALYZE statistics are up to date (including manually ANALYZEing any parent tables). On Sun, Feb 03, 2019 at 09:05:42AM -0700, PegoraroF10 wrote: > IŽm using Postgres 10 on ubuntu in a Google VM (8 cores, 32Gb RAM, 250Gb SSD) > and DB has 70GB What is work_mem setting ? You could try running the query with lower work_mem, or check EXPLAIN ANALYZE and try to resolve any bad rowcount estimates. > *This query runs for aproximately 5 minutes. See link above with images and > logs and youŽll see how memory will grow. Memory use starts with 8gb e grows > until use them all. When all memory is in use then it starts to swap. When > all swap is allocated then it gets the "out of memory" and stops > completelly. > on: https://drive.google.com/open?id=18zIvkV3ew4aZ1_cxI-EmIPVql7ydvEwi* It says "Access Denied", perhaps you could send a link to https://explain.depesz.com/ ? Justin