CartoDB / cartodb-postgresql

PostgreSQL extension for CartoDB
BSD 3-Clause "New" or "Revised" License
111 stars 53 forks source link

[Ghost tables] Event trigger for DDL instructions #347

Closed ethervoid closed 5 years ago

ethervoid commented 5 years ago

A new function that will be used to encapsulate all the even trigger logic. We have to decide if we leave the event trigger outside of this

ethervoid commented 5 years ago

Some thoughts for this new trigger and its implications:

We have to be careful with the DDL instructions we process. Why? because right now we trigger the Ghost Tables when the user enters in the dashboard but in the future, we're going to launch the events when a DDL instruction is executed. Why is that a problem? Because we're going to enqueue more jobs, I'm thinking in alter table with drop column for example, than before in shared queues and that could delay other unrelated tasks so maybe we want to filter some DDL instructions.

Another thing to take into account is the Importer issue. It's highly probable that things are going to mess up when the importer starts to enqueue ghost tables at the same time all the importer operations are being done. So maybe have to lock GT for that user using Bolt until the importer finishes and execute GT after that.