HDDS-8310. Recon goes down with RepeatedOmKeyInfo cannot be cast to OmKeyInfo#5043
HDDS-8310. Recon goes down with RepeatedOmKeyInfo cannot be cast to OmKeyInfo#5043jojochuang merged 9 commits intoapache:masterfrom
Conversation
…rg.apache.hadoop.ozone.om.helpers.OmKeyInfo.
|
@jojochuang @ChenSammi @smengcl @devmadhuu Could you please take a look! |
...op-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ContainerKeyMapperTask.java
Outdated
Show resolved
Hide resolved
devmadhuu
left a comment
There was a problem hiding this comment.
Pls check and handle comments.
...op-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ContainerKeyMapperTask.java
Outdated
Show resolved
Hide resolved
...op-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ContainerKeyMapperTask.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/FileSizeCountTask.java
Outdated
Show resolved
Hide resolved
...p-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskWithLegacy.java
Outdated
Show resolved
Hide resolved
devmadhuu
left a comment
There was a problem hiding this comment.
Validator looks good. As discussed, With validator , we may not need changes in downstream ReconOmTask classes. You can revert and check logic earlier put.
Add positive and negative test cases for EventValidator.
…rg.apache.hadoop.ozone.om.helpers.OmKeyInfo.
...op-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmUpdateEventValidator.java
Outdated
Show resolved
Hide resolved
|
@ArafatKhan2198 - Pls also update PR description which reflects the current change as no need to do any changes in downstream classes. |
...op-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmUpdateEventValidator.java
Outdated
Show resolved
Hide resolved
...zone/recon/src/test/java/org/apache/hadoop/ozone/recon/tasks/TestOmUpdateEventValidator.java
Outdated
Show resolved
Hide resolved
jojochuang
left a comment
There was a problem hiding this comment.
Looks almost ready. Just a few more nitpicks
...op-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmUpdateEventValidator.java
Outdated
Show resolved
Hide resolved
...op-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmUpdateEventValidator.java
Outdated
Show resolved
Hide resolved
jojochuang
left a comment
There was a problem hiding this comment.
LGTM pending precommit test @devmadhuu @smengcl anything you'd like to add?
...op-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmUpdateEventValidator.java
Outdated
Show resolved
Hide resolved
...op-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmUpdateEventValidator.java
Outdated
Show resolved
Hide resolved
sumitagrawl
left a comment
There was a problem hiding this comment.
@ArafatKhan2198 Thanks for working over this,
We need analyze further with Recon DB available to check why oldValue type is wrong,
- check recon DB
- check from memory if really old value type is wrong for fileTable
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OMDBUpdatesHandler.java
Show resolved
Hide resolved
devmadhuu
left a comment
There was a problem hiding this comment.
@ArafatKhan2198 Thanks for working on this patch. LGTM +1
sumitagrawl
left a comment
There was a problem hiding this comment.
@ArafatKhan2198 LGTM +1
What changes were proposed in this pull request?
This patch aims to address a bug in Recon that triggers an error with the following message: "
org.apache.hadoop.ozone.om.helpers.RepeatedOmKeyInfo cannot be cast to org.apache.hadoop.ozone.om.helpers.OmKeyInfo".The error occurs during event processing in the Recon server, specifically within the
NSSummaryTaskWithFSOclass atline 91. It appears to be a class casting issue, where an object of typeRepeatedOmKeyInfois mistakenly cast asOmKeyInfo.To resolve this bug, we recommend modifying the
OMDBUpdatesHandlerclass responsible for creatingOmdbUpdateEvents. The approach involves ensuring that the events are not created with incorrect object types, as these are considered invalid.To implement this solution, we introduce a new utility class called
OmUpdateEventValidator. This class is designed to validateOMDBUpdateEventsand can be extended for different types of validations. Its purpose is to check the expected value type for a given table against the actual value type provided in the event. If the types do not match, the validation fails, and the even is not consumed.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8310
How was this patch tested?
The existing unit tests passed successfully, and additional unit tests were added to test the validation class.