Skip to content

colflow: hash router output can leak disk resources when not fully exhausted #81490

@yuzefovich

Description

@yuzefovich

Currently, it is possible that the disk-backed spilling queue used by hash router outputs is not closed when the hash router exits. Namely, this can occur if the router output is not fully exhausted (i.e. it can still produce more batches), but the consumer of the router output is satisfied and calls DrainMeta. In such a scenario, routerOutput.closeLocked is never called because a zero-length batch is never given to addBatch nor the output is canceled due to an error. The flow cleanup also doesn't save us because the router outputs are not added into ToClose slice. The bug has been present for several years.

Jira issue: CRDB-15161

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-queriesSQL Queries Team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions