yihua opened a new issue, #857:
URL: https://github.com/apache/hudi-rs/issues/857

   ## Summary
   
   The native write path mints instant times through a process-wide flag. 
`COMMIT_TIME_IS_LOCAL` in `crates/core/src/write/append.rs` is a `static 
AtomicBool` that every write sets from its table's 
`hoodie.table.timeline.timezone` before minting, and `generate_instant_time` 
formats the instant in whichever zone was set last. The monotonic high-water 
mark `LAST_EPOCH_MILLIS` is process-wide too.
   
   This holds while one writer runs per process, which is the supported mode 
today. It stops holding as soon as two tables with different timeline zones are 
written from one process (a DataFusion server, or Python code with two 
handles): a write to a LOCAL-zone table followed by one to a UTC table formats 
the second table's instant in LOCAL time, and a completion time minted after 
another table's write can land below its own requested time.
   
   The same generator checks monotonicity on epoch millis but formats in local 
time, so across a DST fall-back a later write mints a smaller instant than the 
one before it (`…013000000`, then `…012500000`); the new base file sorts below 
the previous slice and the update is hidden. Java's 
`HoodieInstantTimeGenerator` compares the formatted strings and waits instead.
   
   ## Proposal
   
   Replace the two statics with a generator owned per table handle (or per 
writer), constructed from the table's timeline zone, that compares formatted 
instants when enforcing monotonicity. `set_commit_timezone` and the static flag 
go away, and the reader's default for an unset zone can be aligned with it (the 
reader currently defaults to UTC, Java to LOCAL).
   
   ## Impact
   
   - Storage: none. Instants keep the `yyyyMMddHHmmssSSS` form and the zone the 
table declares; only who owns the clock changes.
   - Public API: none expected; the generator is `pub(crate)`.
   - Tests: the flaky-test workaround that set the zone per process goes with 
it.
   
   Raised in the #666 review follow-up list (item 3). Deferred from that PR 
because a single writer per process is all that is supported for now.
   


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