rangareddy opened a new pull request, #19865:
URL: https://github.com/apache/hudi/pull/19865

   ### Describe the issue this Pull Request addresses
   
   Closes #17333 (https://issues.apache.org/jira/browse/HUDI-8686).
   
   `TestClusteringUtils#testClusteringPlanInflight` was disabled with:
   
   ```java
   @Disabled("Will fail due to avro issue AVRO-3789. This is fixed in avro 
1.11.3")
   ```
   
   The root `pom.xml` now pins `<avro.version>1.11.4</avro.version>`, so the 
stated reason no longer applies. Removing the annotation alone does **not** 
make the test pass, though. It fails with:
   
   ```
   java.lang.IllegalArgumentException
     at 
org.apache.hudi.common.util.ValidationUtils.checkArgument(ValidationUtils.java:33)
     at 
org.apache.hudi.common.table.timeline.versioning.v2.ActiveTimelineV2.transitionReplaceRequestedToInflight(ActiveTimelineV2.java:476)
     at 
org.apache.hudi.common.util.TestClusteringUtils.testClusteringPlanInflight(TestClusteringUtils.java:183)
   ```
   
   which has nothing to do with avro. `createRequestedClusterInstant` builds 
the instant with `CLUSTERING_ACTION`:
   
   ```java
   HoodieInstant clusteringInstant = 
INSTANT_GENERATOR.createNewInstant(HoodieInstant.State.REQUESTED, 
HoodieTimeline.CLUSTERING_ACTION, clusterTime);
   ```
   
   while the test transitioned it through 
`transitionReplaceRequestedToInflight`, whose first precondition is that the 
action *is* `REPLACE_COMMIT`:
   
   ```java
   
ValidationUtils.checkArgument(requestedInstant.getAction().equals(HoodieTimeline.REPLACE_COMMIT_ACTION));
   ```
   
   Clustering gained its own timeline action, so the replace-commit transition 
is no longer correct for a clustering instant. 
`testGetOldestInstantToRetainForClustering`, in the same class and on the same 
kind of instant, already uses `transitionClusterRequestedToInflight`.
   
   ### Summary and Changelog
   
   `TestClusteringUtils` no longer skips a case, so the behaviour it covers is 
verified again: that an inflight clustering instant carries no plan in its own 
file, and `ClusteringUtils.getClusteringPlan` therefore has to read it from the 
corresponding requested file.
   
   - `TestClusteringUtils#testClusteringPlanInflight`: dropped `@Disabled` and 
the now-unused `Disabled` import; switched the transition to 
`transitionClusterRequestedToInflight`.
   - Corrected the comment above the test, which said `replacecommit.inflight`.
   
   No production code touched. No code was copied.
   
   ### Impact
   
   Test-only. One previously skipped test now runs; no existing test is 
modified.
   
   Worth stating plainly since it changes what the ticket is about: the avro 
reason recorded on the annotation was stale, and the real blocker was the 
timeline action split. Anyone re-enabling this by deleting the annotation alone 
would hit a failure that looks unrelated to the note explaining the skip.
   
   ### Risk Level
   
   none
   
   Verified on Spark 3.5 / Scala 2.12:
   
   - `mvn test -pl hudi-hadoop-common -Dtest=TestClusteringUtils` -> `Tests 
run: 11, Failures: 0, Errors: 0, Skipped: 0` (previously 11 run with 1 skipped)
   - `mvn test-compile checkstyle:check -pl hudi-hadoop-common` -> clean
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   


-- 
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]

Reply via email to