Bug 196895 - databases/mariadb100-server raw device not working as InnoDB data file
Summary: databases/mariadb100-server raw device not working as InnoDB data file
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Bernard Spil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-19 15:10 UTC by joshruehlig
Modified: 2017-05-20 20:39 UTC (History)
1 user (show)

See Also:


Attachments
MySQL startup error log (3.69 KB, text/plain)
2015-02-21 17:35 UTC, joshruehlig
no flags Details
mariadb55 raw (4.01 KB, text/plain)
2015-08-15 16:26 UTC, joshruehlig
no flags Details
mariadb100 raw - errors (3.63 KB, text/plain)
2015-08-15 16:27 UTC, joshruehlig
no flags Details
mariadb100 file (1.51 KB, text/plain)
2015-08-15 16:28 UTC, joshruehlig
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description joshruehlig 2015-01-19 15:10:57 UTC
Creating a new InnoDB data file, or using an existing InnoDB data file, with a raw device isn't working with mariadb100-server-10.0.15.

##CONFIG##
innodb_data_home_dir=
innodb_data_file_path = /dev/zvol/zroot/test:8G(new)raw

##ERROR##
[ERROR] InnoDB: '/dev/zvol/zroot/test' not a regular file.
####

##########

This works as expected with mariadb55-server.

Apparently this was fixed with in version 10.0.11, but maybe the patch to os_file_get_status doesn't work for FreeBSD or ZFS ZVOLs.
https://mariadb.atlassian.net/browse/MDEV-6057

Looking at the comments, a Debian user also had a problem, on version 10.0.15, with raw partitions on LVM (linux software raid).
Comment 1 joshruehlig 2015-01-19 15:25:27 UTC
I'll test a raw device partition directly when I have a chance to see if we can isolate this issue to ZFS ZVOLs, or if it's an issue related to FreeBSD.

My MariaDB bug report can be seen here.
https://mariadb.atlassian.net/browse/MDEV-7480
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2015-01-20 00:00:45 UTC
Fix Summary and notify maintainer.
Comment 3 joshruehlig 2015-01-20 03:10:32 UTC
I tested with a raw device partition (USB stick) using mariadb100-server-10.0.15 and also with mysql56-server-5.6.22

In no cases do raw device partitions work.

This leads me to believe this issue is specific to the "os_file_get_status" function and FreeBSD (not ZVOLs or MariaDB).
Comment 4 Bernard Spil freebsd_committer freebsd_triage 2015-01-20 08:02:40 UTC
Digging in...
For MySQL 5.6/10.0.10 problems this was fixed by 
http://bazaar.launchpad.net/~mysql/mysql-server/5.6/revision/5664

Will check further later.
Comment 5 joshruehlig 2015-01-24 06:15:15 UTC
I submitted a bug to the MySQL project here.
http://bugs.mysql.com/bug.php?id=75616&thanks=4
Comment 6 joshruehlig 2015-02-03 03:46:42 UTC
I believe I found the source of this issue.

FreeBSD doesn't present disks as block devices but instead as character devices. I believe "case S_IFCHR:" should be added directly before or after "case S_IFBLK:" here..
http://bazaar.launchpad.net/~mysql/mysql-server/5.6/view/head:/storage/innobase/os/os0file.cc#L3167
Comment 7 joshruehlig 2015-02-03 03:47:14 UTC
Forgot to cite my source
https://www.freebsd.org/doc/en/books/arch-handbook/driverbasics-block.html
Comment 8 Bernard Spil freebsd_committer freebsd_triage 2015-02-21 13:36:15 UTC
Hi Joshua,

Can you verify that your solution fixes this issue? And provide the diff as an attachment to this PR? I'll then follow up with with upstream to include this in the next version.

Thanks in advance!
Comment 9 joshruehlig 2015-02-21 13:48:22 UTC
I was actually planning in working on it today. just replacing S_IFBLK with S_IFCHAR complains I didn't include it somewhere. don't know anything about 'C' some I'm stumbling my way through.

mariadb said they would rather upstream fix this, mysql has been spotty to respond. but I think they will eventually fix it because it affects multiple OSs as well.
Comment 10 joshruehlig 2015-02-21 17:34:45 UTC
my earlier issue was I tried S_IFCHAR, but it should be S_IFCHR. I was able to compile mariadb100-server with this change.

But, mysql is still not starting. I believe more changes/additions are needed to support character devices. I'll attach my mysql startup log.

Also, here is where support for block devices was re-added for mysql5.6
https://github.com/mysql/mysql-server/commit/dfc103a0474d1d772b52cb03c71c2821a002d89c#diff-28ed40e7ccec6683ebd46da2ca82d01c
Comment 11 joshruehlig 2015-02-21 17:35:16 UTC
Created attachment 153284 [details]
MySQL startup error log
Comment 12 joshruehlig 2015-06-24 05:50:00 UTC
Looks like this may have been fixed in mysql 5.6.25. I'm hoping that port gets updated soon so I can test it out.
https://github.com/mysql/mysql-server/commit/aee6bc8ed15e14fb2a532cd0ebffa0ec161c0e77

I don't think the fix has been applied to mariadb yet so I'll inform them so it can hopefully be merged in at some point.
Comment 13 joshruehlig 2015-07-14 19:02:15 UTC
OK, the fixed got merged into mariadb10.0
https://github.com/MariaDB/server/commit/3bbffc211945f99f9bba806e7031bea6b73a1993

So, the next time they release a new version, and we update the FreeBSD port, this should be fixed.
Comment 14 joshruehlig 2015-08-06 20:57:22 UTC
A new version of mariadb with this fix, version 10.0.21 has been released. Once this port has been updated this issue should be closed.
Comment 15 Mark Linimon freebsd_committer freebsd_triage 2015-08-13 13:43:20 UTC
Over to new maintainer.
Comment 16 Bernard Spil freebsd_committer freebsd_triage 2015-08-15 09:52:50 UTC
Hi Josh,

Can you confirm that raw devices are working with the new 10.0.21 port?

Thanks a LOT!

Bernard.
Comment 17 joshruehlig 2015-08-15 16:26:30 UTC
I can confirm v10.0.21 is partially working.

WORKS
initiate innodb raw device on mariadb55 (newraw) > mariadb100 (raw)

DOESN'T WORK
initiate innodb raw device on mariadb100 (newraw) > mariadb100 (raw)

From the attached logs I believe newraw isn't initiating the storage on mariadb100.
I'll attached logs of..
* mariadb55 initiating (newraw) and using a raw device (raw)
* mariadb100 initiating (newraw) and using a raw device (raw)
* mariadb100 using a file (not specifying innodb location)
Comment 18 joshruehlig 2015-08-15 16:26:57 UTC
Created attachment 159901 [details]
mariadb55 raw
Comment 19 joshruehlig 2015-08-15 16:27:34 UTC
Created attachment 159902 [details]
mariadb100 raw - errors
Comment 20 joshruehlig 2015-08-15 16:28:06 UTC
Created attachment 159903 [details]
mariadb100 file
Comment 21 joshruehlig 2015-08-15 16:30:13 UTC
My personal problem is fixed, as I'll be upgrading from mariadb55. But, others who start from mariadb100 (and probably mysql56) won't be able to initiate their raw device.