Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHh0Z-00055d-PL for pgsql-general@arkaria.postgresql.org; Mon, 05 Jun 2017 01:40:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dHh0Y-0002Fq-82 for pgsql-general@arkaria.postgresql.org; Mon, 05 Jun 2017 01:40:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dHgy8-0006IE-IV for pgsql-general@postgresql.org; Mon, 05 Jun 2017 01:38:08 +0000 Received: from mail-yw0-x22f.google.com ([2607:f8b0:4002:c05::22f]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dHgy5-0007ii-NN for pgsql-general@postgresql.org; Mon, 05 Jun 2017 01:38:07 +0000 Received: by mail-yw0-x22f.google.com with SMTP id l75so10595313ywc.3 for ; Sun, 04 Jun 2017 18:38:05 -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=0ZjqTVU3NizzTCWPQOh/gTBDs8r5t8yvxSz83IQBFfM=; b=vNiXyfEg5VQtqY6hANbcglqKrbzk/ODObcglSPvEXv0Soh7KWkb+F3CdNclkePV1CW RgsvgRZ37gk9I2F0ZS4zkiz6iid1MIJahBxi01HEs7t/PghPA8zUrzHzUEw02itd0meO GNXKy0xitoZcELeiNhbt88+oprwszx3wPhV4Wls1qG4GcGt1Jnlptm7WaMj7qB3kEr9b fMhcH1c9GierHrfSs0KUrbOzrsGl7sRdSJdQBwLeB1udp0k2uBK7zXcbkojT34Aii6SW 9n+CgAkQ2+Z7BEJ1NhUMJbmMOquRXtk6rEoNykUVAJ6heOZGxMZy5aukNkPNQDoxzPRP F9wg== 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=0ZjqTVU3NizzTCWPQOh/gTBDs8r5t8yvxSz83IQBFfM=; b=CCKo38bd656pX/UinvRq3ul9lpdB58PbewTmjG8ELdzVYqxIhYkFICrGhjWlaVTXPn 5qfr/gsHz7JKcJD355pLeCnIU3SAQFBUcxyJtHDLWlO2mOcfs5JmVBlrf2HHw66RJdO2 kKrd4ogc7I1Ra6Gpb8u7hlVMldN12wAHZl0z/C2CG/3wxC9nB/BD8FpTgSG1McByfab6 OlyUg+HmxfDsp+gkGS9W3fi3ld94VA3oG6a8IUOEbbVQzsb2IhE4BasSlIkbez/TpMBW N6Mjd+WBkm2JlqTVJT1SrCeFUCkEvvveQ5q0c1U7LdNUeXLmM/BjUs349M1RGXNDWsUU qcAQ== X-Gm-Message-State: AODbwcAArSjqAMCXT6yF+KBXzJaj0Hv+jkPHYlWAXbluuRHIu6VXmOXp dOO3rdhecEEfyv68CxSUsOhQhlFtdQ== X-Received: by 10.13.255.135 with SMTP id p129mr13587551ywf.261.1496626684882; Sun, 04 Jun 2017 18:38:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.198.77 with HTTP; Sun, 4 Jun 2017 18:38:04 -0700 (PDT) In-Reply-To: References: From: Michael Paquier Date: Mon, 5 Jun 2017 10:38:04 +0900 Message-ID: Subject: Re: pg_rewind - enable wal_log_hints or data-checksums To: Dylan Luong Cc: "pgsql-general@postgresql.org" Content-Type: text/plain; charset="UTF-8" X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On Mon, Jun 5, 2017 at 9:37 AM, Dylan Luong wrote: > pg_rewind requires that the target server either has the wal_log_hints > option enabled in postgresql.conf or data checksums enabled when the cluster > was initialized with initdb. Yes, this is to make sure that you don't finish with a corrupted target server if a hint bit is set on a page after a checkpoint. Any of those options make sure that a full-page write is generated in this case. > What is the difference between the two options? Data checksums calculate 2 bytes of checksum data and write it to each page that is evicted from shared buffers. Each page read from disk has its checksum checked. In some workloads, like a heavy read load where a lot of page evictions happen, this can induce a couple of percents of performance lost. In my own experience, that's 1~2%. > What are the advantages and disadvantages between the two? > Which one is the the preferred option? If you care more about performance or if you use a file system that has its own block-level checksum, wal_log_hints would be preferred. Data checksums offer more guarantees in terms of integrity though when looking for corrupted data. Things get found more quickly. -- Michael -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general