You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "smengcl (via GitHub)" <gi...@apache.org> on 2023/07/11 20:28:11 UTC

[GitHub] [ozone] smengcl commented on a diff in pull request #5043: HDDS-8310. Recon goes down with RepeatedOmKeyInfo cannot be cast to OmKeyInfo

smengcl commented on code in PR #5043:
URL: https://github.com/apache/ozone/pull/5043#discussion_r1260246260


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ContainerKeyMapperTask.java:
##########
@@ -263,6 +268,22 @@ public Pair<String, Boolean> process(OMUpdateEventBatch events) {
     return new ImmutablePair<>(getTaskName(), true);
   }
 
+  /**
+   * Checks if the object passed is an instance of `OmKeyInfo`.
+   *
+   * @param obj The object to check.
+   * @return True if the object is an instance of `OmKeyInfo`, false otherwise.
+   */
+  private boolean isOmKeyInfo(Object obj) {
+    if (obj instanceof OmKeyInfo) {
+      return true;
+    } else {
+      LOG.warn("Unexpected value type {} for key. Skipping processing.",
+          obj.getClass().getName());
+      return false;

Review Comment:
   While I get that a mitigation like this should work around the issue to avoid Recon crashes, this does not solve the problem from the source. i.e. where is that event even coming from
   
   In this case can we add more logging around where this `obj` was coming from initially to hopefully gather more info in hope of locating the culprit in the future? (e.g. adding identifying enum at the source side to help backtracking from the logs; add DEBUG logging in the code paths)



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org