[BugFix] Relax DB lock to intensive path in qe/ read-only paths (backport #73067)#73189
Conversation
Signed-off-by: Kevin Cai <kevin.cai@celerdata.com> (cherry picked from commit c15972b) # Conflicts: # fe/fe-core/src/main/java/com/starrocks/qe/ShowExecutor.java
|
Cherry-pick of c15972b has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr |
|
@copilot try to fix the backport code conflict, strict to only the necessary code change from main branch. |
Agent-Logs-Url: https://github.com/StarRocks/starrocks/sessions/d259b835-cf31-40c2-b812-8e47115ec482 Co-authored-by: kevincai <771299+kevincai@users.noreply.github.com>
Head branch was pushed to by a user without write access
Agent-Logs-Url: https://github.com/StarRocks/starrocks/sessions/d259b835-cf31-40c2-b812-8e47115ec482 Co-authored-by: kevincai <771299+kevincai@users.noreply.github.com>
Agent-Logs-Url: https://github.com/StarRocks/starrocks/sessions/d259b835-cf31-40c2-b812-8e47115ec482 Co-authored-by: kevincai <771299+kevincai@users.noreply.github.com>
Fixed in c58189c. I resolved the ShowExecutor backport conflict by keeping only the branch-4.0-adapted lock-relaxation changes from main, removing the leftover conflict artifacts, and keeping the sync MV fallback protected with a DB read lock. |
Signed-off-by: Kevin Cai <kevin.cai@celerdata.com>
Switch four single-table read paths in qe/ from full DB READ to IS+table-READ via lockTableWithIntensiveDbLock so they no longer block concurrent DDL on other tables in the same database.
The revalidation closes a TOCTOU window: under the old DB READ, DROP/RENAME could not interleave between lookup and use; under IS+table-READ the lookup is unprotected so the resolved Table can be removed from the DB before the lock is taken. Re-fetching by id after locking and comparing references catches that window and reports the table as not-found, matching the old semantics.
Why I'm doing:
What I'm doing:
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check:
This is an automatic backport of pull request #73067 done by [Mergify](https://mergify.com).