You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/11/25 16:47:20 UTC

[GitHub] [accumulo] milleruntime commented on issue #1442: Change MasterTime to use currentTimeMillis. Fixes #1355

milleruntime commented on issue #1442: Change MasterTime to use currentTimeMillis. Fixes #1355
URL: https://github.com/apache/accumulo/pull/1442#issuecomment-558241037
 
 
   > I looked over the code and I think the way it is using System.nanoTime is appropriate, because the use of skewTime makes the use of nanoTime always relative within a process. This means the code should maintain a monotonically increasing counter as its javadoc suggest. Below is an example of what the current code would do.
   > 
   > * When never run before master process M1 puts 0 on ZK.  Assume M1 has nanoTime of 60E9, it will set its skewTime to 0 - 60E9 = -60E9.
   > * 10 seconds later, master M1 has nanoTime of 70E9.  It will add its skew time and store that in ZK.  So it stores 70E9-60E9 = 10E9 in ZK.
   > * Master M1 dies.
   > * 3 hours later master M2 starts.  It reads the current time from ZK as 10E9.  Assume master M2 has a nano time of 2500E9.  It will compute a skew time of 10E9 - 2500E9 = -2490E9.
   
   This is assuming that the M2 initial measurement of nano time is greater than the initial measurement of M1.  M2 will run in a different Java VM so there is no guarantee of how the second time will relate to the first time.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services