slachiewicz opened a new issue, #909:
URL: https://github.com/apache/incubator-xtable/issues/909

   ### Search before asking
   
   I searched the open and closed issues; nothing covers this.
   
   ### Describe the problem
   
   Five integration tests fail on a developer machine whose JVM default 
timezone is not UTC, and pass on CI, which runs UTC. On Europe/Warsaw (UTC+2) 
they fail on every run, not intermittently.
   
   - `ITHudiConversionSource#insertAndUpsertData[3]`, `[4]`
   - `ITHudiConversionSource#testsForClustering[3]`, `[4]`
   - `ITHudiConversionSource#testsForDeleteAllRecordsInPartition[2]`
   - `ITConversionController#testConcurrentInsertsAndTableServiceWrites`, all 
four parameters
   
   Every failure is the same call, and only the MERGE_ON_READ parameters reach 
it:
   
   ```
   java.util.NoSuchElementException: No value present in Option
        at org.apache.hudi.common.util.Option.get(Option.java:93)
        at 
org.apache.xtable.TestAbstractHudiTable.onlyScheduleCompaction(TestAbstractHudiTable.java:321)
        at 
org.apache.xtable.TestAbstractHudiTable.compact(TestAbstractHudiTable.java:315)
   ```
   
   `scheduleCompaction` returns an empty `Option`, meaning Hudi found nothing 
to compact, and the helper calls `get()` on it unguarded.
   
   ### Root cause
   
   The test tables carry `hoodie.table.timeline.timezone=UTC`, while the JVM 
runs in the developer's zone. Hudi 1.2's `BaseHoodieCompactionPlanGenerator` 
keeps a file slice only if the slice still has log files after this filter:
   
   ```java
   return s.filterLogFiles(logFile ->
       completionTimeQueryView.isCompletedBefore(compactionInstant, 
logFile.getDeltaCommitTime()));
   ...
   .filter(FileSlice::hasLogFiles)
   ```
   
   Under a non-UTC zone that comparison rejects every log file, so the planner 
reports an empty plan:
   
   ```
   Strategy: LogFileSizeBasedCompactionStrategy matched 1 partition paths from 
all 1 partitions
   Last completed instant time 20260823110245921
   Total of 0 compaction operations are retrieved
   Total number of log files 0
   Total number of file slices 0
   No operations are retrieved for ...
   ```
   
   The log files are on disk at that moment. Walking the table directory when 
the failure happens shows a compactable slice in every failing table, for 
example:
   
   ```
   INFO/6bc38679-...-0_0-0-0_20260823111818482.parquet
   INFO/.6bc38679-...-0_20260823111818482.log.1_0-0-0
   .hoodie/20260823111818482.deltacommit
   .hoodie/20260823111830337.deltacommit
   .hoodie/20260823111833469.deltacommit
   ```
   
   Running the same tests with `TZ=UTC` and no other change makes all of them 
pass, which is what CI does implicitly.
   
   ### What this is not
   
   Ruled out by experiment, in case someone lands here from a similar symptom:
   
   - JUnit parallel execution, which `junit-platform.properties` enables. 
Disabling it changes nothing.
   - The Hudi metadata table. Building the write config with 
`HoodieMetadataConfig.enable(false)` changes nothing.
   - The macOS `/var/folders` temp symlink.
   - A stale timeline. Calling `metaClient.reloadActiveTimeline()` and 
scheduling again still returns empty, so it is deterministic rather than a race.
   
   ### Suggested fix
   
   Pin the test JVMs to UTC in the surefire and failsafe configuration of the 
root pom, so the suite does not depend on the contributor's zone. CI is 
unaffected, since it already runs UTC.
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   
   *This issue was created with AI assistance.*
   


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