acfa1cf389ae85ab23161a84bc0dacad0945d1a6
max
  Tue Sep 17 13:12:18 2024 -0700
fixing mysql tables before trying to access them, refs #34469

diff --git src/browserbox/root/updateBrowser.sh src/browserbox/root/updateBrowser.sh
index 7d8e491..90977fe 100755
--- src/browserbox/root/updateBrowser.sh
+++ src/browserbox/root/updateBrowser.sh
@@ -513,46 +513,46 @@
 sed -i 's/......cgi-bin\/hgUserSuggestion/http:\/\/genome.ucsc.edu\/cgi-bin\/hgUserSuggestion/' /usr/local/apache/htdocs/contacts.html
 # remove visigene from top menu
 sed -i '/hgVisiGene/d' /usr/local/apache/htdocs/inc/home.topbar.html
 
 # maybe not needed, but running anyway
 chown www-data.www-data /usr/local/apache/htdocs/inc/globalNavBar.inc
 
 # make sure we have the right symlink to /media
 sudo ln -sfT /media /usr/local/apache/htdocs/folders
 sudo ln -sfT /data/trash /usr/local/apache/htdocs/trash
 
 # make sure this tableList is not there, it can break the box
 # hgcentral on hgdownload has tables missing: those with users and passwords
 mysql hgcentral -e 'drop table if exists tableList'
 
+# rsync tables on hgdownload are sometimes in a crashed state
+echo checking mysql tables
+#sudo myisamchk --force --silent --fast /data/mysql/hg19/*.MYI /data/mysql/hgcentral/*.MYI /data/mysql/hgFixed/*.MYI 2> /dev/null
+mysqlcheck --all-databases --auto-repair --quick --fast --silent
+
 # hide the really big tracks
 mysql hg19 -e 'update trackDb set visibility=0 where tableName like "cons%way"'
 mysql hg19 -e 'update trackDb set visibility=0 where tableName like "ucscRetroAli%"'
 mysql hg38 -e 'update trackDb set visibility=0 where tableName like "omimGene2"'
 mysql hg19 -e 'update trackDb set visibility=0 where tableName like "omimGene2"'
 mysql hg38 -e 'update trackDb set visibility=0 where tableName like "omimAvSnp"'
 mysql hg19 -e 'update trackDb set visibility=0 where tableName like "omimAvSnp"'
 
 # temporary fix for hgdownload problem, Oct 2014
 ls /data/mysql/eboVir3 > /dev/null 2> /dev/null && mysql eboVir3 -e 'drop table if exists history'
 
-# rsync tables on hgdownload are sometimes in a crashed state
-echo checking mysql tables
-#sudo myisamchk --force --silent --fast /data/mysql/hg19/*.MYI /data/mysql/hgcentral/*.MYI /data/mysql/hgFixed/*.MYI 2> /dev/null
-mysqlcheck --all-databases --auto-repair --quick --fast --silent
-
 #LATENCY=`ping genome.ucsc.edu -n -c1 -q | grep rtt | cut -d' ' -f4 | cut -d/ -f2 | cut -d. -f1`
 #if [ "$LATENCY" -gt "90" ]; then
 #echo making low-latency changes
 /usr/local/apache/cgi-bin/hgMirror postRsyncUpdates
 
 # the local-only hg.conf settings file has to exist as it is included from hg.conf
 # In case it got deleted due to some error, recreate it
 if [ ! -f /usr/local/apache/cgi-bin/hg.conf.local ] ; then
    echo Creating /usr/local/apache/cgi-bin/hg.conf.local
    echo allowHgMirror=true > /usr/local/apache/cgi-bin/hg.conf.local
 fi
 
 # Sept 2017: check if genome-euro mysql server is closer
 if [ ! -f /usr/local/apache/trash/registration.txt ]; then
    # Mar 2018:  check if we can connect to genome-euro before checking what is closest