[tor-bugs] #15848 [Onionoo]: Update details documents in a single, atomic step
Tor Bug Tracker & Wiki
blackhole at torproject.org
Tue Apr 28 16:01:46 UTC 2015
#15848: Update details documents in a single, atomic step
-------------------------+---------------------
Reporter: karsten | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Onionoo | Version:
Keywords: | Actual Points:
Parent ID: | Points:
-------------------------+---------------------
Right now, we're writing details documents in the last phase of the hourly
updater, but one after the other. And when we're done, we're writing the
`relays_published` timestamp indicating which consensus these details
documents are based on.
[https://lists.torproject.org/pipermail/tor-dev/2015-April/008738.html
Nusenu points out on tor-dev@] that this may create a situation when a
details response is returned that contains details documents based on a
later consensus than what's contained in the `relays_published` timestamp
that is given in the response.
Another downside of not updating all documents at once is that the sum of
network fractions is not always exactly 100%, depending on which documents
have already been updated.
A possible workaround would be to include a timestamp in each details
documents referencing the last known consensus at the time of writing the
document. That would fix the problem pointed out by Nusenu, but not the
problem with fractions. That timestamp would also be a potential source
for confusion, because the details documents of non-running relays or
bridges are not rewritten every hour. Also, another workaround for
checking whether a details document was updated recently might be to check
whether `last_seen > relays_published || (last_seen == relays_published &&
!running)` (untested).
A possible real fix would be to store all documents in a database and
update them in a single transaction.
Not sure if there are other (simple) solutions available that don't
require switching to a database just yet.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/15848>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list