flyteorg / flyteorg/flyte

Bug: Autogenerated (.flytegen prefixed) Workflow/Task Executions lack execution_tags entries

Open
#7,601 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
7.5k
Forks
886
Avg merge
1d 14h
Merged PRs (30d)
120

Description

### Describe the bug

Flyte does not create entries in the execution_tags table for executions that are associated with autogenerated workflows or tasks, specifically those whose names are prefixed with .flytegen. This issue prevents these executions from being discoverable or filterable using execution_tags in the Flyte UI or via direct database queries.

This behavior is particularly observed in scenarios where clients create executions by directly referencing tasks, leading to associated workflow entries (or sometimes task entries themselves) being prefixed with .flytegen. While the execution itself is recorded in the executions table, and its associated workflow/task is in the workflows/tasks table, the corresponding execution_tags are missing from the execution_tags table.

### Expected behavior

All Flyte executions, regardless of whether they are associated with autogenerated workflows or tasks (e.g., those prefixed with .flytegen), should have their execution_tags correctly populated in the execution_tags table. This ensures consistent data integrity and allows for comprehensive filtering and searching across all execution types.

### Additional context to reproduce

1. Identify an affected execution: Run the following query to find executions where the launch_plan, workflow, task, or execution_name contains .flytegen. This query uses LEFT JOIN to ensure all related entities are shown, even if some are NULL.

Example Query:

flyteadmin=> SELECT
e.execution_project,
e.execution_domain,
e.execution_name,
lp.name AS launch_plan_name,
w.name AS workflow_name,
t.name AS task_name,
et.key, -- This will be NULL if no execution_tag entry exists
et.value -- This will be NULL if no execution_tag entry exists
FROM
executions AS e
LEFT JOIN
launch_plans AS lp ON e.launch_plan_id = lp.id
LEFT JOIN
workflows AS w ON e.workflow_id = w.id
LEFT JOIN
tasks AS t ON e.task_id = t.id
LEFT JOIN -- Use LEFT JOIN here to show executions even if they don't have tags
execution_tags AS et ON e.execution_project = et.execution_project
AND e.execution_domain = et.execution_domain
AND e.execution_name = et.execution_name
WHERE
(lp.name LIKE '%.flytegen%' -- Launch plan name contains .flytegen
OR w.name LIKE '%.flytegen%' -- Workflow name contains .flytegen
OR t.name LIKE '%.flytegen%' -- Task name contains .flytegen
OR e.execution_name LIKE '%.flytegen%') -- Execution name itself contains .flytegen
AND e.execution_name = 'aq6bgnpd25pvmh9q7txw'; -- Filtering for your specific example execution

Query Result:

Image

2. Contrast with a regular workflow execution (where tags are present): To demonstrate that execution_tags are correctly populated for non-autogenerated workflows, run the following query.

Query Example:

SELECT
lp.name AS launch_plan_name,
w.name AS workflow_name,
et.key,
et.value
FROM
executions AS e
JOIN
launch_plans AS lp ON e.launch_plan_id = lp.id
JOIN
workflows AS w ON e.workflow_id = w.id
JOIN
execution_tags AS et ON e.execution_project = et.execution_project
AND e.execution_domain = et.execution_domain
AND e.execution_name = et.execution_name
WHERE
w.name NOT LIKE '.flytegen%' -- Exclude workflows starting with .flytegen
AND lp.name NOT LIKE '.flytegen%' -- Exclude launch plans starting with .flytegen
AND et.key IS NOT NULL -- Ensure that an execution tag key exists
LIMIT 15; -- Get a few examples

Query Result:

Image

**Tested on flytekit 1.16.15**

Philip Kränzler [philip.kraenzler@mercedes-benz.com](mailto:philip.kraenzler@mercedes-benz.com), Mercedes-Benz Tech Innovation GmbH, [imprint](https://github.com/mercedes-benz/foss/blob/master/PROVIDER_INFORMATION.md)

Contributor guide

Open the contributing guide

Research direction

Start by tracing Flyte's execution creation path and the persistence of rows in the execution_tags table, using the provided SQL query to reproduce the missing entries for .flytegen-associated executions. Done means executions linked to autogenerated workflows or tasks have the same execution_tags entries as regular workflow executions, with coverage for the affected case.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.