devmadhuu commented on code in PR #6987:
URL: https://github.com/apache/ozone/pull/6987#discussion_r1694645008
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -260,6 +263,18 @@ public void start() {
omMetadataManager.start(configuration);
} catch (IOException ioEx) {
LOG.error("Error starting Recon OM Metadata Manager.", ioEx);
+ } catch (RuntimeException runtimeException) {
+ LOG.warn("Unexpected runtime error starting Recon OM Metadata Manager.",
runtimeException);
+ LOG.warn("Trying to delete existing recon OM snapshot DB and fetch new
one.");
+ metrics.incrNumSnapshotRequests();
+ LOG.info("Fetching full snapshot from Ozone Manager");
+ // Update local Recon OM DB to new snapshot.
+ try {
+ boolean success = updateReconOmDBWithNewSnapshot();
+ LOG.info("Fetched full new snapshot from Ozone Manager: {}", success);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
}
reconTaskController.start();
Review Comment:
@ArafatKhan2198 if Recon start will not be successful, then a
RunTimeException will be thrown and it will fail anyways completely. If due to
above code, if recon starts successfully, then I think, we may not need that
extra unnecessary logging here. The purpose of this patch is to handle the
corner case when Recon OM snapshot could be corrupted. We are not handling any
other case here.
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -623,6 +639,34 @@ public boolean syncDataFromOM() {
return true;
}
+ private void printFileAndKeyTableCount() throws IOException {
+ Table fileTable = omMetadataManager.getTable("fileTable");
+ Table keyTable = omMetadataManager.getTable("keyTable");
+ if (keyTable == null) {
+ LOG.error("Table keyTable not found in OM Metadata.");
+ }
+
+ if (LOG.isDebugEnabled() && null != keyTable) {
+ try (TableIterator<String, ? extends Table.KeyValue<String, ?>> iterator
+ = keyTable.iterator()) {
+ long count = Iterators.size(iterator);
+ LOG.debug("keyTable Table count: {}", count);
Review Comment:
Ok sure. will make it generic.
--
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]