Skip to content

Commit f19fc53

Browse files
committed
Explain why we don't send xids in every message
1 parent eeac2f6 commit f19fc53

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

contrib/pglogical_output/doc/DESIGN.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,18 @@ confirmed that it enabled the requested functionality. It might choose to
122122
disconnect and report an error to the user if the server didn't do what it
123123
asked. This can be important, e.g. when a security-significant hook is
124124
specified.
125+
126+
## XIDs only in begin/commit
127+
128+
There's no need to send transaction IDs in each protocol message because
129+
logical decoding accumulates transactions' changes on the upstream in
130+
reorder buffers. It sends them only when they are committed, strictly
131+
in the order that they are committed.
132+
133+
If support for streaming transactions through logical decoding before
134+
commit is added to PostgreSQL in future, the pglogical output plugin
135+
will continue to rely on xact reordering by default. Interleaving will
136+
only be enabled if the client sends a startup parameter indicating it
137+
expects/supports interleaving. So we can add xid fields to individual
138+
messages in that case, if and when support is added, without breaking
139+
other clients.

0 commit comments

Comments
 (0)