Davis-Zhang-Onehouse opened a new pull request, #19042:
URL: https://github.com/apache/hudi/pull/19042

   ### Change Logs
   
   A `HoodieTable` created per table-service work unit on the driver lazily 
builds a `FileSystemViewManager`. For a `SPILLABLE_DISK` view the file-group 
store spills to an on-disk `BitCaskDiskMap` (which registers a JVM shutdown 
hook). `HoodieTable` had no `close()`, and the per-cycle tables created in 
`BaseHoodieTableServiceClient` were never closed, so their cached views' 
on-disk maps lingered until JVM exit.
   
   - `HoodieTable` now implements `AutoCloseable`; `close()` releases the 
`FileSystemViewManager` and the table metadata reader (idempotent, never 
throws).
   - Every create-use-drop `HoodieTable` in `BaseHoodieTableServiceClient` is 
wrapped in try-with-resources / try-finally: `preCommit`, `logCompact`, 
`compact`, `cluster`, `scheduleTableServiceInternal`, `scheduleCleaning`, 
`purgePendingClustering`, `clean`, `rollbackFailedIndexingCommits`, `rollback`, 
`rollbackFailedBootstrap`. (`commitCompaction`/`commitLogCompaction` are left 
alone — they receive an `Option<HoodieTable>` that may be caller-owned.)
   - `SpillableMapBasedFileSystemView` now drains its `ExternalSpillableMap`s 
from `closeResources()` — under the `AbstractTableFileSystemView` `writeLock` — 
instead of from `close()` before the lock. This releases the on-disk maps while 
still referenced and without racing a concurrent reader.
   - Adds `TestHoodieTableResourceLifecycle` verifying that 
`HoodieTable.close()` releases the spillable view's on-disk `BitCaskDiskMap`.
   
   ### Impact
   
   Promptly frees per-cycle driver-side file-system view resources instead of 
leaving them until JVM exit. No behavior change to table-service results.
   
   ### Risk level: low
   
   Lifecycle change covered by existing file-system-view close tests plus the 
new test.
   
   ### Companion internal PR
   
   This is kept code-consistent with the Onehouse-internal companion 
(onehouseinc/hudi-internal#1959). The internal repo additionally needs the 
`closeResources()` ordering fix as an actual bug fix (its 
`SpillableMapBasedFileSystemView` overrides `closeResources()` and was calling 
`super` first, nulling the map fields before draining them); here the same 
drain-before-super ordering is applied for the writeLock benefit.
   
   ### Documentation Update
   
   None.
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Change Logs and Impact were stated clearly
   - [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]

  • [PR] [MINOR] Make HoodieTabl... Davis-Zhang-Onehouse (via GitHub) via commits

Reply via email to