ArafatKhan2198 commented on code in PR #6640:
URL: https://github.com/apache/ozone/pull/6640#discussion_r1601803640
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -381,25 +397,36 @@ connectionFactory, getOzoneManagerSnapshotUrl(),
*/
@VisibleForTesting
boolean updateReconOmDBWithNewSnapshot() throws IOException {
+ // Check permissions of the Recon DB directory
+ checkAndValidateReconDbPermissions();
// Obtain the current DB snapshot from OM and
// update the in house OM metadata managed DB instance.
long startTime = Time.monotonicNow();
DBCheckpoint dbSnapshot = getOzoneManagerDBSnapshot();
metrics.updateSnapshotRequestLatency(Time.monotonicNow() - startTime);
- if (dbSnapshot != null && dbSnapshot.getCheckpointLocation() != null) {
- LOG.info("Got new checkpoint from OM : " +
- dbSnapshot.getCheckpointLocation());
- try {
- omMetadataManager.updateOmDB(
- dbSnapshot.getCheckpointLocation().toFile());
- return true;
- } catch (IOException e) {
- LOG.error("Unable to refresh Recon OM DB Snapshot. ", e);
- }
- } else {
- LOG.error("Null snapshot location got from OM.");
+
+ if (dbSnapshot == null) {
+ LOG.error("Failed to obtain a valid DB snapshot from Ozone Manager. This
could be due to " +
+ "missing SST files or other fetch issues.");
+ return false;
+ }
+
+ if (dbSnapshot.getCheckpointLocation() == null) {
+ LOG.error("Snapshot checkpoint location is null, indicating a failure to
properly fetch or " +
+ "store the snapshot.");
+ return false;
+ }
+
+ LOG.info("Attempting to update Recon OM DB with new snapshot located at:
{}",
+ dbSnapshot.getCheckpointLocation());
+ try {
+
omMetadataManager.updateOmDB(dbSnapshot.getCheckpointLocation().toFile());
+ LOG.info("Successfully updated Recon OM DB with new snapshot.");
Review Comment:
I suggest leaving the information to be printed in the logs, as it will only
be called once, specifically during the first update of the full snapshot.
--
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]