Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNLKd-0001zU-73 for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jun 2017 15:44:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dNLKb-0002tZ-Al for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jun 2017 15:44:41 +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 1dNLJ3-00005Q-E6 for pgsql-hackers@postgresql.org; Tue, 20 Jun 2017 15:43:05 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dNLJ0-0001Mn-M9 for pgsql-hackers@postgresql.org; Tue, 20 Jun 2017 15:43:04 +0000 Received: by mail-lf0-x244.google.com with SMTP id l200so3885881lfg.1 for ; Tue, 20 Jun 2017 08:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=XpViMFQ2+ELLJJ3TNle3HC9tQ1vgojCSUEniaIuCRhM=; b=LH8T5bFT1oUiD26huvLbA3YMuS4SwQwVIn3IC70qAetnk5xq2A/lixdYzX0vGuxQoh ZxhbBqtBKF1dvnY8pHmUnLH1B9a01H0kJJThD9gX7Boz2hNw+/nbu3fpf9rNqgc7UeUK 61PAXRWmGBqK8cRVQSHIilXJRGGWr+s4PNV/O/qWHt1VtqFLIALnyCf0jUpEOL9LFl11 L0K9zRSxENqnwtD1FEwAF5WWXUpiBcIamPUYMYB33ENwxB9Y4A/oFyy5SzC4n6dK7t9S nIlnjn7IZhpSTLDlVAsoCOI666stg/1+fKFg1kv1lZrIwLFDdeTubfxV3/6ylueNuczR 1beQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=XpViMFQ2+ELLJJ3TNle3HC9tQ1vgojCSUEniaIuCRhM=; b=SlzD1Q5rifTBzQCh3hKTg3g0UaXvWuGo4wFtZihFoZUn7X34YzdssxC9vOGcnxhoMq WIM2+EcW/M4AHeDbAkEONEtOrmPPPjhqbWmcyOL03hv3N9/sew91/rqri8OlQAb7IX4L Tgx9MqcnYSBSIoNzL0UCQswpIL1TQr+p70O8sDckB+FOorprwMV/ShSrr6ivugnAcmOt wYf1rRAlfQhSn5mm/CB2EtFjgkJG1WFPvA25vNRj+zWz5Juvwm8kANEgvFcIn6rhcUjX qUMkeptgGEn3myuYkol+ss+G6vfiJU3YbM/FIQeDV1uStALITHfTlFYN/uR1frtj+Zgb NJ7A== X-Gm-Message-State: AKS2vOyG+5naMjIb68t3lUW1gVksdChrRPV0ANJc81DW70dmCImh9Gzj xiBOdf1EKkNmBleo7W5X7g== X-Received: by 10.25.156.82 with SMTP id f79mr7167249lfe.4.1497973380739; Tue, 20 Jun 2017 08:43:00 -0700 (PDT) Received: from seb.koffice.internal (koffice.avito.ru. [195.151.206.25]) by smtp.gmail.com with ESMTPSA id z205sm3989575lfa.37.2017.06.20.08.42.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 08:42:59 -0700 (PDT) From: Sergey Burladyan To: Bruce Momjian Cc: PostgreSQL-development , Amit Kapila , Dmitriy Sarafannikov , Vladimir Borodin Subject: Re: Broken hint bits (freeze) References: <87mv98af8j.fsf@seb.koffice.internal> <20170616164641.GP11450@momjian.us> <87fuezalc3.fsf@seb.koffice.internal> <20170619222113.GF3180@momjian.us> <20170620025919.GA28277@momjian.us> <20170620033726.GB28277@momjian.us> <87h8zb6kbx.fsf@seb.koffice.internal> <20170620143643.GA24975@momjian.us> Date: Tue, 20 Jun 2017 18:42:58 +0300 In-Reply-To: <20170620143643.GA24975@momjian.us> (Bruce Momjian's message of "Tue, 20 Jun 2017 10:36:43 -0400") Message-ID: <871sqe7ji5.fsf@seb.koffice.internal> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 Bruce Momjian writes: > On Tue, Jun 20, 2017 at 01:10:26PM +0300, Sergey Burladyan wrote: > > Bruce Momjian writes: > > > > Uh, as I understand it the rsync is going to copy the missing WAL file > > > > from the new master to the standby, right, and I think pg_controldata > > > > too, so it should be fine. Have you tested to see if it fails? > > > > It need old WAL files from old version for correct restore heap > > files. New WAL files from new version does not have this information. > > > > > The point is that we are checking the "Latest checkpoint location" to > > > make sure all the WAL was replayed. We are never going to start the > > > old standby server. Rsync is going to copy the missing/changed files. > > > > Only if missing/changed files changed in size, because rsync run with > > --size-only it does not copy changed files with same size. > > I am sorry but I am not understanding. Step 10.b says: > > 10.b Make sure the new standby data directories do not exist > > Make sure the new standby data directories do not exist or are empty. If > initdb was run, delete the standby server data directories. > > so the _entire_ new data directory is empty before rsync is run, meaning > that it is an exact copy of the new master. Yes, new data directory at standby is empty, but you missed old data directory at standby which is hardlink'ed by rsync into new as at master. rsync run with _three_ arguments and with --hard-links option: rsync --archive --delete --hard-links --size-only old_pgdata new_pgdata remote_dir (remote_dir is parent directory for old and new data at standby) In this mode rsync compare not only new_pgdata with new empty data directory at standby, but also compare it with old data directory from standby and with --size-only it doing this compare only by the file existence or file size. If file at standby in old data directory is different from same file at master, but it have same size, it will be hardlinked into new data directory at standby and does not copied from master. -- Sergey Burladyan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers