Repository navigation
Replies: 1 comment
|
For our records, a few members (including me) had offline discussions about this topic. I agree with this plan. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
How the Amber Engine Executes a Workflow Today
The Amber engine runs inside a computing unit. Today it does more than execute a workflow: it also manages the metadata that the execution relies on. This section first walks through the execution flow, then shows where an execution is stored, and finally explains the two problems that follow from this design.
Execution Flow
When a user executes a workflow, the browser sends the whole workflow to the engine, and the engine does the rest itself:
Notice that only steps 6 to 8 read and write data. In the other steps, the engine prepares the execution or records it.
Storage Layout
The engine also decides where an execution is stored. The Iceberg catalog groups tables into namespaces, and the engine uses four namespaces of the user's warehouse, one for each kind of table. For each execution, it creates one table in each of the four, so every namespace holds that kind of table for all executions:
operator-port-result.operator-port-state.operator-console-messages.workflow-runtime-statistics.Two Problems
This design leads to two problems. The first comes from the execution flow, and the second comes from the storage layout.
Problem 1: The engine does two jobs. It executes the workflow, and it also manages the metadata of the execution. For example, the engine creates the execution, looks up the dataset files, records the status, and decides where the execution is stored, although the Texera services already manage the same metadata. As a result, the same metadata is managed in two places, and a change to how Texera manages executions or datasets is also a change to the engine. Semantically, the engine should purely do execution, and the services should handle the metadata.
Problem 2: An execution has no namespace of its own. A namespace is what the catalog manages as a whole: it can be listed, deleted, and given access in one step. However, the tables of one execution are in four namespaces that all executions share, so Texera has to manage an execution table by table. For example, to delete an execution, Texera has to find and delete its tables in four namespaces. Similarly, to control the access to an execution, Texera has to set the access on each of its tables, because the access to a namespace covers every execution in it.
Proposal: A Self-Contained Amber Engine
To solve both problems, I propose making the Amber engine self-contained: the engine executes a physical plan and produces its results in one Iceberg namespace, and it leaves the execution metadata to the Dashboard Service. I think this is a cleaner design, because each part has one job:
The rest of this section describes the design in three parts: how an execution flows, where an execution is stored, and how the design solves the two problems above.
Execution Flow
An execution now has two phases. In the first phase, the services create the metadata of the execution and build the physical plan. In the second phase, the engine executes that plan. The two phases are connected by one request, which carries the plan from the Dashboard Service to the computing unit.
Phase 1: Create the Execution Metadata (Texera Services)
The first phase starts when the user executes a workflow, and it ends when the plan arrives at the computing unit. Along the way, the Dashboard Service completes the plan step by step:
POST /api/executions).POST /api/execution/start).At the end of this phase, all the metadata of the execution exists, and the plan is complete: it has a link to each input file, and it names the namespace for the output. As a result, the engine needs nothing else.
Phase 2: Execute the Physical Plan (Amber Engine)
The second phase takes place inside the computing unit. Since the plan is complete, the engine only needs three steps, and none of them calls a Texera service:
These three steps correspond to steps 6 to 8 of today's flow, and they are now the only steps the engine performs.
Storage Layout: One Namespace per Execution
The second half of the definition is about the output. Instead of spreading an execution over four shared namespaces, the new design stores each execution in a namespace of its own. Take execution 42 as an example:
execution-42in the user's warehouse, and gives execution 42 access to it. The access lasts until the execution's results expire, for example when a later execution replaces them, because until then the computing unit still shows the results.The execution works only inside that namespace. A namespace is also one folder in object storage, so the files of the execution are together too.
All reactions