Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

cmd/swarm-smoke: check if chunks are at most prox host#1353

Merged
nonsense merged 1 commit intoswarm-rather-stablefrom
smoke-tests-sync-check
Apr 26, 2019
Merged

cmd/swarm-smoke: check if chunks are at most prox host#1353
nonsense merged 1 commit intoswarm-rather-stablefrom
smoke-tests-sync-check

Conversation

@nonsense
Copy link
Copy Markdown
Contributor

@nonsense nonsense commented Apr 26, 2019

This PR is adding two checks performed on the upload_and_sync smoke test:

  1. Checks whether a chunk has been found at less than 2 hosts. Considering our NN size, this should not happen.
  2. Checks if a chunk is not found at its closest node. This should also not happen.

Together with the --only-upload flag, we could run this smoke test and make sure that our syncing functionality is correct (without even trying to retrieve the content). If we see errors, it means that we should focus on syncing, before we try to investigate further timeouts on retrieve request side and on fetchers.


@holisticode I know we have a unit test for this, but I am getting errors when running this in a deployment. So we need to understand better why they happen.

return
}

bzzAddr := strings.Split(strings.Split(hive, "\n")[3], " ")[10]
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.

This is rather ugly - do we have an API that returns the bzz addr for a given host? admin.NodeInfo doesn't have that information, it has only id and enode.

}

// getChunksBitVectorFromHost returns a bit vector of presence for a given slice of chunks from a given host
func getChunksBitVectorFromHost(client *rpc.Client, addrs []storage.Address) (string, error) {
Copy link
Copy Markdown
Contributor Author

@nonsense nonsense Apr 26, 2019

Choose a reason for hiding this comment

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

getChunksBitVectorFromHost and getBzzAddrFromHost really don't belong here - there should be a package which provides a type-safe bzz client from an rpcClient, which has all APIs exposed in bzz configured in it, but since we don't have one, I am defining them here.

We might want to add this once we start using these APIs a bit more often, but for now, I think its fine for this to live here.

@nonsense nonsense force-pushed the smoke-tests-sync-check branch from 5f32691 to ebfa52f Compare April 26, 2019 12:07
Copy link
Copy Markdown
Member

@janos janos left a comment

Choose a reason for hiding this comment

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

The functionality seems correct.

@nonsense nonsense merged commit 19f3b94 into swarm-rather-stable Apr 26, 2019
nonsense added a commit that referenced this pull request May 10, 2019
swarm/network: measure how many chunks a node delivers (#1358)
@nonsense nonsense deleted the smoke-tests-sync-check branch June 5, 2019 11:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants