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

Attila Doroszlai commented on HDDS-2919:
----------------------------------------

{code:title=code comment}
   * Not strictly a unit test. Just a confirmation of the expected behavior
   * of RocksDB keyMayExist API.
   * Expected behavior - On average, keyMayExist latency < key.get() latency
   * for invalid keys.
{code}

A real JMH-based microbenchmark would be better for that purpose.

There are several problems with the existing test:

# No warmup, so order matters.  (Adding warmup reduces time of both calls.)
# Same key names are used for both {{get}} and {{keyMayExist}} calls, the 
result of {{get}} might be cached at RocksDB level.  (This should help 
{{keyMayExist}}.  Reordering the loops shows that {{keyMayExist}} takes longer 
than {{get}}.)
# Too few measurements, no check of whether the difference is statistically 
significant.
# Tests a completely empty database (does not match real life usage)
# Measured time includes {{getBytesUtf16()}} calls, not only the RocksDB call 
being tested.

I think we should simply remove {{testRocksDBKeyMayExistApi}}.

> Intermittent failure in TestRDBStore
> ------------------------------------
>
>                 Key: HDDS-2919
>                 URL: https://issues.apache.org/jira/browse/HDDS-2919
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: test
>            Reporter: Attila Doroszlai
>            Assignee: Aravindan Vijayan
>            Priority: Trivial
>
> {code:title=https://github.com/apache/hadoop-ozone/runs/401287790}
> 2020-01-21T16:56:19.3955243Z [INFO] Running 
> org.apache.hadoop.hdds.utils.db.TestRDBStore
> 2020-01-21T16:56:22.9914233Z [ERROR] Tests run: 12, Failures: 1, Errors: 0, 
> Skipped: 0, Time elapsed: 3.597 s <<< FAILURE! - in 
> org.apache.hadoop.hdds.utils.db.TestRDBStore
> 2020-01-21T16:56:22.9980370Z [ERROR] 
> testRocksDBKeyMayExistApi(org.apache.hadoop.hdds.utils.db.TestRDBStore)  Time 
> elapsed: 0.125 s  <<< FAILURE!
> 2020-01-21T16:56:22.9980530Z java.lang.AssertionError
> 2020-01-21T16:56:22.9980628Z  at org.junit.Assert.fail(Assert.java:86)
> 2020-01-21T16:56:22.9980739Z  at org.junit.Assert.assertTrue(Assert.java:41)
> 2020-01-21T16:56:22.9980849Z  at org.junit.Assert.assertTrue(Assert.java:52)
> 2020-01-21T16:56:22.9980976Z  at 
> org.apache.hadoop.hdds.utils.db.TestRDBStore.testRocksDBKeyMayExistApi(TestRDBStore.java:324)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to