Skip to content
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

[Sync Problem]86% of lotus daemon logs are sent too many dont haves, removing from session make sync stuck #4118

Closed
askender opened this issue Oct 1, 2020 · 4 comments

Comments

@askender
Copy link

askender commented Oct 1, 2020

➜ ~ lotus version
Daemon: 0.8.0+git.2c1d96b.dirty+api0.16.0
Local: lotus version 0.8.0+git.2c1d96b.dirty

INFO:
➜ ~ cat log.lotus_0825_v800_001|grep ’sent too many dont haves’|wc -l
44371483
➜ ~ cat log.lotus_0825_v800_001|wc -l
51444254
I guess I have got DDoS, hard to sync…
50 peers send 36373343 msgs in 3 days, 36373343/44371483=81.97%

another server in same network, very quick in sync:
➜ ~ cat log.lotus_0825_v800|grep ’sent too many dont haves’|wc -l
386279
➜ ~ cat log.lotus_0825_v800|wc -l
2194152

the spam msgs are like this:

2020-09-29T22:13:54.705+0800	INFO	bs:sess	session/sessionwantsender.go:458	
peer 12D3KooWMYYJjkoWdbkPCaRDgFS4mdNRcMfLvUwnVRdcgQy8RDSw 
sent too many dont haves, removing from session 18359
@dirkmc
Copy link
Contributor

dirkmc commented Oct 1, 2020

Context on the error message:

Bitswap sessions are used to group many requests for blocks in the same file.

When Bitswap is asked to fetch a block, it sends a "want-have" request to all connected peers. Any peer that has the block responds with "HAVE". Bitswap adds peers that have the block to the session.

From then on, each time Bitswap is asked to fetch a block for that file, it only sends the "want-have" to peers that are in the session. If a peer responds with "DONT_HAVE" many times in a row, Bitswap outputs sent too many dont haves, removing from session and removes the peer from the session. This is to avoid sending "want-have" to peers which don't have any more blocks that the session is interested in.

@jennijuju
Copy link
Member

Context on the error message:

Bitswap sessions are used to group many requests for blocks in the same file.

When Bitswap is asked to fetch a block, it sends a "want-have" request to all connected peers. Any peer that has the block responds with "HAVE". Bitswap adds peers that have the block to the session.

From then on, each time Bitswap is asked to fetch a block for that file, it only sends the "want-have" to peers that are in the session. If a peer responds with "DONT_HAVE" many times in a row, Bitswap outputs sent too many dont haves, removing from session and removes the peer from the session. This is to avoid sending "want-have" to peers which don't have any more blocks that the session is interested in.

This is not an issue as it is a log designed to be printout as mentioned above. And it is also attached to the linked ticket, so closing.

@askender
Copy link
Author

askender commented Oct 1, 2020

Thanks. Before 0.8.1 this msg is really too much(86%), and mess up the logs.
In 0.8.1, the sync is really fast! Thanks for your great work. @jennijuju I like your code and other great works too.
Happy festivals!

Time delta between now and our mining base: 6s (nulls: 0) 6s is super fast! Haven't been so fast for a long time.

@jennijuju
Copy link
Member

Thanks. Before 0.8.1 this msg is really too much(86%), and mess up the logs.
In 0.8.1, the sync is really fast! Thanks for your great work. @jennijuju I like your code and other great works too.
Happy festivals!

Time delta between now and our mining base: 6s (nulls: 0) 6s is super fast! Haven't been so fast for a long time.

Aw thank you for the kind words, and glad to know that things are performing better for you now! And thank you for keep flagging issue with us and providing detailed description, they are all super helpful to us! And happy festivals to you too!

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

No branches or pull requests

3 participants