[debian-mysql] Bug#770177: Bug#770177: mariadb-server-10.0: keeps asking for migration confirmation

Otto Kekäläinen otto at seravo.fi
Tue Nov 25 06:53:53 UTC 2014


Thanks for reporting this!

It seems that when you have multiple /var/lib/mysql/debian-*.flag
files, the version comparison is buggy and ends up comparing new
version to the oldest flag file version.

The relevant code in mariadb-server-10.0.preinst is:

**
# Show upgrade warning if old data exists
# Designed for scenarios where users upgrade form MySQL 5.5 or 5.6 or
MariaDB 5.5
for i in `ls $DATADIR/debian-*.flag 2>/dev/null`; do
  found_version=`echo $i | sed 's/.*debian-\([0-9\.]\+\).flag/\1/'`
  if dpkg --compare-versions "10.0" '>>' "$found_version"; then
    db_fset mariadb-server/oneway_migration seen false || true
    db_input high mariadb-server/oneway_migration || true
    db_go
    db_get mariadb-server/oneway_migration || true
    if [ "$RET" = "false" ]; then
      echo "Aborting MariaDB installation." 1>&2
      db_stop
      exit 1
    fi
  fi
done
**

One possible solution would be to delete all
/var/lib/mysql/debian-*.flag files if migration is chosen, so that the
old flag files will not interfere later (similar to how the downgrade
section in the same file does).

Another option would be to edit the file that sets the flag in the
first place (mariadb-server-10.0.postinst) so that it always deletes
all old flags before setting a new one, thus making sure there is
always just one flag version set.

A third option would be to encapsulate the whole migration question
inside a check, that checks if the migration question is already
answered or not.

A fourth option would be to remove the question all together. The
MySQL packages don't show any migration warnings when going from
5.5->5.6 and most DBAs know to back up their data anyway, so this
notification service is perhaps not that useful and we could do
without it. And a downgrade is anyway possible via manual dump+import,
so this is not a big issue anyway.

I am not sure which option to pick at the moment, so I'll let it soak in
for a while.



More information about the pkg-mysql-maint mailing list