Skip to content

Commit a60206a

Browse files
BRupireddy2hackorum
authored andcommitted
WIP Multi insert for logical replication apply
1 parent 1f3b9bb commit a60206a

5 files changed

Lines changed: 378 additions & 2 deletions

File tree

src/backend/executor/execReplication.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ FindConflictTuple(ResultRelInfo *resultRelInfo, EState *estate,
766766
* Check all the unique indexes in 'recheckIndexes' for conflict with the
767767
* tuple in 'remoteslot' and report if found.
768768
*/
769-
static void
769+
void
770770
CheckAndReportConflict(ResultRelInfo *resultRelInfo, EState *estate,
771771
ConflictType type, List *recheckIndexes,
772772
TupleTableSlot *searchslot, TupleTableSlot *remoteslot)

src/backend/replication/logical/proto.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,7 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
873873
tuple->colvalues = palloc0_array(StringInfoData, natts);
874874
tuple->colstatus = palloc_array(char, natts);
875875
tuple->ncols = natts;
876+
tuple->datasize = 0;
876877

877878
/* Read the data */
878879
for (i = 0; i < natts; i++)
@@ -897,6 +898,9 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
897898
case LOGICALREP_COLUMN_BINARY:
898899
len = pq_getmsgint(in, 4); /* read length */
899900

901+
/* accumulate received value length for buffering estimates */
902+
tuple->datasize += len;
903+
900904
/* and data */
901905
buff = palloc(len + 1);
902906
pq_copymsgbytes(in, buff, len);

0 commit comments

Comments
 (0)