Comment 2 for bug 1272310

Revision history for this message
Max Bubenick (max-bubenick) wrote :

You are correct about the main connection keeping a not needed transaction open after releasing FTWRL. We can commit or close it at that point. But this is not the only issue about metadata locking.

The main thread is holding locks only when using row chunks because it needs to access each table to calculate them. In any other case will not keep any.

I will apply your patch as it helps to reduce it, but dumping threads is another thing to look at.

The dumping threads will hold metadata locks progressively while are dumping data.

The workaround for that is using SAVEPOINTs within the dumping transactions, but with multiple threads and multiples chunks being dumped in parallel for the same table is not easy to coordinate, we can end up with an inconsistent backup when a TRUNCATE or DROP is executed.