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

   ### Describe the issue this Pull Request addresses
   
   Several table upgrade/downgrade handlers, async-index actions, and 
bucket-index utilities in `hudi-client-common` had significant line-coverage 
gaps. Critical paths such as legacy table-version transitions, index catch-up 
with concurrent commits, abort cleanup, bucket assignment, and 
consistent-hashing metadata recovery were not exercised directly.
   
   This PR adds focused unit and fixture-backed coverage for those paths 
without changing production code, public APIs, configuration, or storage 
formats.
   
   ### Summary and Changelog
   
   - Add legacy handler tests for `ZeroToOneUpgradeHandler`, 
`TwoToOneDowngradeHandler`, `FourToFiveUpgradeHandler`, and 
`FiveToSixUpgradeHandler`, including config and file-layout transitions and 
failure paths.
   - Extend `TestUpgradeDowngrade` with fixture-backed v4-to-v5 and v5-to-v6 
upgrades and verify data consistency after each transition.
   - Exercise `UpgradeDowngrade` version-hop orchestration, rollback/compaction 
selection, property changes, no-op validation, and failure handling.
   - Exercise async index scheduling, execution, concurrent-commit catch-up, 
metadata partition initialization, and partial-index cleanup.
   - Add direct coverage for simple bucket assignment/lookup and 
consistent-hashing metadata load, save, marker repair, and concurrent-creation 
recovery.
   - No code was copied.
   
   Per-class line coverage:
   
   | Class | Before (Codecov) | After (focused JaCoCo) |
   | --- | ---: | ---: |
   | `ZeroToOneUpgradeHandler` | 0% | 87.8% |
   | `TwoToOneDowngradeHandler` | 0% | 88.6% |
   | `FourToFiveUpgradeHandler` | 0% | 100.0% |
   | `FiveToSixUpgradeHandler` | 0% | 100.0% |
   | `UpgradeDowngrade` | 76% | 75.1%* |
   | `AbstractIndexingCatchupTask` | 42% | 88.4% |
   | `RunIndexActionExecutor` | 72% | 94.6% |
   | `ScheduleIndexActionExecutor` | 69% | 86.4% |
   | `HoodieSimpleBucketIndex` | 46% | 100.0% |
   | `ConsistentBucketIndexUtils` | 76% | 78.8% |
   
   \* The focused report excludes pre-existing suites; merged Codecov coverage 
retains their existing contribution.
   
   Validation:
   
   - `mvn -pl hudi-client/hudi-client-common -Punit-tests -Drat.skip=true 
-Dtest=TestLegacyUpgradeDowngradeHandlers,TestIndexingCatchupTask,TestIndexActionExecutors,TestHoodieSimpleBucketIndex,TestConsistentBucketIndexUtils,TestUpgradeDowngradeOrchestration
 test` — 46 tests passed.
   - `mvn -pl hudi-spark-datasource/hudi-spark -Dcheckstyle.skip 
-Drat.skip=true -Djacoco.skip=true 
-Dtest=TestUpgradeDowngrade#testLegacyUpgradeHandlersWithFixtureTables 
surefire:test` — 2 tests passed.
   - `mvn -pl hudi-client/hudi-client-common checkstyle:check` — 0 violations.
   - `mvn -pl hudi-spark-datasource/hudi-spark checkstyle:check` — 0 violations.
   - `git diff --check` — passed.
   
   ### Impact
   
   Test-only change. There is no public API, configuration, storage-format, 
user-facing behavior, or performance impact.
   
   ### Risk Level
   
   low
   
   The change only adds and extends tests. Focused unit and Spark fixture tests 
passed, and both affected modules pass Checkstyle.
   
   ### Documentation Update
   
   none — this PR does not add or change features, configuration, APIs, or 
user-facing behavior.
   
   ### 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