Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t1QF0-00GE1T-5o for pgsql-docs@arkaria.postgresql.org; Thu, 17 Oct 2024 13:08:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t1QEx-004ZMn-Mo for pgsql-docs@arkaria.postgresql.org; Thu, 17 Oct 2024 13:08:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t1QEx-004ZKX-Cr for pgsql-docs@lists.postgresql.org; Thu, 17 Oct 2024 13:08:31 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t1QEv-001XRP-24 for pgsql-docs@lists.postgresql.org; Thu, 17 Oct 2024 13:08:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2024011501; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=OGpeKG7Xbpn5zwbTJx7O/22AYE30asBy/fxDpQl4wHM=; b=kiY4T CydeiPPeTCz5FBp4l37T1TKNmOwmD0a53Lm1VCgLaEQ7MxIsfpiYU4rRAQlAZJursN/l7I0e661Bd t2lXNwMu8uupct6jnZ7ix9HeE7u125LBuvo02t6Zcx/pQTw/uIQ4kZAe9uskom0JQ+PnBADh4xbRH F48aOxST13iqELrBXC7nuRdQxnV27vF2eiYg1dCIbWsUp7r4t7xZkZf/2x+UQVCMryd26GIT4iscx v5O+o2pSQI6zL364rN57Sx7BSfVzyMD5zhQz99s3G5xISFxnMA+WH1sPhm5RQZv+U80V8oph7LvcQ C4HT7AjMjbC6M6HEtE8dgSO5zLTKg==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1t1QEs-001Zks-2N; Thu, 17 Oct 2024 09:08:26 -0400 Date: Thu, 17 Oct 2024 09:08:26 -0400 From: Bruce Momjian To: Koen De Groote Cc: pgsql-docs@lists.postgresql.org Subject: Re: Logical replication - initial data synchronization Message-ID: References: <171606613152.686.7693963105919927503@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="+yArCcJO6UQzv0fr" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --+yArCcJO6UQzv0fr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 17, 2024 at 10:59:51AM +0200, Koen De Groote wrote: > Hello Bruce, thanks for picking this up. > > Personally, I would make explicit mention of the fact that creating the > snapshot and copying the data is taken care of by Postgres itself. Those are > the points that had me confused early on, wondering if I had to perform the > copy once the snapshot was ready. Updated patch attached. I tried to tighten up the wording and add more detail. I didn't see the point in repeating the same paragraph later on so I removed it. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com When a patient asks the doctor, "Am I going to die?", he means "Am I going to die soon?" --+yArCcJO6UQzv0fr Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="logical.diff" diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml new file mode 100644 index 98a7ad0..f104125 *** a/doc/src/sgml/logical-replication.sgml --- b/doc/src/sgml/logical-replication.sgml *************** *** 24,33 **** ! Logical replication of a table typically starts with taking a snapshot ! of the data on the publisher database and copying that to the subscriber. ! Once that is done, the changes on the publisher are sent to the subscriber ! as they occur in real-time. The subscriber applies the data in the same order as the publisher so that transactional consistency is guaranteed for publications within a single subscription. This method of data replication is sometimes referred to as transactional replication. --- 24,34 ---- ! When logical replication of a table typically starts, a snapshot is ! taken of the table's data on the publisher database and copied to the ! subscriber. Once complete, changes on the publisher since the initial ! copy are sent continually to the subscriber. The subscriber applies ! the data in the same order as the publisher so that transactional consistency is guaranteed for publications within a single subscription. This method of data replication is sometimes referred to as transactional replication. *************** *** 165,171 **** The individual tables can be added and removed dynamically using ALTER PUBLICATION. Both the ADD TABLE and DROP TABLE operations are ! transactional; so the table will start or stop replicating at the correct snapshot once the transaction has committed. --- 166,172 ---- The individual tables can be added and removed dynamically using ALTER PUBLICATION. Both the ADD TABLE and DROP TABLE operations are ! transactional, so the table will start or stop replicating at the correct snapshot once the transaction has committed. *************** CONTEXT: processing remote data for rep *** 1953,1967 **** Architecture - Logical replication starts by copying a snapshot of the data on the - publisher database. Once that is done, changes on the publisher are sent - to the subscriber as they occur in real time. The subscriber applies data - in the order in which commits were made on the publisher so that - transactional consistency is guaranteed for the publications within any - single subscription. - - - Logical replication is built with an architecture similar to physical streaming replication (see ). It is implemented by walsender and apply --- 1954,1959 ---- --+yArCcJO6UQzv0fr--