Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQhMj-0002St-N9 for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Apr 2013 17:02:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UQhMi-0008FU-Pk for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Apr 2013 17:02:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQhMd-0008BW-Hk for pgsql-bugs@postgresql.org; Fri, 12 Apr 2013 17:02:15 +0000 Received: from smtp-out.neti.ee ([194.126.106.74]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQhMa-0004TW-JH for pgsql-bugs@postgresql.org; Fri, 12 Apr 2013 17:02:15 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-relay5.estpak.ee (Postfix) with ESMTP id CE692855; Fri, 12 Apr 2013 20:02:11 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at vm-relay5.estpak.ee Received: from smtp-out.neti.ee ([127.0.0.1]) by localhost (vm-relay5.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yFnjZek8nPV5; Fri, 12 Apr 2013 20:02:08 +0300 (EEST) Received: from mail.neti.ee (neti-relayhost2.estpak.ee [88.196.174.199]) by vm-relay5.estpak.ee (Postfix) with ESMTP id D23604D6; Fri, 12 Apr 2013 20:02:08 +0300 (EEST) Received-SPF: Neutral (access neither permitted nor denied) identity=mailfrom; client-ip=90.191.172.75; helo=[172.16.1.18]; envelope-from=tarvip@gmail.com; receiver=andres@2ndquadrant.com X-SMTP-Auth-NETI-Businessmail: no Received: from [172.16.1.18] (75.172.191.90.dyn.estpak.ee [90.191.172.75]) by NETI-Relayhost2.estpak.ee (Postfix) with ESMTP id C970F4D6; Fri, 12 Apr 2013 20:02:07 +0300 (EEST) Message-ID: <51683E0F.60001@gmail.com> Date: Fri, 12 Apr 2013 20:02:07 +0300 From: Tarvi Pillessaar User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Andres Freund CC: pgsql-bugs@postgresql.org Subject: Re: BUG #8059: sequence crash recovery is not working properly References: <20130412140416.GF5766@alap2.anarazel.de> In-Reply-To: <20130412140416.GF5766@alap2.anarazel.de> Content-Type: multipart/alternative; boundary="------------040600010405040909040909" X-Pg-Spam-Score: -0.2 (/) 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 This is a multi-part message in MIME format. --------------040600010405040909040909 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 12.04.2013 17:04, Andres Freund wrote: > On the other hand, at > least in the first example you haven't even committed the transaction so > there's nothing that could flush the transaction unless we we would > *always* flush nextval() immediately if needs to get new values which > doesn't seem reasonable. Yes, i know that i haven't commited anything and also i agree that flushing always is not reasonable. I'm not sure that i understand all the details in sequence.c, but there seems to be some sort of cache used for sequences, so instead of flushing always maybe flush should only happen if next batch of values are written to cache. Regards, Tarvi Pillessaar --------------040600010405040909040909 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 12.04.2013 17:04, Andres Freund wrote:
On the other hand, at
least in the first example you haven't even committed the transaction so
there's nothing that could flush the transaction unless we we would
*always* flush nextval() immediately if needs to get new values which
doesn't seem reasonable.
Yes, i know that i haven't commited anything and also i agree that flushing always is not reasonable.
I'm not sure that i understand all the details in sequence.c, but there seems to be some sort of cache used for sequences, so instead of flushing always maybe flush should only happen if next batch of values are written to cache.

Regards,
Tarvi Pillessaar
--------------040600010405040909040909--