Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YWY0F-0000Ux-I1 for pgsql-admin@arkaria.postgresql.org; Fri, 13 Mar 2015 22:24:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YWY0E-0004De-NY for pgsql-admin@arkaria.postgresql.org; Fri, 13 Mar 2015 22:24:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YWY0D-0004DU-Jr for pgsql-admin@postgresql.org; Fri, 13 Mar 2015 22:24:21 +0000 Received: from mail-yk0-x233.google.com ([2607:f8b0:4002:c07::233]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YWY0A-00053w-GO for pgsql-admin@postgresql.org; Fri, 13 Mar 2015 22:24:19 +0000 Received: by ykq142 with SMTP id 142so11849693ykq.7 for ; Fri, 13 Mar 2015 15:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=m/7IAid8LjuirUyu7vs8LKKNf7LiH82IEgikbD8bVzc=; b=kIEgIE4fAquahm9RSnouZub5WWd+6SuOJtwbgdo+r8UOd0oyeJ7YF3EYraIUfkOC8T BNV8CJERA+ZgGu5SLGDtHe97Ay3Ey4/LIvotz73rr8eVkMOp/l5qdAbvtjDzVLznL+2M gaTlrKhCFkC3fSQMIX+ftj3auy0Qw79bn/sizj2f34Fs+Rvz9OKQzwhZJpMRp5aUHcnq O8YTiApp4ElXV3IoH0X9YD33RaiKhSW1YZdBERL36FPHWXl23Fa+JxHMdO0RjJjjDAZO H3cEjsag86gYb+GigxAZhIxetXgLWVpGCrsWy8F/Ze6LPtSTLz1143UtK71h8BIgRzFh R0sg== X-Received: by 10.236.228.35 with SMTP id e33mr12980082yhq.168.1426285457397; Fri, 13 Mar 2015 15:24:17 -0700 (PDT) Received: from [192.168.254.3] (h77.89.102.166.static.ip.windstream.net. [166.102.89.77]) by mx.google.com with ESMTPSA id o48sm2675613yhb.56.2015.03.13.15.24.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Mar 2015 15:24:16 -0700 (PDT) Message-ID: <5503638E.1090601@gmail.com> Date: Fri, 13 Mar 2015 18:24:14 -0400 From: John Scalia User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Aniko Belim , pgsql-admin@postgresql.org Subject: Re: standby parallel backup References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Is there some reason that you can't use pg_basebackup? It's much faster than pg_dump, like a couple of orders of magnitude. It also allows you to specify how many threads to want to speed it up. On 3/13/2015 5:26 PM, Aniko Belim wrote: > Hi, > > We are currently backing up our PostgreSQL 9.4 standby databases with pg_dump using file method. Now we need to change the method to using directory backup with parallel option > to make the backup faster. > > But we get the following error: > ERROR: cannot assign TransactionIds during recovery > STATEMENT: SELECT pg_export_snapshot() > > I assume that the problem occurs because it want to use export_snapshot() to ensure that all parallel connections of the dump will see the same snapshot, but can't because the > standby is read-only. > > Is there a workaround for this problem? > We found the --no-synchronized-snapshots option of pg_dump for a possible solution, which allows the backup to succeed, but I'm concerned about the consistency of the backup. I > did some test with it, and it looks like I only need to ensure that no changes made while the connections of the parallel threads occur, not during the whole backup (which could > cause a large lag in replication). Would it be safe to pause and resume replication only for that few seconds? > > Or is there any other good solution for backing up hot standby with pg_dump using the parallel directory method while this bug fixed? (We found this error reported in 2013, and > it looks like isn't fixed yet.) > > Thank you! > Aniko > -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin