Skip to content

[#16670] dist-trace: carry trace context across task and Raft-apply thread hops - #16

Open
ellabaron-code wants to merge 1 commit into
dist-trace-04-rpc-propagationfrom
dist-trace-05-task-scope-carry
Open

[#16670] dist-trace: carry trace context across task and Raft-apply thread hops#16
ellabaron-code wants to merge 1 commit into
dist-trace-04-rpc-propagationfrom
dist-trace-05-task-scope-carry

Conversation

@ellabaron-code

Copy link
Copy Markdown

Same capture/re-activate pattern as the async scope-carry infra, applied
to the higher-level task types whose work runs on a different thread than
the one that triggered it. Each snapshots dist_trace::GetActiveSpanContext()
where the scope is still live and re-establishes it with ActivateParentScope
around the deferred run, so the work's RPCs nest under the triggering trace.

  • tablet/operation_driver: OperationDriver captures at construction,
    re-activates in ApplyTask (APPLYING/APPLIED UpdateTransaction RPCs on
    the Raft apply thread).
  • master/async_rpc_tasks_base: RetryingRpcTask captures at construction,
    re-activates at the top of Run().
  • master/multi_step_monitored_task: captures at construction, re-activates
    in RunInternal before each step.
  • tserver/tablet_validator: captures per scheduled index (carried from the
    CreateTablet RPC into OpenTablet), re-activates the first batched index's
    context around the GetBackfillStatus poll.

Purely additive; all no-ops when the captured context is invalid.

@ellabaron-code

Copy link
Copy Markdown
Author

Misfiled: reopening against yugabyte/yugabyte-db.

@ellabaron-code
ellabaron-code force-pushed the dist-trace-05-task-scope-carry branch from 7ae5483 to 43f7c29 Compare July 11, 2026 02:15
@ellabaron-code
ellabaron-code force-pushed the dist-trace-04-rpc-propagation branch from 98034dc to 26c89ff Compare July 11, 2026 02:15
@ellabaron-code ellabaron-code changed the title dist-trace: carry trace context across task and Raft-apply thread hops [#16670] dist-trace: carry trace context across task and Raft-apply thread hops Jul 11, 2026
@ellabaron-code
ellabaron-code force-pushed the dist-trace-04-rpc-propagation branch from 26c89ff to ee1cfe9 Compare July 13, 2026 15:13
@ellabaron-code
ellabaron-code force-pushed the dist-trace-05-task-scope-carry branch from 43f7c29 to 05cb556 Compare July 13, 2026 15:13
@ellabaron-code
ellabaron-code force-pushed the dist-trace-04-rpc-propagation branch from ee1cfe9 to bc72233 Compare July 13, 2026 16:12
@ellabaron-code
ellabaron-code force-pushed the dist-trace-05-task-scope-carry branch from 05cb556 to 45dee2c Compare July 13, 2026 16:12
Same capture/re-activate pattern as the async scope-carry infra, applied
to the higher-level task types whose work runs on a different thread than
the one that triggered it. Each snapshots dist_trace::GetActiveSpanContext()
where the scope is still live and re-establishes it with ActivateParentScope
around the deferred run, so the work's RPCs nest under the triggering trace.

- tablet/operation_driver: OperationDriver captures at construction,
  re-activates in ApplyTask (APPLYING/APPLIED UpdateTransaction RPCs on
  the Raft apply thread).
- master/async_rpc_tasks_base: RetryingRpcTask captures at construction,
  re-activates at the top of Run().
- master/multi_step_monitored_task: captures at construction, re-activates
  in RunInternal before each step.
- tserver/tablet_validator: captures per scheduled index (carried from the
  CreateTablet RPC into OpenTablet), re-activates the first batched index's
  context around the GetBackfillStatus poll.

Purely additive; all no-ops when the captured context is invalid.
@ellabaron-code
ellabaron-code force-pushed the dist-trace-05-task-scope-carry branch from 45dee2c to 9830d01 Compare July 13, 2026 22:25
@ellabaron-code
ellabaron-code force-pushed the dist-trace-04-rpc-propagation branch from bc72233 to 410d809 Compare July 13, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant