[ 
https://issues.apache.org/jira/browse/HBASE-6832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13458339#comment-13458339
 ] 

Enis Soztutar commented on HBASE-6832:
--------------------------------------

The root cause of the problem seems related to HBASE-6826, mainly the Put after 
the Delete happens at the same milisecond, thus the Delete eclipses the 
successive Put.

On linux, in my MBP, 5-10 ms passes between tests in testMulti()
{code}
1346122558760
1346122558784
1346122558798
1346122558807
1346122558816
{code}
But on windows, without sleeps, it is:
{code}
1346122747062
1346122747076
1346122747076
{code}
It might be the case that it is running faster on windows, or, the Java 
implementation cannot provide enough precision unless Thread.sleep() is called. 

There is actually a way to inject custom timing into HBase, implemented in 
EnrivonmentEdge.java and EnvironmentEdgeManager.java. I'll try to see whether 
using smt like IncrementingEnvironmentEdge makes more sense here. 

Here is an interesting study on time measurements in java across platforms and 
versions:
http://code.google.com/p/javasimon/wiki/SystemTimersGranularity

>From that study, it seems that Windows server 2008 should have 1 ms update 
>frequency for the System.currentTimeMilis() counter, which is good news. In my 
>own (non-scientific) testing though, I found my Windows Server 2008 R2 to 
>update the ms counter less frequently, although nano time counter seems to do 
>the job. But the test was run on a virtual Windows installation, so take these 
>with a grain of salt. 

||trial||nanos_diff||milis_diff||
|1|21617442|16|
|2|7798401|0|
|3|6879142|16|

HBase uses System.currentTimeMilis() to obtain a notion of the global clock. We 
cannot use System.nanoTime() since it is not connected to the wall-clock, but 
only used for measuring time intervals. 
                
> [WINDOWS] TestRegionObserverBypass failures
> -------------------------------------------
>
>                 Key: HBASE-6832
>                 URL: https://issues.apache.org/jira/browse/HBASE-6832
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.96.0, 0.94.3
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>              Labels: windows
>
> TestRegionObserverBypass.testMulti() fails with 
> {code}
> java.lang.AssertionError: expected:<1> but was:<0>
>       at org.junit.Assert.fail(Assert.java:93)
>       at org.junit.Assert.failNotEquals(Assert.java:647)
>       at org.junit.Assert.assertEquals(Assert.java:128)
>       at org.junit.Assert.assertEquals(Assert.java:472)
>       at org.junit.Assert.assertEquals(Assert.java:456)
>       at 
> org.apache.hadoop.hbase.coprocessor.TestRegionObserverBypass.checkRowAndDelete(TestRegionObserverBypass.java:173)
>       at 
> org.apache.hadoop.hbase.coprocessor.TestRegionObserverBypass.testMulti(TestRegionObserverBypass.java:166)
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to