1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

Move tracking of in_streaming to PGOutputData

"in_streaming" is a flag used to track if an instance of pgoutput is
streaming changes.  When pgoutput is started, the flag was always reset,
switched it back and forth in the stream start/stop callbacks.

Before this commit, it was a global variable, which is confusing as it
is actually attached to a state of PGOutputData.  Per my analysis, using
a global variable did not lead to an active bug like in 54ccfd6586,
but it makes the code more consistent.  Note that we cannot backpatch
this change anyway as it requires the addition of a new field to
PGOutputData, exposed in pgoutput.h.

Author: Hou Zhijie
Reviewed-by: Amit Kapila, Michael Paquier, Peter Smith
Discussion: https://postgr.es/m/OS0PR01MB571690EF24F51F51EFFCBB0E94FAA@OS0PR01MB5716.jpnprd01.prod.outlook.com
This commit is contained in:
Michael Paquier
2023-09-28 09:33:51 +09:00
parent ebf76f2753
commit 9210afd3bc
2 changed files with 21 additions and 16 deletions

View File

@@ -21,6 +21,9 @@ typedef struct PGOutputData
* allocations */
MemoryContext cachectx; /* private memory context for cache data */
bool in_streaming; /* true if we are streaming a chunk of
* transaction */
/* client-supplied info: */
uint32 protocol_version;
List *publication_names;