Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7LTW-0007ky-IW for pgsql-hackers@arkaria.postgresql.org; Sun, 07 May 2017 12:39:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d7LTV-0002lt-Ij for pgsql-hackers@arkaria.postgresql.org; Sun, 07 May 2017 12:39:45 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d7LRy-0007zi-Ve for pgsql-hackers@postgresql.org; Sun, 07 May 2017 12:38:11 +0000 Received: from mail-yb0-x22b.google.com ([2607:f8b0:4002:c09::22b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d7LRv-0006r0-OJ for pgsql-hackers@postgresql.org; Sun, 07 May 2017 12:38:10 +0000 Received: by mail-yb0-x22b.google.com with SMTP id 8so6304586ybw.1 for ; Sun, 07 May 2017 05:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Nph+9Hq9RIvwT7D+q2/FF+kf9NovJDz2h14rUVxGEsw=; b=rJPI6hFeseiQdCySd5gKsR5ya51cyQZM9BBAP6czp7X+2x5PRUQkbX3ua+kCX1hyZ6 SO4bYiAEbJ9oLGOZhZcsqBFKO09gjTPwn2W6USSuVPudbiqA0uI6NyBz8BZrXMoyHmPO GfsSl4Aziqsyd0NAUDrMq+/srVyBmojltVCYSDqJUubM+6RUlAoHDkdqE6P3CkZaGacD vLIShY7Zu6JDKqJzq2tp+2irzRy1wFZbF/px0VJwp2PtklGgi+pFqs6ssnV4zGNkjFpz irb7z7MWIK48aUXvD8EfiKKPjxr90ANPbK6uOMFheHtDeMu2mA18iIQHSvyc82mU5X2P zmrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Nph+9Hq9RIvwT7D+q2/FF+kf9NovJDz2h14rUVxGEsw=; b=c6ZWZFI4RBOW3Sdk3pExbb98g+I6d77Cjo3g8sGfmEaD/aoS0Fge/1BuZU0YevwO6E Yiu0pQlezjTQ4RkCb5BI7nDENy4+AGeCZwXkZEyomNwm4UXk237xzcxlm6fcI61LZPu9 L2b6TdmafQSCAHaVYFEX38yjAZJ38wwa+6n/t7yjFekN5hIYMBi6EfMNSZHEQQOCqQpR snvL9JusZotJTicZHiihAzpCo8VDrolLu/bQfk/l60/gKCKZYH7VPsIy1qCqohCIznVS ZiQbTiBvBg7dNp6y96hGdTNB3DUY28lO/+iqq6uqGtMozZNPluPD46foa8LbPL7p0jI0 L+gw== X-Gm-Message-State: AODbwcANAx1xN+pvUWPMu5Z3sGV7A4m/WXbW1fYh/bTDtUEozFg++QaT TVvWlzxaY42RvoUZbrIbqDo25gJ2+NZJ X-Received: by 10.37.47.215 with SMTP id v206mr6380413ybv.97.1494160685654; Sun, 07 May 2017 05:38:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.171.208 with HTTP; Sun, 7 May 2017 05:38:05 -0700 (PDT) In-Reply-To: <20170507000126.gnnifm7jywxc5eg6@alap3.anarazel.de> References: <20170505012447.wsrympaxnfis6ojt@alap3.anarazel.de> <20170507000126.gnnifm7jywxc5eg6@alap3.anarazel.de> From: Michael Paquier Date: Sun, 7 May 2017 21:38:05 +0900 Message-ID: Subject: Re: Change GetLastImportantRecPtr's definition? (wasSkip checkpoints, archiving on idle systems.) To: Andres Freund Cc: PostgreSQL mailing lists Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org (catching up here) On Sun, May 7, 2017 at 9:01 AM, Andres Freund wrote: > Turns out this isn't the better fix, because the checkpoint code > compares with the actual record LSN (rather than the end+1 that > XLogInsert() returns). We'd start having to do more bookkeeping or more > complicated computations (subtracting the checkpoint record's size). > Therefore I've pushed the simple fix mentioned above instead. Yeah, I have spent some time looking at many details for this stuff... And using a start LSN location was way easier for the checkpoint skip checks. e6c44ee looks good to me, except that I would complete this comment block in xlog.c: * updated for all insertions, unless the XLOG_MARK_UNIMPORTANT flag was * set. lastImportantAt is never cleared, only overwritten by the LSN of newer * records. Tracking the WAL activity directly in WALInsertLock has the * advantage of not needing any additional locks to update the value. */ By just mentioning that the lastImportantAt is updated to the *start* LSN position of an important record. This will help in avoiding future confusions. It turns out that fixing this issue only on HEAD has been a good choice. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers