Opened 5 years ago

Last modified 3 years ago

#15848 assigned enhancement

Update details documents in a single, atomic step

Reported by: karsten Owned by: metrics-team
Priority: Medium Milestone:
Component: Metrics/Onionoo Version:
Severity: Normal Keywords:
Cc: tyseom Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


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.

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.

Child Tickets

Change History (3)

comment:1 Changed 5 years ago by tyseom

Cc: tyseom added

comment:2 Changed 3 years ago by karsten

Owner: set to metrics-team
Status: newassigned

comment:3 Changed 3 years ago by teor

Severity: Normal

Set all open tickets without a severity to "Normal"

Note: See TracTickets for help on using tickets.