devmadhuu commented on code in PR #10825:
URL: https://github.com/apache/ozone/pull/10825#discussion_r3637342367
##########
hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManager.java:
##########
@@ -393,6 +393,83 @@ private long getReconTaskAttributeFromJson(String
taskStatusResponse,
* Helper function to add voli/bucketi/keyi to containeri to OM Metadata.
* For test purpose each container will have only one key.
*/
+ @Test
+ public void testManualOMDBRebuild() throws Exception {
+ OzoneManagerServiceProviderImpl impl = (OzoneManagerServiceProviderImpl)
+ recon.getReconServer().getOzoneManagerServiceProvider();
+ OzoneConfiguration reconConf = recon.getReconServer().getOzoneConf();
+
+ // 1. Stop Recon
+ recon.stop();
+
+ // 2. Write keys to OM
+ addKeys(20, 25);
+ long omLatestSeqNumber = ((RDBStore) metadataManager.getStore())
+ .getDb().getLatestSequenceNumber();
+ java.io.File omDbDir = metadataManager.getStore().getDbLocation();
+
+ // 3. Stop OM (flush to disk)
+ cluster.getOzoneManager().stop();
+
+ // 4. Copy OM DB into Recon's OM snapshot dir
+ java.io.File configuredReconDbDir = new java.io.File(
+
cluster.getConf().get(ReconServerConfigKeys.OZONE_RECON_OM_SNAPSHOT_DB_DIR));
+ java.io.File actualReconDbDir = new
java.io.File(configuredReconDbDir.getParentFile(), "Recon");
+ java.io.File reconOmDbDir = new java.io.File(actualReconDbDir, "om.db_" +
System.currentTimeMillis());
+ System.out.println("Test copying to: " + reconOmDbDir.getAbsolutePath());
+ org.apache.commons.io.FileUtils.deleteDirectory(reconOmDbDir);
+ org.apache.commons.io.FileUtils.copyDirectory(omDbDir, reconOmDbDir);
+
+ // 5. Restart Recon
+ recon.start(cluster.getConf());
+
+ // 6. POST reinit
+ String triggerUrl = "http://" +
cluster.getConf().get(OZONE_RECON_HTTP_ADDRESS_KEY) +
+ "/api/v1/triggerdbsync/om/reinit";
+ org.apache.http.client.methods.HttpPost httpPost = new
org.apache.http.client.methods.HttpPost(triggerUrl);
+ HttpResponse response = httpClient.execute(httpPost);
+ assertEquals(202, response.getStatusLine().getStatusCode());
+
+ // 7. Wait for tasks to succeed
+ GenericTestUtils.waitFor(() -> {
Review Comment:
You can check this. This test might fail.
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskController.java:
##########
@@ -116,4 +116,9 @@ void consumeOMEvents(OMUpdateEventBatch events,
*/
@VisibleForTesting
int getEventBufferSize();
+
+ /**
+ * Reset retry counters to clear any pending retry delay.
+ */
+ void resetRetryCounters();
Review Comment:
We don't need this to be exposed at interface level now.
--
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]