rakeshadr commented on code in PR #3461:
URL: https://github.com/apache/ozone/pull/3461#discussion_r886998870


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListStatus.java:
##########
@@ -92,29 +92,28 @@ public static void teardownClass() {
   @Test
   public void testSortedListStatus() throws Exception {
     // a) test if output is sorted
-    checkKeyList("", "", 1000, 10);
+    checkKeyList("", "", 1000, 10, false);
 
     // b) number of keys returns is expected
-    checkKeyList("", "", 2, 2);
+    checkKeyList("", "", 2, 2, false);
 
     // c) check if full prefix works
-    checkKeyList("a1", "", 100, 3);
+    checkKeyList("a1", "", 100, 3, false);
 
     //  d) check if full prefix with numEntries work
-    checkKeyList("a1", "", 2, 2);
+    checkKeyList("a1", "", 2, 2, false);
 
     // e) check if existing start key >>>
-    checkKeyList("a1", "a1/a12", 100, 2);
+    checkKeyList("a1", "a1/a12", 100, 2, false);
 
     // f) check with non existing start key>>>
-    checkKeyList("", "a7", 100, 6);
-
-    // TODO: Enable the following test after listKeys changes
-//    // g) check if half prefix works <<<<
-//     checkKeyList("b", "", 100, 4);
-//
-//    // h) check half prefix with non-existing start key
-//     checkKeyList("b", "b5", 100, 2);
+    checkKeyList("", "a7", 100, 6, false);
+
+    // g) check if half prefix works <<<<
+    checkKeyList("b", "", 100, 4, true);
+
+    // h) check half prefix with non-existing start key

Review Comment:
   I have come across a special case of `non-existent keyPrefix` and 
`non-existent startKey`. In LEGACY listing returns empty list, I have tested 
via listKeys API. But in the FSO code path, its hitting exception.
   
   `checkKeyList("a1/a111", "a1/a111/a100", 100, 3, true)`.
   
   Presently, its throwing NPE on:
   
   ```
   21:39:08.740 [IPC Server handler 11 on default port 61404] ERROR OMAudit - 
user=rakeshr | ip=127.0.0.1 | op=LIST_STATUS {volume=volume59550, 
bucket=bucket45073, key=a1/a111, dataSize=0, replicationConfig=null} | 
ret=FAILURE
   java.lang.NullPointerException: null
        at 
com.google.common.base.Preconditions.checkNotNull(Preconditions.java:889) 
~[guava-31.1-jre.jar:?]
        at 
org.apache.hadoop.ozone.om.OzoneListStatusHelper.getDbKey(OzoneListStatusHelper.java:189)
 ~[classes/:?]
        at 
org.apache.hadoop.ozone.om.OzoneListStatusHelper.listStatusFSO(OzoneListStatusHelper.java:154)
 ~[classes/:?]
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to