Skip to content

refactor: drop parallel_connections wrapper#920

Draft
meskill wants to merge 1 commit intomainfrom
push-upruzkyqutru
Draft

refactor: drop parallel_connections wrapper#920
meskill wants to merge 1 commit intomainfrom
push-upruzkyqutru

Conversation

@meskill
Copy link
Copy Markdown
Contributor

@meskill meskill commented Apr 22, 2026

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 72.72727% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...src/backend/replication/logical/subscriber/copy.rs 77.41% 7 Missing ⚠️
...end/replication/logical/publisher/parallel_sync.rs 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

self.bytes_sharded += bytes;

// Route each row to the right shard(s). send_one is a buffered write
// so this loop does no I/O — no concurrency needed here.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not true. send_one does a buffered write only if there is space in the buffer. Once that space runs out, it will flush the data to the socket.

With copy, where it writes a lot of data, this happens very frequently. This part definitely needs to be parallelized.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right about send_one.

but at the end that's the same send_one in the listener that will block the listener loop when the io buffer is full. So by using ParallelConnection we are defining additional buffer (channel) above that. And there is third buffer above it inside the copy_data.
The task offloading can help there to not block reading from the source while writing to the destination, but the computation cost should be the same (basically higher due to additional machinery).
My bet that's the size of the buffer is the important part since with enough size we can achieve parallel reading and writing. Where is this buffer is defined that's not important.

So, anyway, need to test and benchmark it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants