sollhui opened a new pull request, #70916:
URL: https://github.com/apache/doris/pull/70916

   ### Background
   
   Async Group Commit requests append blocks to a shared BE-local WAL. A 
request can complete while the internal transaction is still collecting data. 
On Linux, a successful write can leave the WAL record in the kernel page cache.
   
   ### What problem does this PR solve?
   
   Issue Number: None  
   Related PR: None  
   PR Type: Bugfix
   
   A host crash after a successful response can discard WAL data needed to 
recover an uncommitted load. Require the receiving BE to sync the open WAL 
before releasing an async request at end of input, independently of the 
close-time sync configuration.
   
   ### Details
   
   - **Frequency:** The durability window exists for async loads whose records 
have yet to reach stable storage or commit.
   - **Root cause:** The request finished after appending its blocks, while the 
explicit sync ran during batch close.
   - **Why existing tests missed it:** A process restart leaves kernel-cached 
WAL data available.
   - **Fix:** Sync the file descriptor at request completion under the queue 
lock used for appends. The first sync also persists the file's entry in its 
immediate parent directory. Later requests can reuse a successful sync if it 
already covered their last append. On failure, cancel the queue and propagate 
the error to the client.
   - **Other paths and branches:** Stream Load and INSERT use the same sink. 
The decision follows the effective group commit mode after the WAL-space check. 
Cleanup of abandoned requests uses the existing removal path.
   
   ### Testing
   
   - Passed clang-format 16 on all changed C++ files, the BE build hygiene 
checks and git diff whitespace checks.
   - Added an async INSERT regression that injects a WAL sync error and 
requires the client to receive it.
   - Updated the incomplete-tail WAL reader test to sync the first record 
before appending the second record.
   - The local BE build stopped before compilation because the configured JDK 
17 installation lacks lib/modules. The BE unit and cluster regression tests 
have not run locally.
   
   ### Release note
   
   Async Group Commit waits for a WAL sync before acknowledging writes. This 
adds storage latency to request completion and may reduce throughput for 
frequent small requests sharing a queue.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes, as described above.
   - Does this need documentation: Yes. The async mode documentation should 
mention the WAL sync before acknowledgement.
   - Pre-submission status: Partially verified. BE build and runtime tests 
require CI.
   
   ### AI Disclosure
   
   - Tool: OpenAI Codex
   - Generated: Implementation, tests and PR description
   - Human review: Pending
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to