[CHASM] Add 'tdbg chasm describe' command to dump a decoded CHASM tree from mutable state#8895
Merged
lina-temporal merged 6 commits intomainfrom Jan 7, 2026
Merged
[CHASM] Add 'tdbg chasm describe' command to dump a decoded CHASM tree from mutable state#8895lina-temporal merged 6 commits intomainfrom
lina-temporal merged 6 commits intomainfrom
Conversation
…e from mutable state
yycptt
reviewed
Dec 23, 2025
tools/tdbg/commands.go
Outdated
| } | ||
|
|
||
| // AdminDescribeChasmTree describe a CHASM tree for admin | ||
| func AdminDescribeChasmTree(c *cli.Context, clientFactory ClientFactory) error { |
Member
There was a problem hiding this comment.
What do you think about making this part of the existing tdbg workflow describe command, instead of creating a new command?
I mean rename workflow to, for example, execution (but still make workflow an alias) since most tdbg commands (migration, refresh task, delete) will eventually be applied to all archetypes (even those related to history events)
The --workflow-id option can also be changed to --business-id and similarly we can make workflow-id an alias.
Contributor
Author
There was a problem hiding this comment.
I like it! I'll make the change.
Contributor
Author
There was a problem hiding this comment.
Done:
$ ./tdbg w d help
NAME:
tdbg execution describe - Describe internal information of Temporal execution
USAGE:
tdbg execution describe [command options]
OPTIONS:
--business-id value, --bid value, --workflow-id value, --wid value Business ID (Workflow ID)
--run-id value, --rid value Run ID (optional, uses latest if not specified)
--archetype value Fully qualified archetype name of the execution (default: workflow.workflow)
--help, -h show help
$ ./tdbg -n "features" e describe -bid "lina-test" --archetype "scheduler.scheduler"
.... < output> ....
yycptt
approved these changes
Jan 7, 2026
| return err | ||
| } | ||
| if resp == nil || resp.GetDatabaseMutableState() == nil { | ||
| return errors.New("no mutable state returned") |
Member
There was a problem hiding this comment.
shall we still print out the CacheMutableState in this case?
stephanos
pushed a commit
to stephanos/temporal
that referenced
this pull request
Jan 12, 2026
…m mutable state (temporalio#8895) ## What changed? - Renames `tdbg workflow` to `tdbg execution` (maintaining 'workflow' and 'w' as aliases). - Renames `tdbg execution describe --workflow-id` to `tdbg execution describe --business-id` (keeping 'wid' and 'workflow-id' as aliases) - `tdbg execution describe` now dumps a CHASM tree's nodes, if one is present. ## Why? - Prior to this, I'd have to first dump mutable state, then MANUALLY parse out every field I cared about, manually look up its type, decode it, unmarshal it, print it, ad infinitum.. Sample output for: `./tdbg -n "features" e describe --business-id "lina-test" --archetype "scheduler.scheduler"`: ```json CHASM Tree Nodes: { "": { "metadata": { "initial_versioned_transition": { "transition_count": 1 }, "last_update_versioned_transition": { "transition_count": 80 }, "Attributes": { "ComponentAttributes": { "type_id": 403648407 } } }, "decodedData": { "schedule": { "spec": { "interval": [ { "interval": "1s", "phase": "0s" } ] }, "action": { "startWorkflow": { "workflowId": "lina-testwf", "workflowType": { "name": "BasicScheduleWorkflow" }, "taskQueue": { "name": " features-schedule", "kind": "TASK_QUEUE_KIND_NORMAL" } } }, "policies": { "overlapPolicy": "SCHEDULE_OVERLAP_POLICY_SKIP", "catchupWindow": "31536000s" }, "state": { "notes": "asdf" } }, "info": { "actionCount": "2", "overlapSkipped": "27", "recentActions": [ { "scheduleTime": "2025-12-22T20:04:45Z", "actualTime": "2025-12-22T20:05:01.012942Z", "startWorkflowResult": { "workflowId": "lina-testwf-2025-12-22T20:04:45Z", "runId": "019b47aa-49d1-792f-9c5c-2f876a6144d7" }, "startWorkflowStatus": "WORKFLOW_EXECUTION_STATUS_FAILED" }, { "scheduleTime": "2025-12-22T20:06:55Z", "actualTime": "2025-12-22T20:06:56.014349Z", "startWorkflowResult": { "workflowId": "lina-testwf-2025-12-22T20:06:55Z", "runId": "019b47ac-0b0a-7d69-9fab-154ee95247cf" }, "startWorkflowStatus": "WORKFLOW_EXECUTION_STATUS_FAILED" } ], "createTime": "2025-12-22T20:00:10.481808Z", "updateTime": "2025-12-22T20:11:39.307879Z" }, "namespace": "features", "namespaceId": "ff4f1d27-b3b2-4030-a7ec-c309c00566a2", "scheduleId": "lina-test", "conflictToken": "22" }, "nodeType": "component", "componentFQN": "scheduler.scheduler" }, "Backfillers": { "metadata": { "initial_versioned_transition": { "transition_count": 6 }, "last_update_versioned_transition": { "transition_count": 6 }, "Attributes": { "CollectionAttributes": {} } }, "rawData": {}, "nodeType": "collection" }, "Backfillers#0f20cd1f-948b-4064-8275-409c2f06dba5": { "metadata": { "initial_versioned_transition": { "transition_count": 6 }, "last_update_versioned_transition": { "transition_count": 6 }, "Attributes": { "ComponentAttributes": { "type_id": 571775395 } } }, "decodedData": { "triggerRequest": { "scheduledTime": "2025-12-22T20:00:38.650636Z" }, "backfillId": "0f20cd1f-948b-4064-8275-409c2f06dba5", "lastProcessedTime": "2025-12-22T20:00:38.651414Z" }, "nodeType": "component", "componentFQN": "scheduler.backfiller" }, "Backfillers#15b9dcc6-1575-4ada-a77b-42672d720287": { "metadata": { "initial_versioned_transition": { "transition_count": 9 }, "last_update_versioned_transition": { "transition_count": 9 }, "Attributes": { "ComponentAttributes": { "type_id": 571775395 } } }, "decodedData": { "triggerRequest": { "scheduledTime": "2025-12-22T20:02:18.389188Z" }, "backfillId": "15b9dcc6-1575-4ada-a77b-42672d720287", "lastProcessedTime": "2025-12-22T20:02:18.390459Z" }, "nodeType": "component", "componentFQN": "scheduler.backfiller" }, "Backfillers#78bd223c-7818-4d92-a318-6c1cde0e17b3": { "metadata": { "initial_versioned_transition": { "transition_count": 7 }, "last_update_versioned_transition": { "transition_count": 7 }, "Attributes": { "ComponentAttributes": { "type_id": 571775395 } } }, "decodedData": { "triggerRequest": { "scheduledTime": "2025-12-22T20:00:59.368696Z" }, "backfillId": "78bd223c-7818-4d92-a318-6c1cde0e17b3", "lastProcessedTime": "2025-12-22T20:00:59.369805Z" }, "nodeType": "component", "componentFQN": "scheduler.backfiller" }, "Backfillers#f0c472b5-1cc2-4a50-ab1b-e14fe593eaa5": { "metadata": { "initial_versioned_transition": { "transition_count": 77 }, "last_update_versioned_transition": { "transition_count": 77 }, "Attributes": { "ComponentAttributes": { "type_id": 571775395 } } }, "decodedData": { "triggerRequest": { "scheduledTime": "2025-12-22T20:11:12.469511Z" }, "backfillId": "f0c472b5-1cc2-4a50-ab1b-e14fe593eaa5", "lastProcessedTime": "2025-12-22T20:11:12.470441Z" }, "nodeType": "component", "componentFQN": "scheduler.backfiller" }, "Generator": { "metadata": { "initial_versioned_transition": { "transition_count": 1 }, "last_update_versioned_transition": { "transition_count": 78 }, "Attributes": { "ComponentAttributes": { "type_id": 545946520 } } }, "decodedData": { "lastProcessedTime": "2025-12-22T20:07:10.003099Z", "futureActionTimes": [ "2025-12-22T20:07:15Z", "2025-12-22T20:07:20Z", "2025-12-22T20:07:25Z", "2025-12-22T20:07:30Z", "2025-12-22T20:07:35Z", "2025-12-22T20:07:40Z", "2025-12-22T20:07:45Z", "2025-12-22T20:07:50Z", "2025-12-22T20:07:55Z", "2025-12-22T20:08:00Z" ] }, "nodeType": "component", "componentFQN": "scheduler.generator" }, "Invoker": { "metadata": { "initial_versioned_transition": { "transition_count": 1 }, "last_update_versioned_transition": { "transition_count": 70 }, "Attributes": { "ComponentAttributes": { "type_id": 2628858954 } } }, "decodedData": { "lastProcessedTime": "2025-12-22T20:07:06.004086Z", "requestIdToWorkflowId": { "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433890000-1766433890000": "lina-testwf-2025-12-22T20:04:50Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433895000-1766433895000": "lina-testwf-2025-12-22T20:04:55Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433900000-1766433900000": "lina-testwf-2025-12-22T20:05:00Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433905000-1766433905000": "lina-testwf-2025-12-22T20:05:05Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433910000-1766433910000": "lina-testwf-2025-12-22T20:05:10Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433915000-1766433915000": "lina-testwf-2025-12-22T20:05:15Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433920000-1766433920000": "lina-testwf-2025-12-22T20:05:20Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433925000-1766433925000": "lina-testwf-2025-12-22T20:05:25Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433930000-1766433930000": "lina-testwf-2025-12-22T20:05:30Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433935000-1766433935000": "lina-testwf-2025-12-22T20:05:35Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433940000-1766433940000": "lina-testwf-2025-12-22T20:05:40Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433945000-1766433945000": "lina-testwf-2025-12-22T20:05:45Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433950000-1766433950000": "lina-testwf-2025-12-22T20:05:50Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433955000-1766433955000": "lina-testwf-2025-12-22T20:05:55Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433960000-1766433960000": "lina-testwf-2025-12-22T20:06:00Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433965000-1766433965000": "lina-testwf-2025-12-22T20:06:05Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433970000-1766433970000": "lina-testwf-2025-12-22T20:06:10Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433975000-1766433975000": "lina-testwf-2025-12-22T20:06:15Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433980000-1766433980000": "lina-testwf-2025-12-22T20:06:20Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433985000-1766433985000": "lina-testwf-2025-12-22T20:06:25Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433990000-1766433990000": "lina-testwf-2025-12-22T20:06:30Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766433995000-1766433995000": "lina-testwf-2025-12-22T20:06:35Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766434000000-1766434000000": "lina-testwf-2025-12-22T20:06:40Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766434005000-1766434005000": "lina-testwf-2025-12-22T20:06:45Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766434010000-1766434010000": "lina-testwf-2025-12-22T20:06:50Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766434020000-1766434020000": "lina-testwf-2025-12-22T20:07:00Z", "sched-auto-ff4f1d27-b3b2-4030-a7ec-c309c00566a2-lina-test-11-1766434025000-1766434025000": "lina-testwf-2025-12-22T20:07:05Z" } }, "nodeType": "component", "componentFQN": "scheduler.invoker" }, "LastCompletionResult": { "metadata": { "initial_versioned_transition": { "transition_count": 70 }, "last_update_versioned_transition": { "transition_count": 70 }, "Attributes": { "DataAttributes": {} } }, "rawData": { "encoding_type": 1, "data": "EhgKFG9wZXJhdGlvbiB0ZXJtaW5hdGVkQgA=" }, "nodeType": "data" }, "Visibility": { "metadata": { "initial_versioned_transition": { "transition_count": 1 }, "last_update_versioned_transition": { "transition_count": 80 }, "Attributes": { "ComponentAttributes": { "type_id": 2662156547, "side_effect_tasks": [ { "type_id": 4193112626, "scheduled_time": { "seconds": -62135596800 }, "data": { "encoding_type": 1, "data": "CDU=" }, "versioned_transition": { "transition_count": 80 }, "versioned_transition_offset": 1, "physical_task_status": 1 } ] } } }, "rawData": { "encoding_type": 1, "data": "CDU=" }, "nodeType": "component (stateless)", "componentFQN": "core.vis", "sideEffectTasks": [ { "typeId": 4193112626, "taskFQN": "core.visTask", "scheduledTime": "0001-01-01T00:00:00Z", "decodedData": { "transitionCount": "53" }, "versionedTransition": { "transition_count": 80 }, "physicalTaskStatus": 1 } ] }, "Visibility$Memo": { "metadata": { "initial_versioned_transition": { "transition_count": 1 }, "last_update_versioned_transition": { "transition_count": 1 }, "Attributes": { "DataAttributes": {} } }, "rawData": { "encoding_type": 1 }, "nodeType": "data" }, "Visibility$SA": { "metadata": { "initial_versioned_transition": { "transition_count": 1 }, "last_update_versioned_transition": { "transition_count": 1 }, "Attributes": { "DataAttributes": {} } }, "rawData": { "encoding_type": 1 }, "nodeType": "data" } } Execution Info: { "namespaceId": "ff4f1d27-b3b2-4030-a7ec-c309c00566a2", "workflowId": "lina-test", "lastRunningClock": "1049018", "startTime": "2025-12-22T20:00:10.477729Z", "lastUpdateTime": "2025-12-22T20:11:39.308118Z", "workflowTaskTimeout": "0s", "workflowTaskAttempt": 1, "workflowTaskRequestId": "emptyUuid", "autoResetPoints": {}, "versionHistories": { "histories": [ {} ] }, "executionStats": {}, "stateTransitionCount": "80", "executionTime": "2025-12-22T20:00:10.477729Z", "transitionHistory": [ { "transitionCount": "80" } ], "taskGenerationShardClockTimestamp": "1048731", "visibilityLastUpdateVersionedTransition": { "transitionCount": "1" }, "subStateMachineTombstoneBatches": [ { "versionedTransition": { "transitionCount": "1" }, "stateMachineTombstones": [ { "chasmNodePath": "Backfillers" } ] } ] } ``` ## How did you test it? - [x] built - [x] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
tdbg chasm describesubcommand to dump a CHASM tree from mutable state.Why?
Sample output for:
./tdbg -n "features" c describe --business-id "lina-test" --archetype "scheduler.scheduler":How did you test it?