I was reading the logical replication code and found a little unnecessary work we are doing.
The confirmed_flushed_lsn cannot reasonably be ahead of the current_lsn, so there is no point of calling LogicalConfirmReceivedLocation() every time we update the candidate xmin or restart_lsn. Patch is attached.
v00-eliminate-unnecessary-confirm-work-on-logical-replication.patch
Description: Binary data