[Net] Fix multi-peer path-only replication, optimize single peer object cache. #58400
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It used to check if a net_id was ever assigned to that node to detect when to send the path confirm to the remote peer.
This is wrong, because the same net_id is shared for all the remote peers, but sent one by one.
Instead we now check if it's either not assigned or if the assigned net_id is a cache ID, and in that case ensure that the remote peer has been notified.
This can be further improved by unifying the cache interface, but for now it's a fast fix to get path-only sync to work.
This PR still at least optimize the check to verify if a given (single) peer has been notified or not.
Fixes #58193