Homework 2 forum

Clarification for RetrieveMetaFile method

 
Nutzerbild von Bastien Wermeille
Clarification for RetrieveMetaFile method
von Bastien Wermeille - Montag, 2. November 2020, 21:28
 

Hello,

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

Thanks,

Bastien

profile
Re: Clarification for RetrieveMetaFile method
von Kirill Nikitin - Montag, 2. November 2020, 22:49
 

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

Nutzerbild von Bastien Wermeille
Re: Clarification for RetrieveMetaFile method
von Bastien Wermeille - Dienstag, 3. November 2020, 20:21
 

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

profile
Re: Clarification for RetrieveMetaFile method
von Kirill Nikitin - Mittwoch, 4. November 2020, 09:11
 

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

Kirill

Nutzerbild von Dorian Ros
Re: Clarification for RetrieveMetaFile method
von Dorian Ros - Mittwoch, 11. November 2020, 11:58
 

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!

profile
Re: Clarification for RetrieveMetaFile method
von Kirill Nikitin - Mittwoch, 11. November 2020, 12:29
 

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

Nutzerbild von Dorian Ros
Re: Clarification for RetrieveMetaFile method
von Dorian Ros - Mittwoch, 11. November 2020, 12:41
 

Thanks, it's all clear now!

Cheers!