Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ye7jZ-0004fJ-NV for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Apr 2015 19:58:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Ye7jZ-0004qR-7F for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Apr 2015 19:58:29 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YdyCF-0005WV-Qk for pgsql-bugs@postgresql.org; Fri, 03 Apr 2015 09:47:28 +0000 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YdyCC-0006mJ-7D for pgsql-bugs@postgresql.org; Fri, 03 Apr 2015 09:47:25 +0000 Received: by wixm2 with SMTP id m2so70677426wix.0 for ; Fri, 03 Apr 2015 02:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:organization:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=fHIzP59vmMz7H3vUE/NKsBHbV90lM0Zc1sWWKLnkOds=; b=R0KVbKS1xQbE8lI8KptCvQBKB23fqepoyKHj8cb8Dd7ad1/J5XxGKke1A91vWg1QGi HvYwiEw96qIW9lIro4ZfjFonqjTAdz5QIS+0i1dNJs2hagIoXTC2uCH3OEu76vrm1Mh2 DgBs48UAi23swWmVS2pvJZVN8oULjlVL7nSbp22cthf43krVzKyGB1Dq7iRao7R2Zpm+ a4PkiltVWH0t+W4ROh2rUEsmrpz4Xo8cn/vehzSGvK3J1rpQtgfrBjqlEC/E1El/ykER ukf4FHohl9kg8eBZegqgvX+owGKDx0nAzWikwLM6U3I9bCqdssgjvFSuUo2VTdnozTcO GNEA== X-Received: by 10.194.8.99 with SMTP id q3mr3312332wja.88.1428054442750; Fri, 03 Apr 2015 02:47:22 -0700 (PDT) Received: from [192.168.1.7] ([92.247.26.34]) by mx.google.com with ESMTPSA id ed14sm2010742wic.11.2015.04.03.02.47.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Apr 2015 02:47:21 -0700 (PDT) Message-ID: <551E61A8.8080600@gmail.com> Date: Fri, 03 Apr 2015 12:47:20 +0300 From: Peter Slavov Organization: sumup User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Icedove/36.0 MIME-Version: 1.0 To: Andres Freund CC: pgsql-bugs@postgresql.org Subject: Re: BUG #12910: Memory leak with logical decoding References: <20150327094757.2488.58808@wrigleys.postgresql.org> <20150331144048.GL4878@alap3.anarazel.de> In-Reply-To: <20150331144048.GL4878@alap3.anarazel.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hi I tried to do a backtrace, but I have nothing useful there. Only lines like this: Program received signal SIGUSR1, User defined signal 1. Detaching after fork from child process 13074. Detaching after fork from child process 13077. Detaching after fork from child process 13083. Detaching after fork from child process 13087. Detaching after fork from child process 13093. Detaching after fork from child process 13100. Detaching after fork from child process 13105. Detaching after fork from child process 13109. Detaching after fork from child process 13115. Detaching after fork from child process 13119. And the process fails again with: WARNING: terminating connection because of crash of another server process DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. HINT: In a moment you should be able to reconnect to the database and repeat your command. CONTEXT: slot "peshka", output plugin "test_decoding", in the change callback, associated LSN D0/F66B52C8 server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. connection to server was lost Peter Slavov На 31.03.2015 в 17:40, Andres Freund написа: > Hi, > > On 2015-03-27 09:47:57 +0000, pet.slavov@gmail.com wrote: >> I am trying to use logical decoding to replay the data modifying queries on >> a different server, to synchronize some of the tables. The primary server >> has some load, but not so much. I am getting the changes with >> pg_logical_slot_get_changes limiting the changes to 50 at a time. > That's generally not a very good idea. It's much better to use the > streaming interface. Repeatedly starting/stopping a logical slot (as the > SQL interface has to do every time) isn't all that efficient. > >> At some point pg_logical_slot_get_changes queries become slow and starts to >> eat all the ram and swap, which eventually kills the primary database with >> this error: >> FATAL: the database system is in recovery mode. > That indicates a crash. Please check the server log for any details? If > it crashes, could you perhaps get a backtrace? > > What output plugin are you using? > >> The nature of changes on the primary can have a lot of data in one >> transaction. Which I guess is the reason of the slow >> pg_logical_slot_get_changes. > In that case changes should just be spooled to disk. > > Greetings, > > Andres Freund -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs