Skip to content

Free replica local buffer in async way in dual channel replication#2948

Merged
enjoy-binbin merged 3 commits intovalkey-io:unstablefrom
enjoy-binbin:free_async
Jan 30, 2026
Merged

Free replica local buffer in async way in dual channel replication#2948
enjoy-binbin merged 3 commits intovalkey-io:unstablefrom
enjoy-binbin:free_async

Conversation

@enjoy-binbin
Copy link
Member

In dual channel replication, when the replica abort the replication,
if the local buffer is huge, free it in async way to avoid the latency.
Dual channel replication was introduced in #60.

In dual channel replication, when the replica abort the replication,
if the local buffer is huge, free it in async way to avoid the latency.
Dual channel replication was introduced in valkey-io#60.

Signed-off-by: Binbin <[email protected]>
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.77%. Comparing base (73838a0) to head (892e510).
⚠️ Report is 2 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #2948      +/-   ##
============================================
+ Coverage     74.69%   74.77%   +0.07%     
============================================
  Files           129      129              
  Lines         71199    71210      +11     
============================================
+ Hits          53185    53249      +64     
+ Misses        18014    17961      -53     
Files with missing lines Coverage Δ
src/lazyfree.c 88.38% <100.00%> (+0.88%) ⬆️
src/replication.c 85.91% <100.00%> (+0.07%) ⬆️
src/server.h 100.00% <ø> (ø)

... and 20 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@naglera naglera left a comment

Choose a reason for hiding this comment

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

Left couple of comments, also pointing out that the replication buffer streaming operation is also blocking, however it will require more work. We might want to solve this as well on a seprate PR.

@enjoy-binbin enjoy-binbin added the run-extra-tests Run extra tests on this PR (Runs all tests from daily except valgrind and RESP) label Dec 23, 2025
Signed-off-by: Binbin <[email protected]>
Copy link
Contributor

@murphyjacob4 murphyjacob4 left a comment

Choose a reason for hiding this comment

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

Thanks @enjoy-binbin, seems like a very reasonable improvement

@enjoy-binbin enjoy-binbin merged commit 851eaaf into valkey-io:unstable Jan 30, 2026
24 checks passed
@enjoy-binbin enjoy-binbin deleted the free_async branch January 30, 2026 16:43
immangat pushed a commit to immangat/valkey that referenced this pull request Feb 1, 2026
…alkey-io#2948)

In dual channel replication, when the replica abort the replication,
if the local buffer is huge, free it in async way to avoid the latency.
Dual channel replication was introduced in valkey-io#60.

Signed-off-by: Binbin <[email protected]>
harrylin98 pushed a commit to harrylin98/valkey_forked that referenced this pull request Feb 19, 2026
…alkey-io#2948)

In dual channel replication, when the replica abort the replication,
if the local buffer is huge, free it in async way to avoid the latency.
Dual channel replication was introduced in valkey-io#60.

Signed-off-by: Binbin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-extra-tests Run extra tests on this PR (Runs all tests from daily except valgrind and RESP)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants