Create a tool for inspecting individual tron dynamodb items#1107
Open
CharlesPeacock wants to merge 5 commits into
Open
Create a tool for inspecting individual tron dynamodb items#1107CharlesPeacock wants to merge 5 commits into
CharlesPeacock wants to merge 5 commits into
Conversation
Updated comments for clarity and improved metadata print function description.
KaspariK
reviewed
Jul 22, 2026
| raw_json = reassemble_json(partitions) | ||
|
|
||
| if args.raw: | ||
| parsed = json.loads(raw_json) |
Member
There was a problem hiding this comment.
--raw should not parse the decompressed payload. Using json.loads() will raise (or normalize, if there is somehow a duplicate key or something) malformed json before we inspect it. I think we'd want to write the raw_json directly
| Checking a job's state: | ||
|
|
||
| AWS_PROFILE=devc python3 tools/read_dynamodb_item.py --table infrastage-tron-state --region us-west-1 --type job_state --name compute-i | ||
| nfra-test-service.test_partitions |
Member
There was a problem hiding this comment.
You probably didn't mean to add this line break
| def get_client(table_name: str, region: str): | ||
| retry_config = Config(retries={"max_attempts": 5, "mode": "standard"}) | ||
| client = boto3.client("dynamodb", region_name=region, config=retry_config) | ||
| return client, table_name |
Member
There was a problem hiding this comment.
This returns table_name unchanged. Instead, we can accept only region and return the client.
Comment on lines
+150
to
+159
| parser.add_argument( | ||
| "--raw", | ||
| action="store_true", | ||
| help="Dump decompressed JSON without deserializing through Tron's from_json", | ||
| ) | ||
| parser.add_argument( | ||
| "--metadata", | ||
| action="store_true", | ||
| help="Show only partition metadata (count, sizes) without the payload", | ||
| ) |
Member
There was a problem hiding this comment.
This is a total nit, but --raw and --metadata can currently be provided together, with --metadata silently winning. If we wanted, we could use a mutually exclusive group to clarify this. Really not a big deal imo
…tually exclusive group to args metadata and raw -improve raw argument by printing out raw json
…_create_a_tool_for_inspecting_individual_tron_dynamodb_items Update branch with new master changes
…ual_tron_dynamodb_items' of github.com:Yelp/Tron into TRON-2603_cpeacock_create_a_tool_for_inspecting_individual_tron_dynamodb_items Update branch
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.
This is a script made to check individual Tron DynamoDB items.
During DAR-2843, diagnosing for corrupted state required ad-hoc scripting, this reusable tool aims to help in future investigations.
It can also be useful for anyone working on dynamodb_state_store.py now that these states are no longer stored in plain text.
It handles multi-partition reconstruction, decompression and deserialization so that you no longer need to do it manually.