HDDS-13822. Add regression testing for OM epoch and txId calculation#9188
HDDS-13822. Add regression testing for OM epoch and txId calculation#9188ivandika3 merged 10 commits intoapache:masterfrom
Conversation
| } | ||
| } | ||
|
|
||
| // Regression tests for OM epoch and txld calculation methods |
There was a problem hiding this comment.
Nit: Let's remove this comment.
| long validTxId = OmUtils.MAX_TRXN_ID; | ||
| // Test valid case - should not throw exception | ||
| try { | ||
| OmUtils.getObjectIdFromTxId(2, validTxId); | ||
| } catch (Exception e) { | ||
| fail("Valid txId should not throw exception: " + e.getMessage()); | ||
| } | ||
|
|
||
| long invalidTxId = OmUtils.MAX_TRXN_ID + 1; |
There was a problem hiding this comment.
Let's use the actual value instead of taking from OmUtils.MAX_TRXN_ID
| String serviceId = "myOmId"; | ||
|
|
||
| conf.set(OZONE_OM_NODES_KEY + "." + serviceId, "omA,omB,omC"); | ||
| conf.set(OZONE_OM_NODES_KEY + "." + serviceId, "omA,omB,omC"); |
|
|
||
| String serviceId2 = "myOmId2"; | ||
| conf.set(OZONE_OM_NODES_KEY + "." + serviceId2, "om1"); | ||
| conf.set(OZONE_OM_NODES_KEY + "." + serviceId2, "om1"); |
|
@ivandika3 , @peterxcli thanks a lot for your feedback!!! I've made changes. |
|
@rich7420 the checkstyle is still failing: https://github.com/rich7420/ozone/actions/runs/18740162208/job/53454664804 |
|
@ivandika3 thanks for your reminding! I've solved the check style error. |
|
@rich7420 Thanks for the update. Looks like |
This reverts commit b39bbc3.
dffc3f5 to
ea60cf4
Compare
ivandika3
left a comment
There was a problem hiding this comment.
Overall looks good, left one comment.
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
Outdated
Show resolved
Hide resolved
ivandika3
left a comment
There was a problem hiding this comment.
Thanks for the update. LGTM +1.
|
@ivandika3 thanks a lot for your suggestions! |
|
Thanks @rich7420 for the patch and @peterxcli for the review. |
What changes were proposed in this pull request?
This PR proposes adding regression tests for the OmUtils class in Apache Ozone. These tests ensure that critical methods handling OM epoch and transaction ID (txId) calculations (specifically getOMEpoch, getObjectIdFromTxId, addEpochToTxId, and getTxIdFromObjectId) maintain their expected behavior and don't introduce regressions with future code changes.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-13822
How was this patch tested?