Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logical replication LSN mgmt docs contradict javadoc #760

Closed
jpfuentes2 opened this issue Feb 23, 2017 · 1 comment
Closed

Logical replication LSN mgmt docs contradict javadoc #760

jpfuentes2 opened this issue Feb 23, 2017 · 1 comment

Comments

@jpfuentes2
Copy link
Contributor

@jpfuentes2 jpfuentes2 commented Feb 23, 2017

In the full example of logical replication it demos using manual LSN mgmt:

//feedback
stream.setAppliedLSN(stream.getLastReceiveLSN());
stream.setFlushedLSN(stream.getLastReceiveLSN());

Meanwhile, the java doc states for setAppliedLSN:

Parameter used only physical replication

There's also a comment in the PR which introduced logical replication support which seems to support the java doc: #550 (comment)

However, it seems that V3PGReplicationStream sends the applied LSN always. This makes sense to me because the postgresql docs state:

Standby status update (F)
Byte1('r')
Identifies the message as a receiver status update.

Int64
The location of the last WAL byte + 1 received and written to disk in the standby.

Int64
The location of the last WAL byte + 1 flushed to disk in the standby.

Int64
The location of the last WAL byte + 1 applied in the standby.

Int64
The client's system clock at the time of transmission, as microseconds since midnight on 2000-01-01.

Byte1
If 1, the client requests the server to reply to this message immediately. This can be used to ping the server, to test if the connection is still healthy.

So, should we change the javadoc? Am I missing something? What's the correct way to manually manage LSNs?

@davecramer

This comment has been minimized.

Copy link
Member

@davecramer davecramer commented Feb 23, 2017

You always have to set the applied LSN after you apply it.

The javadoc is wrong IMO

davecramer added a commit to davecramer/pgjdbc that referenced this issue Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.