Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqDmA-0002N5-Kt for pgsql-bugs@arkaria.postgresql.org; Fri, 08 Sep 2017 07:32:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dqDm9-0000Jw-NE for pgsql-bugs@arkaria.postgresql.org; Fri, 08 Sep 2017 07:32:29 +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 1dqDm8-0000I6-Vq for pgsql-bugs@postgresql.org; Fri, 08 Sep 2017 07:32:29 +0000 Received: from mail-vk0-x234.google.com ([2607:f8b0:400c:c05::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dqDm1-0006NV-E2 for pgsql-bugs@postgresql.org; Fri, 08 Sep 2017 07:32:28 +0000 Received: by mail-vk0-x234.google.com with SMTP id o22so2544545vke.1 for ; Fri, 08 Sep 2017 00:32:21 -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=I4U+rt8W2yR4gEN+oZS5OR1zRYf7HGm/1L6jn/YHJ0s=; b=MehQhFd2+B0Uf/Ey4ZIhEYuybHE+wp79g2YgCSiyV8IZ6X6kpbK3txV2BCTEeOgPFe UW3gexFo5kpqJpYmVA6JwENs2aZcbZrZP9L8DRGV3Rl4qkZp65KmEXOhhOx3tlZvippJ zqq9AVuWD0NGfsQbMXnQN5lLuhFhXzlfeXla5I4NV8woat2wbzhC6pqrJW7o+LPFy2mc jgRJ8v8nYOCML9AhvcQjh5ZopR5TIgJh/MFowflsv7beqGAlLer35QaFE3aWriWGhiFL Rs2psyyTZ/6JhKjwLJWPDJxXqDezHO3fD56oafu1LoX1f+bOsNmho/WMbUk2DSL90gfI 4jug== 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=I4U+rt8W2yR4gEN+oZS5OR1zRYf7HGm/1L6jn/YHJ0s=; b=h9Vsy0EDToZiM9Tk6LqhuyZVFWoOmn+G7a8BzU3UIcjPNYq39N2RX90DILV2wKbczG 3E2bzEFb2wyZM9vDZ6i5++CfHNRTKVxUAIag4s5kEtq9z5ZTb8y5j2k6kXoXpwHMCGp4 snF39l1BHED86VEMFa+8CXkfq/xh5QZ2xwJfByUc8iVicxH6ogR/shBqB7wX5n9Ysiip uf+109KHl180+Yy5KEcA/Y+YAIHDmMmTssJsn298kJ6Ie0IypUS3H5esZOPsGqotCUJp dcu5SJaCn4COTCcqpxiZ8lJjsrK7NUo/pfNimenlFipYHpNRinAO8uWSwyLGmAxSKLjk bAYw== X-Gm-Message-State: AHPjjUgqN4YMrk+ucM5Yzc3pvkrqs90WGHFD4YwQmGrTVy7+OYtBprs9 OHoHxCGP0od+K9QSVv/wFUrdDBDEtg== X-Google-Smtp-Source: AOwi7QD8irbw2v9/ejGqbyimOwRvV7mL3sl8RdIs2YzW5k9ZixILf/0PiT7PXZgADQVES18wS0GjzXECe60qYIYE53k= X-Received: by 10.31.252.69 with SMTP id a66mr1069645vki.33.1504855939231; Fri, 08 Sep 2017 00:32:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.150.139 with HTTP; Fri, 8 Sep 2017 00:32:18 -0700 (PDT) In-Reply-To: <20170907051056.25634.72330@wrigleys.postgresql.org> References: <20170907051056.25634.72330@wrigleys.postgresql.org> From: Michael Paquier Date: Fri, 8 Sep 2017 16:32:18 +0900 Message-ID: Subject: Re: BUG #14803: use receiverPtr as the endptr to call KeepLogSeg(endptr, &_logSegNo) in CreateRestartPoint To: bret.shao@outlook.com Cc: PostgreSQL mailing lists Content-Type: text/plain; charset="UTF-8" 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 On Thu, Sep 7, 2017 at 2:10 PM, wrote: > when call KeepLogSeg to get the oldest xlog file in function > CreateRestartPoint, > I think the endptr shoule be the repalyPtr not the later one of receiverPtr > and replayPtr. > endptr = (receivePtr < replayPtr) ? replayPtr : receivePtr; > > Because that if the endptr is the receiverPtr, it means that may be the xlog > file that is being redo will be dropped. There are timeline-related things to consider, in short when doing a timeline jump you may finish with a segment that you did not expect to be recycled. See the link to the discussion and the commit in question: https://www.postgresql.org/message-id/50D30851.2030509%40vmware.com http://git.postgresql.org/pg/commitdiff/af275a12dfeecd621ed9899a9382f26a68310263 -- Michael -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs