← Back to team overview

maria-developers team mailing list archive

Re: [Commits] b904ca0: MDEV-9297 - mysql_install_db launches mysqld 3x

 

Hi Sergei,

On Tue, Dec 29, 2015 at 01:51:02PM +0100, Sergei Golubchik wrote:
> Hi, Sergey!
> 
> On Dec 23, Sergey Vojtovich wrote:
> > revision-id: b904ca0c2e9e35ffecb314f1082e45bfb42038f3 (mariadb-10.1.8-99-gb904ca0)
> > parent(s): 29290a3d53a05bd7177bcf7de05e1c8fff6e9cea
> > committer: Sergey Vojtovich
> > timestamp: 2015-12-23 15:52:34 +0400
> > message:
> > 
> > MDEV-9297 - mysql_install_db launches mysqld 3x
> > 
> > Perform database installation in one mysqld run. This makes mysql_install_db
> > 3x faster.
> > 
> > diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
> > index f8f36bf..9dcd23a 100644
> > --- a/scripts/mysql_install_db.sh
> > +++ b/scripts/mysql_install_db.sh
> > @@ -427,7 +427,7 @@ mysqld_install_cmd_line()
> >  
> >  # Create the system and help tables by passing them to "mysqld --bootstrap"
> >  s_echo "Installing MariaDB/MySQL system tables in '$ldata' ..."
> > -if { echo "use mysql;"; cat "$create_system_tables" "$create_system_tables2" "$fill_system_tables"; } | eval "$filter_cmd_line" | mysqld_install_cmd_line > /dev/null
> > +if { echo "use mysql;"; cat "$create_system_tables" "$create_system_tables2" "$fill_system_tables" "$fill_help_tables" "$maria_add_gis_sp"; } | eval "$filter_cmd_line" | mysqld_install_cmd_line > /dev/null
> >  then
> >    s_echo "OK"
> >  else
> > @@ -462,26 +462,6 @@ else
> >    exit 1
> >  fi
> >  
> > -s_echo "Filling help tables..."
> > -if { echo "use mysql;"; cat "$fill_help_tables"; } | mysqld_install_cmd_line > /dev/null
> > -then
> > -  s_echo "OK"
> > -else
> > -  echo
> > -  echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!"
> > -  echo "The \"HELP\" command might not work properly."
> > -fi
> > -
> > -s_echo "Creating OpenGIS required SP-s..."
> > -if { echo "use test;"; cat "$maria_add_gis_sp"; } | mysqld_install_cmd_line > /dev/null
> > -then
> > -  s_echo "OK"
> > -else
> > -  echo
> > -  echo "WARNING: OPENGIS REQUIRED SP-S WERE NOT COMPLETELY INSTALLED!"
> > -  echo "GIS extentions might not work properly."
> > -fi
> 
> Uhm, I don't know. I believe the point was not to treat
> fill_help_tables failure as fatal.
> 
> To keep this logic you can merge maria_add_gis_sp and fill_help_tables
> in one mysqld_install_cmd_line invocation. But that's all.
> 
> On the other hand, perhaps it's not important to preserve this logic?
> Then your patch is fine...
Yes, I noticed that fill_help_tables failure wasn't considered fatal same for
GIS extension. But how can they possibly fail? Wrong SQL? Then we should fix it.
Generic errors will most probably be caught earlier.

I failed to find good reason to preserve that logic.

Now why I did this... for me it usually takes 10 seconds to complete. 10 seconds
is too few to switch to something else, but too much to just waste them. Back
then I had to do it dozens of times, so I wasted a few minutes. I like wasting
minutes, but not this way.

Thanks,
Sergey


Follow ups

References