Skip to content

Commit d307417

Browse files
knizhnikkelvich
authored andcommitted
Minor fixes in pglogical receiver spill buffer
1 parent 8b19d36 commit d307417

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

multimaster.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2848,9 +2848,9 @@ _PG_init(void)
28482848
&MtmTransSpillThreshold,
28492849
1000, /* 1Gb */
28502850
0,
2851-
INT_MAX,
2851+
(MaxAllocSize-1)/MB,
28522852
PGC_BACKEND,
2853-
0,\
2853+
0,
28542854
NULL,
28552855
NULL,
28562856
NULL

multimaster.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
#define MULTIMASTER_DEFAULT_ARBITER_PORT 5433
7272

73-
#define MB (1024*1024L)
73+
#define MB ((size_t)1024*1024)
7474

7575
#define USEC_TO_MSEC(t) ((t)/1000)
7676
#define MSEC_TO_USEC(t) ((timestamp_t)(t)*1000)

pglogical_apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ void MtmExecutor(void* work, size_t size)
10971097
}
10981098
case '(':
10991099
{
1100-
int64 size = pq_getmsgint(&s, 4);
1100+
size_t size = pq_getmsgint(&s, 4);
11011101
s.data = palloc(size);
11021102
save_cursor = s.cursor;
11031103
save_len = s.len;

pglogical_receiver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ pglogical_receiver_main(Datum main_arg)
583583
}
584584
} else if (spill_file >= 0) {
585585
MtmCloseSpillFile(spill_file);
586+
resetStringInfo(&spill_info);
586587
spill_file = -1;
587588
}
588589
ByteBufferReset(&buf);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy