Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwRM0-00008r-0I for pgsql-jdbc@arkaria.postgresql.org; Fri, 07 Apr 2017 10:42:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cwRLz-0007KU-7i for pgsql-jdbc@arkaria.postgresql.org; Fri, 07 Apr 2017 10:42:55 +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 1cwRLx-0007K0-GN for pgsql-jdbc@postgresql.org; Fri, 07 Apr 2017 10:42:53 +0000 Received: from m69-169.mailgun.net ([166.78.69.169]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cwRLq-0006fw-B9 for pgsql-jdbc@postgresql.org; Fri, 07 Apr 2017 10:42:51 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=github.com; q=dns/txt; s=mailo; t=1491561764; h=Content-Transfer-Encoding: Content-Type: Mime-Version: Subject: Message-ID: To: Reply-To: From: Date: Sender; bh=ZsfTb1kl7PdmyFtUnPoPaW95zzvRqTa5xjfwA+gSBzY=; b=rIWTh4yiP/y9zapd4K+sTLFLhPGBoBdfNx+EJ7i8BNDE91Rtkx6WdZvPDCJYNgkEmSoHAYBV WjVCUzwZOn+8t1NOu1ipUoDWOP5eSNQaYFpzxc94C1Vru1mIaTCDAshP6S95NsNktl7bPnjl aRKFo1cnqUI1bxXx+Ro/oTFoKA8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=github.com; s=mailo; q=dns; h=Sender: Date: From: Reply-To: To: Message-ID: Subject: Mime-Version: Content-Type: Content-Transfer-Encoding; b=RqDo1fGPwzfvL01llftuY+52Xzi1ADRwgw5azfGNEVf0x150wFThZt8KCqSI43qakNVQag ZxlQ50JKjRBu7TKEn2wA/0GHLM8YILMDFdV4BE0U2cSTOf7pSxI6RuGV/mjMZoeeBo8GhJWK nOYAt1yYyrnwMhHhqYnrrPjaC7vPw= X-Mailgun-Sending-Ip: 166.78.69.169 X-Mailgun-Sid: WyI3ZTA2ZSIsICJwZ3NxbC1qZGJjQHBvc3RncmVzcWwub3JnIiwgIjQwZiJd Received: from github.com (Unknown [192.30.252.41]) by mxa.mailgun.org with ESMTP id 58e76d24.7f21e7528c90-smtp-out-n02; Fri, 07 Apr 2017 10:42:44 -0000 (UTC) Date: Fri, 07 Apr 2017 03:42:44 -0700 From: Vladimir Gordiychuk Reply-To: Vladimir Gordiychuk To: pgsql-jdbc@postgresql.org Message-ID: <58e76d24a2e5_14413f893cf3fc3c17723c@hookshot-fe5-cp1-prd.iad.github.net.mail> Subject: [pgjdbc/pgjdbc] 170d9c: Bug: Not valid calculate lastReceiveLSN for logica... Mime-Version: 1.0 X-Pg-Spam-Score: -0.2 (/) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Branch: refs/heads/master Home: https://github.com/pgjdbc/pgjdbc Commit: 170d9c27810349456e56aff1c36a0ad6584b9e28 https://github.com/pgjdbc/pgjdbc/commit/170d9c27810349456e56aff1c36a0ad6584b9e28 Author: Vladimir Gordiychuk Date: 2017-04-07 (Fri, 07 Apr 2017) Changed paths: M pgjdbc/src/main/java/org/postgresql/core/v3/replication/V3PGReplicationStream.java M pgjdbc/src/main/java/org/postgresql/core/v3/replication/V3ReplicationProtocol.java A pgjdbc/src/main/java/org/postgresql/replication/ReplicationType.java M pgjdbc/src/test/java/org/postgresql/replication/LogicalReplicationStatusTest.java M pgjdbc/src/test/java/org/postgresql/replication/LogicalReplicationTest.java M pgjdbc/src/test/java/org/postgresql/replication/PhysicalReplicationTest.java Log Message: ----------- Bug: Not valid calculate lastReceiveLSN for logical replication (#801) * Bug: Not valid receiveLSN that lead to lost parallel transactions Add test that reproduce issue from https://www.postgresql.org/message-id/CAHHbV7V4XvdHGw_jpR9Xyq3fz%3Df%2BO4oa%2B73sbizGTv_AvmDXhQ%40mail.gmail.com * bug: lastReceiveLSN not valid for logical replication Logical and Physical replication use different algorithms to calculate the lastReceiveLSN. For physical replication the calculation is: startLsn from XLogData plus the payloadsize; this is correct as we have the raw data. For logical replication the lastReceiveLSN uses startLSN from XLogData without the payload size as payload size is not available as a result logical decoding message size can change and we get LSN from the future random future transaction. -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc