-
Notifications
You must be signed in to change notification settings - Fork 4.1k
rowexec: tableReader can be accessed after being Released #88964
Description
Found when working on #88608.
Currently we have an issue where a tableReader (the only row-by-row processor allocation of which is sync.Pooled) can be accessed even after it has been Released. In particular, this could occur if the tableReader is part of the subquery tree with rowSourceToPlanNode adapter having it as input. We defer the closure of the subquery planNode tree until after the main query is executed, and rowSourceToPlanNode.Close calls ConsumerClosed on its input. However, the processors from the subquery are released when the subquery execution finishes, so that ConsumerClosed call can occur on a processor that was already put back into the pool (and possibly even picked up from the pool by another query).
This is a very old issue (dating at least to #38866), and with the move to the vectorized engine we are now unlikely to use the table reader processor. However, #88608 wanted to pool more processors, so the issue becomes more pressing.
Jira issue: CRDB-20057
Metadata
Metadata
Assignees
Labels
Type
Projects
Status