tkhurana opened a new pull request, #2434: URL: https://github.com/apache/phoenix/pull/2434
## Summary - Make the replication log writer's sync durability configurable via the existing `hbase.wal.hsync` HBase property (default `false`, matching `HRegion.DEFAULT_WAL_HSYNC`). - When `hbase.wal.hsync=true`, `sync()` calls `hsync()` (forces fsync to disk). When `false` (the default), it calls `hflush()` (flushes to datanode memory only), trading durability for lower latency. - Plumbs the flag through `LogFileWriterContext` into both `HDFSDataOutput` and `AsyncFSDataOutput`, which previously hard-coded `hsync()` in `sync()`. ## Changes - `LogFileWriterContext`: read `hbase.wal.hsync` from config (defaults to `HRegion.DEFAULT_WAL_HSYNC` = `false`); add `getUseHsync()`/`setUseHsync()`; include `useHsync` in `toString()`. - `HDFSDataOutput` / `AsyncFSDataOutput`: accept `useHsync` in constructor; `sync()` dispatches to `hsync()` or `hflush()` based on the flag. - `LogFileWriter`: propagate `context.getUseHsync()` when constructing `HDFSDataOutput`. - Tests: `LogFileFormatTest` updated for the new constructor arg; `LogFileWriterSyncTest` adds `testSyncWithHflush` and sets `hbase.wal.hsync=true` explicitly in the existing hsync test. ## Test plan - [x] `mvn test -pl phoenix-core -Dtest=LogFileWriterSyncTest` — 5/5 pass - [x] `mvn test -pl phoenix-core -Dtest=LogFileFormatTest` — 16/16 pass - [x] `mvn spotless:apply` clean -- 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]
