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

   ### What problem does this PR solve?
   
   Related PR: #63920
   
   A prepared short-circuit query can pass context reuse validation before 
partition DDL commits. The same cached scan then re-prunes without a table 
lock: its 10-second RANGE cache can retain obsolete partition routes, and DROP 
between partition pruning and tablet lookup can dereference a null partition.
   
   Hold the table read lock across local routing and cloud partition reference 
selection. Invalidate the RANGE cache using the existing table topology 
generation and partition-map identity. Fetch optional cloud snapshot versions 
after releasing the lock; cloud point queries leave empty-result detection to 
BE and avoid the unused scan-range version lookup, so those paths do not 
introduce MS version RPCs under the routing lock.
   
   Validation:
   - Unmodified master `4bc7f426828e`: three deterministic FE reproductions 
fail — ADD/TRUNCATE select zero tablets from a warm cache, and a threaded DROP 
between pruning and tablet lookup causes a null partition dereference.
   - Fixed code: 79 targeted FE tests across nine classes pass (71 related 
cases plus eight final routing cases). Coverage includes RANGE/LIST DROP 
interleavings, cache invalidation/stable reuse, cloud snapshot configuration 
on/off, and unlock on empty/failed routing.
   - `./build.sh --fe` succeeds; Checkstyle reports zero violations. Worktree 
build disables UI and BE Java-extension packaging.
   - Validation uses the FE catalog/planner test service; cloud version calls 
are mocked. No live BE or real cloud Meta Service regression was run.
   
   ### Release note
   
   Fix short-circuit point queries racing with partition ADD, DROP and TRUNCATE.
   
   ### Check List (For Author)
   
   - Test:
       - [x] Unit Test
   - Behavior changed:
       - [x] Yes. Point-query routing observes a consistent partition topology, 
and RANGE cache invalidation follows topology changes.
   - Does this need documentation?
       - [x] No.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label
   


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