summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorRobert Haas2022-03-08 15:05:55 +0000
committerRobert Haas2022-03-08 15:05:55 +0000
commit1d4be6be65ab18aa3b240d9bc912ebece255c53b (patch)
tree17d985e81a6cc00845bc4c3eca0da540fe8e7026 /src/backend
parent7cf085f077df8dd9b80cf1f5964b5b8c142be496 (diff)
Fix LZ4 tests for remaining buffer space.
We should flush the buffer when the remaining space is less than the maximum amount that we might need, not when it is less than or equal to the maximum amount we might need. Jeevan Ladhe, per an observation from me. Discussion: http://postgr.es/m/CANm22CgVMa85O1akgs+DOPE8NSrT1zbz5_vYfS83_r+6nCivLQ@mail.gmail.com
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/replication/basebackup_lz4.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/replication/basebackup_lz4.c b/src/backend/replication/basebackup_lz4.c
index d26032783cf..472b620d7c7 100644
--- a/src/backend/replication/basebackup_lz4.c
+++ b/src/backend/replication/basebackup_lz4.c
@@ -193,7 +193,7 @@ bbsink_lz4_archive_contents(bbsink *sink, size_t avail_in)
* LZ4F_compressBound(), ask the next sink to process the data so that we
* can empty the buffer.
*/
- if ((mysink->base.bbs_next->bbs_buffer_length - mysink->bytes_written) <=
+ if ((mysink->base.bbs_next->bbs_buffer_length - mysink->bytes_written) <
avail_in_bound)
{
bbsink_archive_contents(sink->bbs_next, mysink->bytes_written);
@@ -238,7 +238,7 @@ bbsink_lz4_end_archive(bbsink *sink)
Assert(mysink->base.bbs_next->bbs_buffer_length >= lz4_footer_bound);
- if ((mysink->base.bbs_next->bbs_buffer_length - mysink->bytes_written) <=
+ if ((mysink->base.bbs_next->bbs_buffer_length - mysink->bytes_written) <
lz4_footer_bound)
{
bbsink_archive_contents(sink->bbs_next, mysink->bytes_written);