src/backend/replication/logical/reorderbuffer.c
void
ReorderBufferAddInvalidations(ReorderBuffer *rb, TransactionId xid,
							  XLogRecPtr lsn, Size nmsgs,
							  SharedInvalidationMessage *msgs)
{
	ReorderBufferTXN *txn;

	txn = ReorderBufferTXNByXid(rb, xid, true, NULL, lsn, true);

	if (txn->ninvalidations != 0)
		elog(ERROR, "only ever add one set of invalidations");

	Assert(nmsgs > 0);

	txn->ninvalidations = nmsgs;
	txn->invalidations = (SharedInvalidationMessage *)
		MemoryContextAlloc(rb->context,
						   sizeof(SharedInvalidationMessage) * nmsgs);
	memcpy(txn->invalidations, msgs,
		   sizeof(SharedInvalidationMessage) * nmsgs);
}
/*
 * Setup the invalidation of the toplevel transaction.
 *
 * This needs to be done before ReorderBufferCommit is called!
 */
Setup the invalidation of the toplevel transaction.
This needs to be done before ReorderBufferCommit is called!
Setup the invalidation of the toplevel transaction . This needs to be done before ReorderBufferCommit is called!
void
ReorderBufferAddInvalidations(ReorderBuffer *rb, TransactionId xid,
							  XLogRecPtr lsn, Size nmsgs,
							  SharedInvalidationMessage *msgs)
{
	ReorderBufferTXN *txn;
	txn = ReorderBufferTXNByXid(rb, xid, true, NULL, lsn, true);
	if (txn->ninvalidations != 0)
		elog(ERROR, "only ever add one set of invalidations");
	Assert(nmsgs > 0);
	txn->ninvalidations = nmsgs;
	txn->invalidations = (SharedInvalidationMessage *)
		MemoryContextAlloc(rb->context,
						   sizeof(SharedInvalidationMessage) * nmsgs);
	memcpy(txn->invalidations, msgs,
		   sizeof(SharedInvalidationMessage) * nmsgs);
}
void ReorderBufferAddInvalidations ( ReorderBuffer * rb , TransactionId xid , XLogRecPtr lsn , Size nmsgs , SharedInvalidationMessage * msgs ) { ReorderBufferTXN * txn ; txn = ReorderBufferTXNByXid ( rb , xid , true , NULL , lsn , true ) ; if ( txn -> ninvalidations != 0 ) elog ( ERROR , " " ) ; Assert ( nmsgs > 0 ) ; txn -> ninvalidations = nmsgs ; txn -> invalidations = ( SharedInvalidationMessage * ) MemoryContextAlloc ( rb -> context , sizeof ( SharedInvalidationMessage ) * nmsgs ) ; memcpy ( txn -> invalidations , msgs , sizeof ( SharedInvalidationMessage ) * nmsgs ) ; }
Setup the invalidation of the toplevel transaction.
Setup the invalidation of the toplevel transaction .