-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ipfs/go-bitswap] Failure to fetch content from connected nodes #83
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
We usually handle this by setting up the node as follows:
However, ideally bitswap would add all existing peers on startup. If you want to write a quick patch to do that, I'd be happy to take a look. |
@vdamle : is this a patch you're interested in contributing? |
Sorry, I missed the update @BigLep / @Stebalien - thanks for the input! I'd love to contribute a patch. @Stebalien : Here's what I'm thinking:
Please let me know if I'm on the right track. In the meantime, I will try to make the above changes and test in my private network deployment. |
So, I tried to implement it and realized this just isn't going to work, or at least not "well" because your libp2p host may have received connections before it's listening on the bitswap protocol. The correct fix is to:
But this needs to be done carefully to make sure it's somewhat atomic. |
@vdamle: do you have a better idea of what a patch would need to look like given @Stebalien 's feedback? |
@vdamle : is this something you'd be to contribute? 2022-01-07 conversation: @aschmahmann ran into this as well in 202112 while working on Testground/integration testing. Not fixing this means tests have to work around this issue. |
@BigLep @Stebalien I took a stab at this in ipfs/go-bitswap#590. Am I on the right track? |
Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days. |
what additional information is needed? |
@peterargue : apologies for the confusion. It looks like we need to do some bot adjustments for when the ball is back in the maintainer's court. We'll need maintainers to look at this (next triage is scheduled for 2022-10-20). |
@BigLep no worries and thanks for the update |
@BigLep any idea when the team will have some time to take a look at this PR? FWIW, we've been running with these changes on a live network for the last 4 weeks with great results. All of the correct peers are added on startup and updated as expected. |
Hi @peterargue : I personally haven't been at the most recent triage meetings to give more insight. @guseggert : has this come up during weekly triage? Do we have any initial feedback here? |
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days. |
Environment
IPFS Version:
We are running a private IPFS cluster with 2 or more nodes (docker/k8s)
Description
As an example, we've got a network with 2 nodes -
node1
andnode2
. After startup, we observe thatnode2
cannot fetch content fromnode1
(a bootstrap peer) because it is not registered as aPartner
. We see onnode1
thatnode2
is registered as aPeer/Partner
. I tried adding some additonal debug logs and best I could tell, the steps to register aBitSwapNetwork Receiver
to receive events from the network was not complete beforenode2
received a "connected" notification fromnode1
. It seems to me like this is a race condition and we see this occur 90% of the time, when we spin up nodes (ref: https://github.com/ipfs/go-bitswap/blob/0e81f7c1fef795a8d34cdd494fa2d8fdc045d199/bitswap.go#L215 ). As a throw of dice, I tried to move up the call before any options/decision engine is setup, this did not make a whole lot of difference to the outcome.Workaround
ipfs swarm peer disconnect <address>
ipfs swarm peer connect <address>
We can see that the PeerConnected handler is invoked from Connected, which adds the Peer to the peer list. After this,
WANT_HAVE
is sent as expected to the peer and content is retrieved.PS: Originally, I created the following issue in
go-ipfs
, but after further investigation, it feels likego-bitswap
is the right place to report this.I'd love to hear any suggestions/thoughts for how this can be addressed since I have a limited view of the architecture/intent for how connections are supposed to work. I have attached logs and output of commands from both nodes.
ipfs-config-node1.txt
ipfs-config-node2.txt
ipfs-id-node1.txt
ipfs-id-node2.txt
ipfs-node1.log
ipfs-node2.log
The text was updated successfully, but these errors were encountered: