util/mon: augment "budget exceeded" errors from root monitor with a hint#81859
util/mon: augment "budget exceeded" errors from root monitor with a hint#81859craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
michae2
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @cucaroach, @mgartner, and @yuzefovich)
pkg/util/mon/resource.go line 70 at r1 (raw file):
) error { return pgerror.WithCandidateCode( errors.WithHint(
nit: I believe errors.WithHint is allowed to wrap pgerror.WithCandidateCode, so you could put the latter in newMemoryBudgetExceededError.
This commit adjusts the root SQL memory monitor to return "budget exceeded" errors with a hint about considering increasing the `--max-sql-memory` startup argument. This should hopefully help the users to be a bit more self-sufficient. Here is an example error from SQL shell: ``` ERROR: scan with start key /Table/105/2/0: root: memory budget exceeded: 4198400 bytes requested, 4689920 currently allocated, 8388608 bytes in budget SQLSTATE: 53200 HINT: Consider increasing --max-sql-memory startup parameter. ``` Release note: None
yuzefovich
left a comment
There was a problem hiding this comment.
TFTR!
bors r+
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @cucaroach, @mgartner, and @michae2)
pkg/util/mon/resource.go line 70 at r1 (raw file):
Previously, michae2 (Michael Erickson) wrote…
nit: I believe
errors.WithHintis allowed to wrappgerror.WithCandidateCode, so you could put the latter innewMemoryBudgetExceededError.
Good point, done. I initially was afraid of not having the PG error code on the top-level error (since we expect it, e.g. in disk_spiller.go), but pgerror.GetPGCode still handles things correctly.
|
Build succeeded: |
This commit adjusts the root SQL memory monitor to return "budget
exceeded" errors with a hint about considering increasing the
--max-sql-memorystartup argument. This should hopefully help theusers to be a bit more self-sufficient.
Here is an example error from SQL shell:
Release note: None