Commit 80d2a76
authored
fix: enable timely stats update to avoid large row count estimation deviation (#23692)
After the stats refactoring, when multiple secondary indexes are created concurrently, the planner observes a smaller `Stats.OutCnt` because global stats were not updated in time on data object (block) changes. The upgrade-to-table-lock condition (`Stats.OutCnt >= MaxRowLockCount`) is then never reached, so the system keeps acquiring row locks and can accumulate ~100M row locks causing OOM (see issue #23689).
This change treats data object logtail entries (`api.Entry_DataObject`) as meta-changing in `processLogtail`, in addition to existing meta entries. When blocks/data objects change, they are counted as meta changes and can trigger stats refresh (subject to existing rate limiting in `shouldEnqueueUpdate`). Stats then reflect table size more timely and row count estimation deviation is reduced, so the planner can correctly upgrade to table lock and avoid excessive row locks.
Approved by: @gouhongshen1 parent 1114025 commit 80d2a76
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
486 | 487 | | |
487 | 488 | | |
488 | 489 | | |
489 | | - | |
| 490 | + | |
490 | 491 | | |
491 | 492 | | |
492 | 493 | | |
| |||
0 commit comments