Is there a (locking?) mechanism to make mapped tasks mutually exclusive at runtime? Use case is pulling data for an ETL from multiple sources and wanting to limit one task at a time attempting to insert to a target table. When the tasks run over each other trying to insert to the same table, it causes contention
Architecture right now is:
gather sources to poll for updates -> map(poll for updates) -> map(insert to db)
I suppose one alternate approach would be feeding all the gathered tasks through a grouping task that sets them as upstream/downstream from one another based on target table?
So within core is there a means to this or just in cloud?
02/10/2021, 8:44 PM
No, nothing native; locking requires something to manage global state, and Core by itself is effectively stateless
02/10/2021, 8:51 PM
What about flattening the update query so the inserts all run in sequence?
02/10/2021, 9:00 PM
I think something like that is what I'll shoot for. Just need to tinker with the best way to sequence them; I think in asking my question I formulated a potential solution to try
02/11/2021, 7:17 AM
@Jonathan Lowery another option is to use Prefect GraphQL client to run a query to check for running/submitted tasks.
I've done this for flows and it works nicely.
Not the best solution, because it add some complexity to the code, but it works simple smile
Feel free to DM me and I can share more details