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

Test 05-copy-data-from.t Fails #38

Closed
toddbruner opened this issue Sep 14, 2022 · 4 comments
Closed

Test 05-copy-data-from.t Fails #38

toddbruner opened this issue Sep 14, 2022 · 4 comments

Comments

@toddbruner
Copy link

New Vm with
Ubuntu 22.04
Mysql 8.0.30
using Perl 5.34.0 compiled from source
Test-mysqld-1.0013

cpanm -v Test::mysqld
...snip...
t/04-multiprocess.t .... ok   
t/05-copy-data-from.t .. *** failed to launch mysqld ***
2022-09-14T19:41:40.392469Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30-0ubuntu0.22.04.1) starting as process 236576
2022-09-14T19:41:40.394665Z 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 40eca95f-3465-11ed-be26-000c29547327.
2022-09-14T19:41:40.396781Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-09-14T19:41:40.409205Z 1 [ERROR] [MY-013862] [InnoDB] Neither found #innodb_redo subdirectory, nor ib_logfile* files in ./
2022-09-14T19:41:40.409224Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2022-09-14T19:41:40.906210Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-09-14T19:41:40.906374Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-09-14T19:41:40.906394Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-09-14T19:41:40.906762Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30-0ubuntu0.22.04.1)  (Ubuntu).

Test hangs at this point.

@markhawkes
Copy link

It seems the InnoDB engine in MySQL 8.0.30+ expects <datadir>/#innodb_redo/ on startup. The following patch creates it, enabling t/05-copy-data-from.t to pass:

diff --git a/lib/Test/mysqld.pm b/lib/Test/mysqld.pm
index 483cf1f..e7560d4 100644
--- a/lib/Test/mysqld.pm
+++ b/lib/Test/mysqld.pm
@@ -189,9 +189,11 @@ sub setup {
             or die "could not dircopy @{[$self->copy_data_from]} to " .
                 "@{[$self->my_cnf->{datadir}]}:$!";
         if (!$self->_is_maria && ($self->_mysql_major_version || 0) >= 8) {
-            my $mysql_db_dir = $self->my_cnf->{datadir} . '/mysql';
-            if (! -d $mysql_db_dir) {
-                mkdir $mysql_db_dir or die "failed to mkdir $mysql_db_dir: $!";
+            for my $dir ('mysql', '#innodb_redo') {
+                my $abs_dir = $self->my_cnf->{datadir} . "/$dir";
+                if (! -d $abs_dir) {
+                    mkdir $abs_dir or die "failed to mkdir $abs_dir: $!";
+                }
             }
         }
     }

@DrHyde
Copy link

DrHyde commented Jan 16, 2023

I've got the same problem, and @markhawkes 's patch fixed it for me. Please can it be applied and a new release pushed to the CPAN?

Songmu added a commit that referenced this issue Apr 5, 2024
@Songmu
Copy link
Collaborator

Songmu commented Apr 5, 2024

Thanks for reporting. I've patched it at #42

@Songmu Songmu closed this as completed Apr 5, 2024
@DrHyde
Copy link

DrHyde commented Apr 8, 2024

Thank you

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

No branches or pull requests

4 participants