[or-cvs] r11944: Make discard_old_votes part of the consensus publishing proc (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Mon Oct 15 14:59:49 UTC 2007


Author: nickm
Date: 2007-10-15 10:59:48 -0400 (Mon, 15 Oct 2007)
New Revision: 11944

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/dirvote.c
Log:
 r15781 at catbus:  nickm | 2007-10-15 10:59:26 -0400
 Make discard_old_votes part of the consensus publishing process, so we conform to spec, and so we avoid a weird bugs where publishing sets the consensus, setting the consensus makes us reschedule, and rescheduling makes us delay vote-discarding.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r15781] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-10-15 14:59:44 UTC (rev 11943)
+++ tor/trunk/ChangeLog	2007-10-15 14:59:48 UTC (rev 11944)
@@ -6,14 +6,17 @@
       it. Extra descriptors without any real changes are dropped by the
       authorities, and can screw up our "publish every 18 hours" schedule.
 
-  o Minor features:
+  o Minor features (router descriptor cache):
     - If we find a cached-routers file that's been sitting around for more
       than 28 days unmodified, then most likely it's a leftover from when we
       upgraded to 0.2.0.8-alpha.  Remove it.  It has no good routers anyway.
 
-  o Minor bugfixes:
+  o Minor bugfixes (directory authorities):
     - Correct the implementation of "download votes by digest."  Bugfix on
       0.2.0.8-alpha.
+    - Make the "next period" votes into "current period" votes immediately
+      after publishing the consensus; avoid a heisenbug that made them stick
+      around indefinitely.
 
   o Code simplifications and refactoring:
     - Remove support for the old bw_accounting file: we've been storing

Modified: tor/trunk/src/or/dirvote.c
===================================================================
--- tor/trunk/src/or/dirvote.c	2007-10-15 14:59:44 UTC (rev 11943)
+++ tor/trunk/src/or/dirvote.c	2007-10-15 14:59:48 UTC (rev 11944)
@@ -1043,8 +1043,6 @@
   time_t fetch_missing_signatures;
   /** When do we publish the consensus? */
   time_t interval_starts;
-  /** When do we discard old votes and pending detached signatures? */
-  time_t discard_old_votes;
 
   /* True iff we have generated and distributed our vote. */
   int have_voted;
@@ -1056,7 +1054,7 @@
   int have_fetched_missing_signatures;
   /* True iff we have published our consensus. */
   int have_published_consensus;
-} voting_schedule = {0,0,0,0,0,0,0,0,0,0,0};
+} voting_schedule = {0,0,0,0,0,0,0,0,0,0};
 
 /** Set voting_schedule to hold the timing for the next vote we should be
  * doing. */
@@ -1094,8 +1092,6 @@
   voting_schedule.voting_ends = start - dist_delay;
   voting_schedule.fetch_missing_votes = start - dist_delay - (vote_delay/2);
   voting_schedule.voting_starts = start - dist_delay - vote_delay;
-
-  voting_schedule.discard_old_votes = start;
 }
 
 /** Entry point: Take whatever voting actions are pending as of <b>now</b>. */
@@ -1138,17 +1134,14 @@
   }
   if (voting_schedule.interval_starts < now &&
       !voting_schedule.have_published_consensus) {
-    log_notice(LD_DIR, "Time to publish the consensus.");
+    log_notice(LD_DIR, "Time to publish the consensus and discard old votes");
     dirvote_publish_consensus();
+    dirvote_clear_votes(0);
     /* XXXX020 we will want to try again later if we haven't got enough
      * signatures yet. */
+    dirvote_recalculate_timing(now);
     voting_schedule.have_published_consensus = 1;
   }
-  if (voting_schedule.discard_old_votes < now) {
-    log_notice(LD_DIR, "Time to discard old votes.");
-    dirvote_clear_votes(0);
-    dirvote_recalculate_timing(now);
-  }
 }
 
 /** A vote networkstatus_vote_t and its unparsed body: held around so we can



More information about the tor-commits mailing list