Use dmedia/machine doc for local machine state

Bug #1216662 reported by Jason Gerard DeRose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Dmedia
Fix Released
High
Jason Gerard DeRose

Bug Description

Currently we save certain local machine state in the _local/dmedia doc in CouchDB:

1) The drives (FileStore) that are currently physically attached to the computer

2) The Dmedia peers currently visible on the local network

But it's extremely useful to also have this metadata in the dmedia/machine doc. For example, this allows Dmedia to see what drives are currently connected to a peer (remember, the _local/foo docs don't get replicated).

Earlier this month I quickly hacked some changes in so that the stores and peers get saved in both _local/dmedia and the machine doc, as this was needed for a Dmedia demo. It proved useful, so now it's time to make this change properly.

I've refactored the Core class such that the identity parts are no longer optional (you now must pass the machine and user docs to Core.__init__()), and so that the local stores and peers are now *only* saved in the machine doc, no longer get saved in _local/dmedia.

This will also allow us to make the downloader smarter in that we can decide what peer to download from based on the stores in that peer's machine doc, rather than having to make a HEAD request to first see if the peer has the file. So Dmedia will converge more quickly, will be closer to the IO limits.

Related branches

Changed in dmedia:
status: In Progress → Fix Committed
Changed in dmedia:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.