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

mysql:5.7 snapshot restore can take longer, fixes #4933 #4934

Merged
merged 2 commits into from
May 21, 2023

Conversation

rfay
Copy link
Member

@rfay rfay commented May 20, 2023

The Issue

How This PR Solves The Issue

It seems that mysql:5.7 takes a little longer to get the server started, and this may result in different results on different platforms.

  • The db container's healthcheck should have been saying "not ready" during snapshot restore, instead it was returning 0 implying healthy.
  • We weren't capturing the stderr properly, and having it helps a lot.
  • On mysql you have to have root privs to do the required SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;

Manual Testing Instructions

  • Using a Drupal9+ project, with mysql:5.7 and mysql:8.0 databases, ddev snapshot && ddev snapshot restore --latest

Automated Testing Overview

This doesn't add anything new, although it's worth considering testing snapshots with mysql:5.7

@github-actions
Copy link

github-actions bot commented May 20, 2023

@rfay
Copy link
Member Author

rfay commented May 20, 2023

@rpkoller tomorrow would love to have you validate this, #4934 (comment)

@rfay rfay marked this pull request as ready for review May 20, 2023 05:04
@rfay rfay requested a review from a team as a code owner May 20, 2023 05:04
@rpkoller
Copy link
Collaborator

on the project that failed and i was able to reproduce the error consistently i am now able to restore from the snapshot that failed without a fail:

$> ddev snapshot restore --latest
Stopping db container for snapshot restore of 'beta1_20230519234206-mysql_5.7.gz'... 
With large snapshots this may take a long time.
This will normally time out after 120 seconds (max of all container timeouts)
but you can increase it by changing default_container_timeout. 
Container ddev-beta1-dba  Running 
Container ddev-beta1-web  Running 
Container ddev-beta1-db  Started 
Starting mutagen sync process... This can take some time. 
Mutagen sync flush completed in 0s.
For details on sync status 'ddev mutagen st beta1 -l' 
Container ddev-router  Running 
mysql: [Warning] Using a password on the command line interface can be insecure. 
Waiting for snapshot restore to complete...
You can also follow the restore progress in another terminal window with `ddev logs -s db -f beta1` 

Database snapshot beta1_20230519234206 was restored in 13s 
Instrumentation is opted in, but SegmentKey is not available. This usually means you have a locally-built ddev binary or one from a PR build. It's not an error. Please report it if you're using an official release build. ```

`ddev version v1.22.0-alpha2-71-g695ac30a`

@hcksharp
Copy link

Just tested it on a vanilla install (1 database Maria) and my local dev site (3 databases mysql-5.7) and resolved both snapshot restore errors I experienced.

Waiting for snapshot restore to complete... You can also follow the restore progress in another terminal window with ddev logs -s db -f multi`

Database snapshot multi_20230520100348 was restored in 16s
Instrumentation is opted in, but SegmentKey is not available. This usually means you have a locally-built ddev binary or one from a PR build. It's not an error. Please report it if you're using an official release build.`

version v1.22.0-alpha2-71-g695ac30a

@rfay rfay merged commit 798a8aa into ddev:master May 21, 2023
21 checks passed
@rfay rfay deleted the 20230519_fix_mysql_snapshot_restore branch May 21, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants