MDEV-40964: Update default datadir for debian to be /var/lib/mariadb - #5059
MDEV-40964: Update default datadir for debian to be /var/lib/mariadb#5059lvoytek wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the default data directory for Debian-based installations in cmake/install_layout.cmake by changing INSTALL_MYSQLDATADIR_DEB from /var/lib/mysql to /var/lib/mariadb. No review comments were provided for this change, and I have no feedback to provide.
|
Questions:
@ottok, what do you think? |
|
Thanks @lvoytek
Ubuntu 26.04 already carrying the patch for 11.8_+
I opened https://jira.mariadb.org/browse/MDEV-39461 But yes, we'll need the scripts too.
Like Debian - straight from debian/rules
I do like the last plan. Question is, do we stop on Deb changes or include RPM too?
Its already in Debian sid. https://salsa.debian.org/mariadb-team/mariadb-server/-/merge_requests/155 I was hoping to see more of the script changes from that here. Having a modified subset in 11.8 to handle Ubuntu upgrade to our vendor ones would be good too to solve MDEV-39461. Probably like a earlier version in salsa merge request 155 that dropped the config file in the post install without changing the default. |
gkodinov
left a comment
There was a problem hiding this comment.
This is a preliminary review. Can you please describe the problem you're solving? I.e. what happens now and how is that wrong. And how your solution goes about solving the problem, i.e. how is the current behavior modified.
Ideally this should happen in an MDEV prior to submitting a PR for it, but I can also file one for you if you put your rationale into the PR itself.
|
If I am not mistaken, the submitter of this patch (Canonical employee) had some discussions with Sergei about switching the datadir to This was already included in Debian and Ubuntu 1:11.6.8. The commit https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/2bf6f4d3e1cb090ad5ba7f443ae02af5047c5391 in Debian is a bit more verbose than the commit message/description in this PR. I approved this change in Debian with the assumption that upstream will eventually follow in some future version. This PR only updates the _DEB variable but you might as well also update the equivalent _RPM variable. From my point of view this would be fine to merge as-is, and perhaps MariaDB devs can follow-up with whatever additional changes are needed to make Upgrades of old installs will continue to use |
|
I like this @lvoytek, your commit in Debian changes a lot more than this PR, are the other changes needed? Why did you omit them here? |
|
I'm happy to include the packaging delta here too, I'll update the pr with it soon! |
c1c3f3c to
6367619
Compare
|
Sorry for the delay, all relevant changes for the datadir update should now be here |
ottok
left a comment
There was a problem hiding this comment.
I reviewed and approved the original changes in Debian/Ubuntu, and I support having these upstreamed to MariaDB 'main' to be in effect in the next upstream release.
Hopefully someone can holistically review the MariaDB packaging after this is merged and add RPM changes and whatever is needed so that upstream can announce /var/lib/mariadb as the new datadir location in the next new version release.
CI is failing on two jobs. They should be checked before merging this. Unfortunately latest commit on 'main' is also failing, so I guess contributors to MariaDB shouldn't expect their PRs to pass CI either, but still good to take a look if there is something relevant looking.
(Upstream is not using Salsa CI, so the Salsa CI update is moot and the rest of the Salsa CI won't be passing anyway, but having this commit won't make anything worse either.)
|
Hello! Just pinging to request a re-review with the additional packaging changes included. Thanks! |
Sorry for the delay. You have an assigned reviewer on this one. Let's wait for Serg's review please. |
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution! This is a preliminary review.
I'd advise to merge the 9 commits from this PR into (hopefully) a single one (unless there's legitimate reason to keep them all, which I can't really think of by myself), and maybe even consider merging this with PR#5649 (as suggested).
529ed42 to
ec2822d
Compare
gkodinov
left a comment
There was a problem hiding this comment.
LGTM. Please keep working with Daniel on the final review.
grooverdan
left a comment
There was a problem hiding this comment.
Minor tweaks, otherwise ok. Feel free to disagree.
On RPM, we've got selinux as an external package to contend with - devexp-db/mysql-selinux#16.
On the logic to create the new /var/lib/mariadb in the preinst, as this is where the mysql user is created, it could create a mariadb user if the new path is taken, and use that user permissions on /var/lib/mariadb, drop user=mariadb into the config, and a systemd override of User=mariadb (adjust logrotate script - seems rather dated thinking about it). WDYT?
I'm not against moving to a |
ec2822d to
6f28c49
Compare
|
Updated with requested changes |
|
Also added changes from #5646. I can squash the commits together if preferred |
Match the existing datadir setting for Debian and Ubuntu, which was changed from /var/lib/mysql to /var/lib/mariadb in 1:11.8.6-5. This includes updating debian/ packaging to use /var/lib/mariadb for new installs, and maintaining /var/lib/mysql for legacy installs by providing 99-legacy-datadir.cnf. Likewise, update the cmake INSTALL_MYSQLDATADIR_DEB variable to reflect the change. The debian flag-based version check system has also been replaced as it is no longer needed.
Move mariadbd's runtime data directory in Debian from /run/mysqld to /run/mariadbd.
adc2de4 to
0318419
Compare
|
also rebased onto main |
I suggest to make the |
That sounds reasonable to me. I'll hold off on a PR for this for now but will provide one in the near future |
It complicates the range of existing options that exist on a target system. Given Debian/Ubuntu has already done it maybe not that much. With containers is seems there's some tough decisions to make, but I can handle those.
Note I was considering this as only a pre/postinst + a dropped configuration change for new installs, like /var/lib/mariadb, rather than a building configuration change. |
Match the existing datadir setting for Debian and Ubuntu, which was changed from /var/lib/mysql to /var/lib/mariadb in 1:11.8.6-5.
Existing Debian patch: https://salsa.debian.org/mariadb-team/mariadb-server/-/blob/debian/latest/debian/patches/set-default-datadir-to-var-lib-mariadb.patch