bricolages / bricolage

AWS-oriented Data Warehouse Framework
114 stars 20 forks source link

my-migrate, my-import: Do not drop old tables in the RENAME transaction #89

Closed aamine closed 7 years ago

aamine commented 7 years ago

既存テーブルを新しいテーブルとトランザクションの中ですりかえるとき、既存テーブルをdropしてしまうと、すでに実行中のトランザクションからテーブルがdropされたことが見えてしまい、"table dropped in concurrent transaction" のエラーになる。

ref: http://stackoverflow.com/questions/20692518/how-can-i-ensure-synchronous-ddl-operations-on-a-table-that-is-being-replaced

このエラーを回避するためには、dropを別トランザクションで実施しなければならない。