forked from cockroachdb/cockroach
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
distsql: restore EvalCtx.Mon on the flow cleanup
In `setupFlow`, if we're setting up a flow on the gateway, we're using `LocalState` to save on deserialization of some state. Notably, we pass the eval context that we used during the physical planning. That eval context can be mutated (in particular, we're updating its `Mon` field to the "flow" memory monitor), and previously this could cause issues when automatically retrying stats collection jobs (possibly there could be other issues). This commit introduces a callback to restore the local eval context to its original state which is done on the flow cleanup. Release note (bug fix): Previously, table stats collection issued via `ANALYZE` statement or via `CREATE STATISTICS` statement without specifying `AS OF SYSTEM TIME` option could run into `flow: memory budget exceeded`, and this has been fixed. Release justification: fix to a long standing bug.
- Loading branch information
1 parent
6859359
commit 034c189
Showing
3 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters