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

   ### Background
   
   The FE estimates a table's row count from the last analysis and the rows 
loaded since then. A reader needs the collected count and its baseline from the 
same snapshot. `TableStatsMetaTest.testRowCountSnapshotIsCoherent` checks this 
while another thread publishes analyses.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #69028 (introduced the snapshot test)
   PR Type: Test
   
   Problem Summary:
   
   The snapshot test intermittently exhausts the 1 GiB Surefire heap. Use a 
stub-only table mock and run one read and one update per round for 5,000 
rounds. The writer alternates two snapshots that both yield 150 rows, so a 
reader that mixes their fields can now observe 130 or 170. Reader exceptions 
propagate to JUnit.
   
   ### Details
   
   - **Failure:** In a failing community FEUT run, both the reader and writer 
threw `OutOfMemoryError: Java heap space` while calling the mocked 
`OlapTable.getBaseIndexId()`. Surefire produced no XML for the class.
   - **Cause:** The original reader loop had no iteration limit. It repeatedly 
called a getter on an ordinary Mockito mock until the writer finished 5,000 
updates. Mockito retained each call, even though the getter always returned the 
same value. In a local 1 GiB reproduction, the heap dump showed 2,136,117 
entries in one mock invocation list.
   - **Stability evidence:** A local pressure test issued 1,000 reads per 
update using the FEUT classpath. The original fixture retained 502,015 calls 
after 500,000 reads and later ran out of heap. The fixed fixture completed all 
5,000,000 reads with zero recorded calls.
   
   ### Testing
   
   - Ran `bash run-fe-ut.sh --coverage --run 
'org.apache.doris.statistics.analysis.TableStatsMetaTest#testRowCountSnapshotIsCoherent'`
 locally on JDK 17 with one fork and `-Xmx1024m`. The Maven build passed. All 
15 tests in the class also passed using the Surefire classpath, and the target 
method passed in five fresh JVMs.
   - Reverted only `stubOnly()` locally. The new history assertion failed with 
25,014 recorded calls. In a separate run, removing synchronization from 
`getRowCountWithDeltaRows()` made JUnit report 130 rows where it expected 150.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Ready
   
   ### AI Disclosure
   
   - Tool: OpenAI Codex (GPT-6)
   - Generated: The test change, local validation probes, 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