Commit 1240a7e
waterWang
fix: bound the usage event rewind to prevent unbounded re-aggregation
UsageManagerImpl.parse() rewinds the aggregation start date to the
oldest unprocessed event, but has no bound on how far back it can go.
If an event cannot be successfully processed (e.g. references a removed
entity), the rewind pins the window to that event's date permanently.
Each subsequent run re-aggregates from that date to the present, growing
by one aggregation period per run. This causes unbounded growth of
cloud_usage (54M+ rows reported) and exec_time (42+ minutes per hour).
Fix: bound the rewind to 24 hours. The rewind exists to absorb clock
skew between the cloud and usage databases, not to replay history.
Events older than 24 hours from the current window start will still be
retried, but the aggregation window will not be rewound to them.
Fixes #13906
Signed-off-by: waterWang <waterwang@proton.me>1 parent d45d481 commit 1240a7e
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
699 | 700 | | |
700 | 701 | | |
701 | 702 | | |
702 | | - | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
703 | 707 | | |
704 | 708 | | |
705 | 709 | | |
| |||
0 commit comments