sumitagrawl commented on code in PR #5736:
URL: https://github.com/apache/ozone/pull/5736#discussion_r1417180620


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManager.java:
##########
@@ -265,12 +255,115 @@ public void testOmDBSyncing() throws Exception {
             "lastUpdatedTimestamp");
 
     // verify only Delta updates were added to recon after restart.
-    Assert.assertEquals(beforeRestartSnapShotTimeStamp,
+    assertEquals(beforeRestartSnapShotTimeStamp,
         afterRestartSnapShotTimeStamp);
 
     //verify sequence number after Delta Updates
-    Assert.assertEquals(omLatestSeqNumber, reconLatestSeqNumber);
-    Assert.assertEquals(0, metrics.getSequenceNumberLag().value());
+    assertEquals(omLatestSeqNumber, reconLatestSeqNumber);
+    assertEquals(0, metrics.getSequenceNumberLag().value());
+  }
+
+  // This test simulates the mis-match in sequence number between Recon OM
+  // snapshot DB and OzoneManager OM active DB. Recon sync with OM DB every
+  // 5-10 mins based on configured interval and if Recon OM snapshot DB
+  // has higher sequence number than OM active DB last sequence number,
+  // then OM DB updates call since last sequence number will fail as OM DB
+  // will not know about that sequence number which is not yet written to
+  // OM Rocks DB. In such case OM sets the 'isDBUpdateSuccess' flag as false.
+  // And Recon should fall back on full snapshot and recover itself.
+  @Test
+  public void testOmDBSyncWithSeqNumberMismatch() throws Exception {
+    // add a vol, bucket and key
+    addKeys(10, 15);
+
+    // check if OM metadata has vol10/bucket10/key10 info
+    String ozoneKey = metadataManager.getOzoneKey(
+        "vol10", "bucket10", "key10");
+    OmKeyInfo keyInfo1 =
+        metadataManager.getKeyTable(getBucketLayout()).get(ozoneKey);
+
+    // verify if OM has /vol10/bucket10/key10
+    assertEquals("vol10", keyInfo1.getVolumeName());
+    assertEquals("bucket10", keyInfo1.getBucketName());

Review Comment:
   we can use LogCapture to verify the dbSuccess flag 



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