Skip to content

Add close-path replication reschedule coverage#809

Open
marcus-pousette-hp wants to merge 13 commits into
mainfrom
fix/replicator-close-update
Open

Add close-path replication reschedule coverage#809
marcus-pousette-hp wants to merge 13 commits into
mainfrom
fix/replicator-close-update

Conversation

@marcus-pousette-hp
Copy link
Copy Markdown
Contributor

@marcus-pousette-hp marcus-pousette-hp commented May 14, 2026

Adds coverage for peer-close scheduling paths:

  • inflight block requests resume on a remaining peer after the requested peer closes
  • pending range downloads resume on a remaining peer after an idle peer closes

This PR is test-only. The idle-close updateAll() optimization was moved to a follow-up branch.

@marcus-pousette-hp marcus-pousette-hp force-pushed the fix/replicator-close-update branch from 7d01666 to 1d442e7 Compare May 14, 2026 09:02
@marcus-pousette-hp marcus-pousette-hp marked this pull request as ready for review May 14, 2026 13:02
@marcus-pousette-hp marcus-pousette-hp requested a review from a team May 14, 2026 13:02
Copy link
Copy Markdown
Contributor

@lejeunerenard lejeunerenard left a comment

Choose a reason for hiding this comment

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

Good reproductions of the two test scenarios I mentioned out of band. With changes they will be less brittle & clearer.

I think though the fixes for when we call .updateAll() aren't netting us less work now that we have tests to show how it reschedules work potentially (ie the ranges test).

Comment thread test/replicate.js Outdated
const cores = []
const clones = []

for (let i = 0; i < 4; i++) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should test multiple peers for one core, not multiple core pairs for two peers. With pairs of cores between two peers, the number of peers being checked on channel close are 0 because there's only one peer as you assert below.

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.

Fixed b8083d1

Comment thread lib/replicator.js Outdated
Comment thread test/replicate.js Outdated
Comment thread test/replicate.js Outdated
Comment thread test/replicate.js Outdated
Comment thread test/replicate.js Outdated
Comment thread test/replicate.js Outdated
Comment thread test/replicate.js Outdated
Comment thread test/replicate.js Outdated
Comment thread test/replicate.js Outdated
@marcus-pousette-hp marcus-pousette-hp changed the title Skip peer update scans on idle close Add close-path replication reschedule coverage May 18, 2026
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