Clarification for RetrieveMetaFile method

Clarification for RetrieveMetaFile method

by Bastien Wermeille -
Number of replies: 6

Hello,

Regarding the retrieveMetaFile method, should we save the downloaded metafile in the gossiper or just rteurn the value ?

Thanks,

Bastien

In reply to Bastien Wermeille

Re: Clarification for RetrieveMetaFile method

by Kirill Nikitin -

Hi,

In this method, we expect you to only download the metafile and return its content, without indexing or saving. If you are using it in DownloadFile(), you should do the indexing outside RetrieveMetaFile().

Kirill

In reply to Kirill Nikitin

Re: Clarification for RetrieveMetaFile method

by Bastien Wermeille -

Great thank you.

One last question about this function, should we do the exponential request to download this file in this function or not ?

Best regards,

Bastien

In reply to Bastien Wermeille

Re: Clarification for RetrieveMetaFile method

by Kirill Nikitin -

Yes, treat the metafile like any other chunk in terms of downloading.

Kirill

In reply to Bastien Wermeille

Re: Clarification for RetrieveMetaFile method

by Dorian Ros -

Hello,

I have another question about the RetrieveMetaFile method. Does the node that requests the file broadcast the request or does it choose the next hop based on his routing table ?

I ask this because the test "TestGossiper_Download_Metafile_Seq" fails due to the fact that routing messages don't have enough time to propagate and when the test reaches "nA.gossiper.RetrieveMetaFile(nB.id, metaHashHexB)", nA does not have nB in its routing table yet.

Adding a time.Sleep before calling RetrieveMetaFile works fine though.

Thanks!

In reply to Dorian Ros

Re: Clarification for RetrieveMetaFile method

by Kirill Nikitin -

Hi,

It should choose the next hop based on its routing table.

In this test, the route timer is set to one second so all the routing information will eventually propagate (as you point out). Remember that retrieving metafile should have the same logic as retrieving any file chunk. Thus, your gossiper needs to retry the metafile retrieval in the back-off manner: eventually it will have the required routing information for sending the gossip packet with the data request. Obviously, it requires your gossiper not to crash if it does not have a destination in its routing table; dropping the packet is fine in this case.

Kirill