beam icon indicating copy to clipboard operation
beam copied to clipboard

Call to `finalSolution` hangs

Open mightybyte opened this issue 4 years ago • 2 comments

In my case, verifySchema returned VerificationFailed with one predicate:

(TableHasPrimaryKey: Table QualifiedName Nothing "transactions" has primary key ["requestkey","block"])

The change I made was to add the block field to the primary key for the table.

mightybyte avatar Jul 16 '21 15:07 mightybyte

When I print all the PotentialActions in the ChooseActions value returned by heuristicSolver, I get a bunch of the following action types:

  • Drop column
  • Add not null constraint
  • Drop not null constraint

So perhaps it is hanging because there are no actions being considered that can possibly satisfy the predicate that is needed.

mightybyte avatar Jul 16 '21 15:07 mightybyte

The reason this hangs is because beam-migrate currently implements a graph search algorithm. It currently retraverses paths that are the same, but due to the way the traversal is structured and how dynamic it is, it's difficult to express that duplication in the current system.

The truth is the system is not 'hanging' per se. The algorithm will absolutely converge or report a negative result, because the recursion is strictly structural. But I think it's O(2^n). This is an example where theory and practice simply do not meet however.

tathougies avatar Aug 06 '21 03:08 tathougies