{"record":{"id":"4c25c2d041968d98","repo":"pingcap/tidb","slug":"out-of-unknown-resource-quota","errorCode":null,"errorMessage":"Out of Unknown Resource Quota!","messagePattern":"Out of Unknown Resource Quota!","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/executor/select.go","lineNumber":182,"sourceCode":"}\n\n// Action panics when storage usage exceeds storage quota.\nfunc (a *globalPanicOnExceed) Action(t *memory.Tracker) {\n\ta.mutex.Lock()\n\tdefer a.mutex.Unlock()\n\tmsg := \"\"\n\tswitch t.Label() {\n\tcase memory.LabelForGlobalStorage:\n\t\tmsg = globalPanicStorageExceed\n\tcase memory.LabelForGlobalMemory:\n\t\tmsg = globalPanicMemoryExceed\n\tcase memory.LabelForGlobalAnalyzeMemory:\n\t\tmsg = globalPanicAnalyzeMemoryExceed\n\tdefault:\n\t\tmsg = \"Out of Unknown Resource Quota!\"\n\t}\n\t// TODO(hawkingrei): should return error instead.\n\tpanic(msg)\n}\n\n// GetPriority get the priority of the Action\nfunc (*globalPanicOnExceed) GetPriority() int64 {\n\treturn memory.DefPanicPriority\n}\n\n// SelectLockExec represents a select lock executor.\n// It is built from the \"SELECT .. FOR UPDATE\" or the \"SELECT .. LOCK IN SHARE MODE\" statement.\n// For \"SELECT .. FOR UPDATE\" statement, it locks every row key from source Executor.\n// After the execution, the keys are buffered in transaction, and will be sent to KV\n// when doing commit. If there is any key already locked by another transaction,\n// the transaction will rollback and retry.\ntype SelectLockExec struct {\n\texec.BaseExecutor\n\n\tLock *ast.SelectLockInfo\n\tkeys []kv.Key","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/pingcap/tidb/blob/d01f9615c13e02dfa75922745640dec9d81b802e/pkg/executor/select.go#L164-L200","documentation":"The default arm of the same switch in globalPanicOnExceed (pkg/executor/select.go): the triggered tracker's Label() is none of GlobalStorage/GlobalMemory/GlobalAnalyzeMemory, so TiDB cannot name the resource and panics with 'Out of Unknown Resource Quota!'. Reaching it means a quota-exceeded action was attached to a global tracker that forgot to set a recognized label - an internal invariant break, not a user workload property.","triggerScenarios":"Any global tracker with a missing/unmapped label reaching its quota and running the panic action: essentially only when new TiDB code registers a tracker without LabelForGlobal* or an old binary loads mismatched tracker state. No supported user configuration produces it.","commonSituations":"Nightly or early releases where a new global quota shipped without a label case; plugins/experimental features registering global trackers; essentially never in supported GA versions.","solutions":["Upgrade to a patched TiDB version where every global quota tracker sets a recognized label.","Collect the panic stack (it identifies the tracker) and report it at github.com/pingcap/tidb.","As a stopgap, relax global memory/storage quotas so no tracker hits the panic action."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// this panic indicates an internal bug; catch at the driver level, record the\n// stack, and restart/reconnect the session - no query-level fix exists\nif strings.Contains(err.Error(), \"Out of Unknown Resource Quota!\") {\n    log.Stack(err) // report upstream; retry on a fresh connection","preventionTips":["Run supported GA TiDB versions; avoid nightlies for production.","Keep global quotas generous enough that trackers never reach the panic action.","Capture full stacks of such panics for the bug report."],"tags":["tidb","memory","quota","internal","panic"],"backgroundTag":null,"analyzedSha":"d01f9615c13e02dfa75922745640dec9d81b802e","analyzedAt":"2026-08-15T12:19:33.324Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}