mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-28 05:34:02 +00:00
A scoped request could derive a new flow pool on every engine_context call: the DML input path re-enters the engine, and the computed semantic-graph tables capture the context during table resolution and re-enter with it later, so one logical request could hold several full budgets. Resolve the scope once at the request entry (gRPC do_query and the SQL path) by forking the context and recording the scope, keeping engine_context as a safety net for paths that bypass the entry. The scope resolution is single-sourced in flow_memory_scope_for/ with_flow_memory_scope, explicit scopes still win, and requests without a budget are returned unchanged. Also bound the malformed-budget warning: truncate the client-supplied value and emit at most one warning per flow id and value per minute, and state precisely that the aggregate node bound is a Greedy-policy property and that DataFusion's infallible grow is charged but never rejected. Signed-off-by: discord9 <discord9@163.com>