rename `get_all_active_transactions` -> `get_all_active_distributed_executions` or such
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
It turns out that `get_all_active_transactions()` is actually returning all the distributed executions. We only skip backends that do not have `nodeInitiator` in the backendData:
```C
/* we're only interested in backends initiated by Citus */
if (currentBackend->citusBackend.initiatorNodeIdentifier < 0)
{
SpinLockRelease(¤tBackend->mutex);
continue;
}
```
And, we set `(currentBackend->citusBackend.initiatorNodeIdentifier` at `CitusBeginScan->MarkCitusInitiatedCoordinatorBackend`, meaning that all the distributed executions are listed.
We should also go over various comments/function names (e.g,` get_global_active_transactions()`) etc and reflect this.
The following comment should also be improved as it is not true anymore (e.g., all the distributed executions show up here):
```
* An important note on this views is that they only show the activity
* that are inside distributed transactions. Distributed transactions
* cover the following:
* - All multi-shard modifications (DDLs, COPY, UPDATE, DELETE, INSERT .. SELECT)
* - All multi-shard queries with CTEs (modifying CTEs, read-only CTEs)
* - All recursively planned subqueries
* - All queries within transaction blocks (BEGIN; query; COMMIT;)
*
* In other words, the following types of queries won't be observed in these
* views:
* - Single-shard queries that are not inside transaction blocks
* - Multi-shard select queries that are not inside transaction blocks
* - Task-tracker queries
```
Contributor guide
Assessment
This issue has not been assessed yet.