Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jBHo4-00070l-94 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Mar 2020 12:46:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jBHo1-00058q-Tq for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Mar 2020 12:46:49 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1jBHo1-00058j-GK for pgsql-hackers@lists.postgresql.org; Mon, 09 Mar 2020 12:46:49 +0000 Received: from cyclops.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jBHnt-00032a-VI for pgsql-hackers@postgresql.org; Mon, 09 Mar 2020 12:46:48 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 710A421C1FC0; Mon, 9 Mar 2020 15:46:40 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from ars-thinkpad (nat03-43-2.netorn.net [188.35.130.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 3A80F21C0587; Mon, 9 Mar 2020 15:46:40 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1583758000; bh=6Wa5+XAmOdwwuxrawGtB6pQ4wD/y+2BIV+/6puFDvuk=; h=References:From:To:Cc:Subject:In-reply-to:Date; b=G/YgyDTzTi9/Vn/G0OTuSpbozHCo5dq7XDCF6futLd/S0cANmnLJlRDC4IuJ9B4VN YC83S+hIWmAQIKZ1s1yyTFLqsDv9Ox/ms3pAOKSAFN09Ep3WVO6u2zMNNRRLVFY/eF FjkNaF8fqdonBUR9QJDGhnBpwlwNeKgZAImNNEdE= References: <871rr3ohbo.fsf@ars-thinkpad> <87v9oelex6.fsf@ars-thinkpad> <87k1406sj7.fsf@ars-thinkpad> <87imjh7nky.fsf@ars-thinkpad> User-agent: mu4e 1.2.0; emacs 26.0.50 From: Arseny Sher To: Masahiko Sawada Cc: PostgreSQL Hackers , Alvaro Herrera Subject: Re: logical copy_replication_slot issues In-reply-to: Date: Mon, 09 Mar 2020 15:46:39 +0300 Message-ID: <87h7yx7l1s.fsf@ars-thinkpad> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Masahiko Sawada writes: > /* > - * Create logical decoding context, to build the initial snapshot. > + * Create logical decoding context to find start point or, if we don't > + * need it, to 1) bump slot's restart_lsn and xmin 2) check plugin sanity. > */ > > Do we need to numbering that despite not referring them? No, it just seemed clearer to me this way. I don't mind removing the numbers if you feel this is better. > ctx = CreateInitDecodingContext(plugin, NIL, > - false, /* do not build snapshot */ > + false, /* do not build data snapshot */ > restart_lsn, > logical_read_local_xlog_page, NULL, NULL, > NULL); > I'm not sure this change makes the comment better. Could you elaborate > on the motivation of this change? Well, DecodingContextFindStartpoint always builds a snapshot allowing historical *catalog* lookups. This bool controls whether the snapshot should additionally be suitable for looking at the actual data, this is e.g. used by initial data sync in the native logical replication. -- cheers, arseny