-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Replication
-
Fully Compatible
-
Repl 2026-08-31, Repl 2026-09-14, Repl 2026-09-28, Repl 2026-10-12
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Investigate transaction metrics when a shard acts as a subrouter and recruits additional participants. Verify whether the originating internal/external classification is propagated; currently, recruited participants may be misclassified as external.
Acceptance criteria:
- Add a subrouter jstest eg. covering $lookup/$graphLookup within a transaction
- If misclassification is confirmed, add regression-covered handling; otherwise, document the expected metric skew and rationale
This ticket will cover P4 of work needed to make internal/external classification work for prepared transactions.
A shard can sometimes act as a “subrouter” when, partway through a transaction, it needs a collection that lives on other shards and routes to them itself instead of returning to mongos. It reports the shards it recruited back to mongos in an “additionalParticipants” list. The only commands that trigger this are $lookup and $graphLookup, and only when already inside a multi-document transaction. If not in a transaction, a cross-shard $lookup would perform an ordinary read against the foreign collection.
With no additional logic, all participants added by a subrouter would not receive the isServerInitiatedTransaction: true flag along with their startTransaction: true flag, and would instead rely on the session check and ultimately always classify as external.
In order to avoid this, we will need to save the classification from the TransactionParticipant state and read it from the same node’s TransactionRouter subrouter logic.
This PR completes the implementation of internal and external differentiation for multi-shard transactions.
- action item for
-
SERVER-130727 Investigate if we should add internal vs. external classification to transactions
-
- Blocked
-
- related to
-
SERVER-135398 Parse isServerInitiatedTransaction on shard participants and split prepared transaction metrics
-
- Closed
-