citusdata / citusdata/citus

rename `get_all_active_transactions` -> `get_all_active_distributed_executions` or such

Open
#5,283 0 comments 0 reactions 0 assignees View on GitHub
mx refactor
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.