Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Rollback not working M2.3.0 #1988

Closed
twosg opened this issue Jan 21, 2019 · 6 comments
Closed

Database Rollback not working M2.3.0 #1988

twosg opened this issue Jan 21, 2019 · 6 comments
Assignees
Milestone

Comments

@twosg
Copy link

twosg commented Jan 21, 2019

Preconditions (*)

  1. Magento 2.3.0
  2. Debian 9, MariaDB 10.1.37
  3. PHP 7.2.14

Steps to reproduce (*)

  1. bin/magento setup:backup --db
  2. bin/magento setup:rollback --db-file=1548082389_db.sql -n

Expected result (*)

  1. Rollback completes without errors

Actual result (*)

  1. Rollback aborts with errors:
Enabling maintenance mode
DB rollback is starting...

SQLSTATE[HY000]: General error: 1100 Table 'inventory_stock_1' was not locked with LOCK TABLES, query was: /*!40000 ALTER TABLE `inventory_stock_1` DISABLE KEYS */;

In Pdo.php line 235:                                                                                                                                                             
  SQLSTATE[HY000]: General error: 1100 Table 'queue_lock' was not locked with LOCK TABLES, query was: DELETE FROM `queue_lock` WHERE (created_at <= '2019-01-21 15:10:29')  
                 
In Pdo.php line 228:                                                              
  SQLSTATE[HY000]: General error: 1100 Table 'queue_lock' was not locked with LOCK TABLES                                                                                             

I guess that may be because of references to foreign tables which are not locked for the current table but would need to?!

@maghamed maghamed added this to the MSI Part III milestone Jan 21, 2019
@maghamed
Copy link
Contributor

thanks for the bug report @twosg we will process and get back with results shortly

@maghamed
Copy link
Contributor

I think one of the reasons based on the output could be that a backup/rollback tool does not support MySQL View.

So, that when rollback//backup handles 'inventory_stock_1' and tries to disable KEYs for efficient insert
ALTER TABLE inventory_stock_1 DISABLE KEYS it gets similar issue:

mysql> ALTER TABLE `inventory_stock_1` DISABLE KEYS;
ERROR 1347 (HY000): 'magento.inventory_stock_1' is not BASE TABLE

@Stepa4man Stepa4man self-assigned this Jan 23, 2019
@maghamed
Copy link
Contributor

@Stepa4man if you created PR to the Magento repo , could you please provide a reference in this thread to keep tracking it

@maghamed
Copy link
Contributor

hey @Stepa4man are you still working on this issue?

@Stepa4man
Copy link
Contributor

@maghamed yes. Have some deadline here? I believe I can get it done tomorrow.

@Stepa4man
Copy link
Contributor

Stepa4man commented Feb 12, 2019

@Stepa4man if you created PR to the Magento repo , could you please provide a reference in this thread to keep tracking it

@maghamed magento/magento2#21151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants