Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-30203

Move mysql symlinks to different package

Details

    Description

      By making the symlinks an optional package, users can get a clean install without naming conflicts, and also be able to install a package for compatibility with scripts.

      Eventually this package will be made optional and maybe even removed.

      Attachments

        Issue Links

          Activity

            danblack Daniel Black created issue -
            danblack Daniel Black made changes -
            Field Original Value New Value

            Sergei's original thoughts on this:

            • a separate package with symlinks, like mariadb-server-compat, mariadb-client-compat (using debian names), mariadb-server-core-compat, etc
              problem: too many new packages (almost 2x). confusing?
            • one package mariadb-compat with all symlinks
              problem: it will require all mariadb packages, one will have to install everything.
            • one package that doesn't include symlinks, but creates them in the postinst script, looking at what other mariadb* packages are installed
              problem: fragile, depends on installation order
            • one package that installs, say, /etc/mariadb-create-compatibility-symlinks.flag and every package creates symlinks in postinst if the flag is present
              or may be a tool /usr/bin/mariadb-create-compatibility-symlinks does it if the flag is set, and postinst scripts invoke it, so that the user could regenerate symlinks without reinstalling

            Several discussions with subject matter experts for Debian and RedHat packaging have happened. It is looking like the first option is probably the best. RedHat mentioned that they don't like having packages that have files generated by scripts. Doing so makes it difficult to trace which file came from which package, and there are other potential issues during upgrades or switching MariaDB <-> MySQL.

            Debian mentioned that you can't have a package install symlinks that link to missing files with Debian packages, so that rules out the single package option.

            TheLinuxJedi Andrew Hutchings (Inactive) added a comment - Sergei's original thoughts on this: a separate package with symlinks, like mariadb-server-compat, mariadb-client-compat (using debian names), mariadb-server-core-compat, etc problem: too many new packages (almost 2x). confusing? one package mariadb-compat with all symlinks problem: it will require all mariadb packages, one will have to install everything. one package that doesn't include symlinks, but creates them in the postinst script, looking at what other mariadb* packages are installed problem: fragile, depends on installation order one package that installs, say, /etc/mariadb-create-compatibility-symlinks.flag and every package creates symlinks in postinst if the flag is present or may be a tool /usr/bin/mariadb-create-compatibility-symlinks does it if the flag is set, and postinst scripts invoke it, so that the user could regenerate symlinks without reinstalling Several discussions with subject matter experts for Debian and RedHat packaging have happened. It is looking like the first option is probably the best. RedHat mentioned that they don't like having packages that have files generated by scripts. Doing so makes it difficult to trace which file came from which package, and there are other potential issues during upgrades or switching MariaDB <-> MySQL. Debian mentioned that you can't have a package install symlinks that link to missing files with Debian packages, so that rules out the single package option.
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            Assignee Andrew Hutchings [ JIRAUSER52179 ]
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            Fix Version/s N/A [ 14700 ]
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            Status In Progress [ 3 ] Needs Feedback [ 10501 ]
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            Assignee Andrew Hutchings [ JIRAUSER52179 ] Sergei Golubchik [ serg ]

            If distros dislike dynamically created symlinks, then let's implement the first option, indeed.

            serg Sergei Golubchik added a comment - If distros dislike dynamically created symlinks, then let's implement the first option, indeed.
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Andrew Hutchings [ JIRAUSER52179 ]
            Status Needs Feedback [ 10501 ] Open [ 1 ]
            danblack Daniel Black added a comment -

            After looking what was generated with:

            diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake
            index 06bdfce14de..09623513a05 100644
            --- a/cmake/mysql_add_executable.cmake
            +++ b/cmake/mysql_add_executable.cmake
            @@ -106,7 +106,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
                      ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${link}
                      DESTINATION
                      ${ARG_DESTINATION}
            -         COMPONENT ${COMP})
            +         COMPONENT ${COMP}-symlinks)
                 ELSE()
                   # Windows note:
            

            The list of packages for symlinks is just:

            • Server
            • Client
            • Test
            • backup
            • rocksdb-engine

            Doing the same for scripts:

            diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
            index 9eec793c9fb..416d4a68415 100644
            --- a/scripts/CMakeLists.txt
            +++ b/scripts/CMakeLists.txt
            @@ -373,7 +373,7 @@ ELSE()
                 INSTALL_SCRIPT(
                   ${CMAKE_CURRENT_BINARY_DIR}/${file}
                   DESTINATION ${INSTALL_BINDIR}
            -      COMPONENT ${${file}_COMPONENT}
            +      COMPONENT ${${file}_COMPONENT}-symlinks
                 )
             
                 # make scripts executable in build dir
            

            Adds "Development" to the list.

            bb-10.11-danielblack-MDEV-30203-pkgtest-rpm-symlink-packages, which generates symlink packages.

            danblack Daniel Black added a comment - After looking what was generated with: diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake index 06bdfce14de..09623513a05 100644 --- a/cmake/mysql_add_executable.cmake +++ b/cmake/mysql_add_executable.cmake @@ -106,7 +106,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE) ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${link} DESTINATION ${ARG_DESTINATION} - COMPONENT ${COMP}) + COMPONENT ${COMP}-symlinks) ELSE() # Windows note: The list of packages for symlinks is just: Server Client Test backup rocksdb-engine Doing the same for scripts: diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 9eec793c9fb..416d4a68415 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -373,7 +373,7 @@ ELSE() INSTALL_SCRIPT( ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION ${INSTALL_BINDIR} - COMPONENT ${${file}_COMPONENT} + COMPONENT ${${file}_COMPONENT}-symlinks ) # make scripts executable in build dir Adds "Development" to the list. bb-10.11-danielblack-MDEV-30203-pkgtest-rpm-symlink-packages , which generates symlink packages .
            danblack Daniel Black added a comment -

            note backup is mariabackup -> mariadb-backup which is old compat and could be dropped?

            danblack Daniel Black added a comment - note backup is mariabackup -> mariadb-backup which is old compat and could be dropped?
            serg Sergei Golubchik made changes -
            Assignee Andrew Hutchings [ JIRAUSER52179 ] Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Status Stalled [ 10000 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Daniel Black [ danblack ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.12 [ 28320 ]
            Fix Version/s N/A [ 14700 ]
            danblack Daniel Black made changes -
            danblack Daniel Black added a comment -

            Removing last bit of mysql references in MDEV-30275 needed for compat packages to be truly optional.

            danblack Daniel Black added a comment - Removing last bit of mysql references in MDEV-30275 needed for compat packages to be truly optional.
            danblack Daniel Black added a comment - https://github.com/MariaDB/server/pull/2390
            danblack Daniel Black made changes -
            Assignee Daniel Black [ danblack ] Sergei Golubchik [ serg ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Status In Review [ 10002 ] In Testing [ 10301 ]
            elenst Elena Stepanova made changes -
            Assignee Sergei Golubchik [ serg ] Elena Stepanova [ elenst ]
            danblack Daniel Black added a comment -

            So the update plan is:

            *-compat, both RPM and Debs are an optional package containing the mysql compatibility links. The man pages thanks to Sergei are the man page forms of links in a man page format.

            The client or server packages in 11.0 are recommending the compat package that provides links to executables the the client/server package.

            Some small cleanups putting man pages into the right packages like s3 and rocksdb.

            danblack Daniel Black added a comment - So the update plan is: *-compat , both RPM and Debs are an optional package containing the mysql compatibility links. The man pages thanks to Sergei are the man page forms of links in a man page format. The client or server packages in 11.0 are recommending the compat package that provides links to executables the the client/server package. Some small cleanups putting man pages into the right packages like s3 and rocksdb.
            danblack Daniel Black added a comment -

            bb-11.0-danielblack-preview-MDEV-30203-fix updates the handling of scripts.

            danblack Daniel Black added a comment - bb-11.0-danielblack-preview- MDEV-30203 -fix updates the handling of scripts.
            danblack Daniel Black added a comment - https://buildbot.mariadb.org/#/grid?branch=bb-11.0-danielblack-preview-MDEV-30203-fix-pkgtest (same branch different name) generated RPMs in https://ci.mariadb.org/31771/ for testing.
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova added a comment - - edited

            I have no objections against pushing 1e6e88fc073e3a766ca in 11.0 and releasing with 11.0.1.

            It appears that on systems which we currently release, the packages with symlinks (mariadb-server-compat and mariadb-client-compat) are installed by default, so hopefully the inconvenience to the users is minimal at this point. Still, it would be very good if users tried it out in their environments and reported issues they observe.

            On debs the packages can be opted out.
            Upd: as shown in the comment below, for RPMs they can be opted out too, except for older versions which don't support weak dependencies (e.g. RHEL 7).

            It's not clear how distributions are going to handle it when the time comes – will they follow the same pattern and build separate packages, or will they do it some other way, but it is a problem for the future.


            Upd:
            In regard to RPMs, there is a problem with repository creation, which affected the testing and may affect the release as well. We may have to upgrade createrepo before the release for the recommended packages to work, but it is outside the scope of this task.

            elenst Elena Stepanova added a comment - - edited I have no objections against pushing 1e6e88fc073e3a766ca in 11.0 and releasing with 11.0.1. It appears that on systems which we currently release, the packages with symlinks (mariadb-server-compat and mariadb-client-compat) are installed by default, so hopefully the inconvenience to the users is minimal at this point. Still, it would be very good if users tried it out in their environments and reported issues they observe. On debs the packages can be opted out. Upd: as shown in the comment below, for RPMs they can be opted out too, except for older versions which don't support weak dependencies (e.g. RHEL 7). It's not clear how distributions are going to handle it when the time comes – will they follow the same pattern and build separate packages, or will they do it some other way, but it is a problem for the future. Upd: In regard to RPMs, there is a problem with repository creation, which affected the testing and may affect the release as well. We may have to upgrade createrepo before the release for the recommended packages to work, but it is outside the scope of this task.
            elenst Elena Stepanova made changes -
            Assignee Elena Stepanova [ elenst ] Sergei Golubchik [ serg ]
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            serg Sergei Golubchik added a comment - - edited

            One can opt out with rpms too, we do it in buildbot with

            sudo dnf --setopt=install_weak_deps=False instal ...
            

            I'll push 9656356b5500 instead which differs from 1e6e88fc073e3a766ca in corrected man pages for mariadb*embedded tools

            serg Sergei Golubchik added a comment - - edited One can opt out with rpms too, we do it in buildbot with sudo dnf --setopt=install_weak_deps=False instal ... I'll push 9656356b5500 instead which differs from 1e6e88fc073e3a766ca in corrected man pages for mariadb*embedded tools
            serg Sergei Golubchik made changes -
            Component/s Platform Debian [ 10136 ]
            Component/s Platform RedHat [ 11302 ]
            Fix Version/s 11.0.1 [ 28548 ]
            Fix Version/s 11.0 [ 28320 ]
            Assignee Sergei Golubchik [ serg ] Daniel Black [ danblack ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            elenst Elena Stepanova made changes -
            Assignee Daniel Black [ danblack ] Elena Stepanova [ elenst ]
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Stalled [ 10000 ]
            elenst Elena Stepanova made changes -
            Priority Major [ 3 ] Blocker [ 1 ]
            elenst Elena Stepanova made changes -
            Comment [ My previous comment turns out to be wrong in many ways, I'll edit it to avoid confusion, and re-open the task.

            RPM testing has gone wrong, observations from different revisions got mixed up and bad assumptions were made.

            It appears that in the current version
            - for RHEL-7, dependency on {{-compat}} is strong, it cannot be opted out (even if {{install_weak_deps}} works there at all, I'm not sure it does), and can *not* be removed without pulling its main package along;
            - for RHEL-9, dependency is weak, and {{\-compat}} is *not* installed by default, or even with explicit {{--setopt=install_weak_deps=True}}

            We don't see it in buildbot, because we install locally stored packages and they all are listed explicitly on the command line.

            ]
            elenst Elena Stepanova made changes -
            Assignee Elena Stepanova [ elenst ] Daniel Black [ danblack ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            danblack Daniel Black added a comment -

            Thanks serg, elenst for fixes and testing.

            createrepo with the --setopt=install_weak_deps=False is sufficient for an install base on ci.mariadb.org using createrepo in its rpm artifacts.

            [root@citest-1 dan]# cat /etc/yum.repos.d/MariaDB*.repo 
            [MariaDB-11.0]
            name=MariaDB bb 11.0
            baseurl=https://ci.mariadb.org/32474/amd64-rhel-8-rpm-autobake/rpms
            gpgcheck=0
            module_hotfixes=1
            enabled=1
             
            [root@citest-1 dan]# dnf --setopt=install_weak_deps=False MariaDB-client
            Updating Subscription Management repositories.
            No such command: MariaDB-client. Please use /bin/dnf --help
            It could be a DNF plugin command, try: "dnf install 'dnf-command(MariaDB-client)'"
            [root@citest-1 dan]# dnf --setopt=install_weak_deps=False install MariaDB-client
            Updating Subscription Management repositories.
            Last metadata expiration check: 0:45:03 ago on Sun 12 Feb 2023 11:56:30 PM EST.
            Dependencies resolved.
            ================================================================================================================================
             Package                     Arch        Version                                    Repository                             Size
            ================================================================================================================================
            Installing:
             MariaDB-client              x86_64      11.0.1-1.el8                               MariaDB-11.0                           16 M
            Installing dependencies:
             MariaDB-common              x86_64      11.0.1-1.el8                               MariaDB-11.0                           88 k
             MariaDB-shared              x86_64      11.0.1-1.el8                               MariaDB-11.0                          119 k
            ...
            (and no MariaDB-client-compat)
            

            danblack Daniel Black added a comment - Thanks serg , elenst for fixes and testing. createrepo with the --setopt=install_weak_deps=False is sufficient for an install base on ci.mariadb.org using createrepo in its rpm artifacts. [root@citest-1 dan]# cat /etc/yum.repos.d/MariaDB*.repo [MariaDB-11.0] name=MariaDB bb 11.0 baseurl=https://ci.mariadb.org/32474/amd64-rhel-8-rpm-autobake/rpms gpgcheck=0 module_hotfixes=1 enabled=1   [root@citest-1 dan]# dnf --setopt=install_weak_deps=False MariaDB-client Updating Subscription Management repositories. No such command: MariaDB-client. Please use /bin/dnf --help It could be a DNF plugin command, try: "dnf install 'dnf-command(MariaDB-client)'" [root@citest-1 dan]# dnf --setopt=install_weak_deps=False install MariaDB-client Updating Subscription Management repositories. Last metadata expiration check: 0:45:03 ago on Sun 12 Feb 2023 11:56:30 PM EST. Dependencies resolved. ================================================================================================================================ Package Arch Version Repository Size ================================================================================================================================ Installing: MariaDB-client x86_64 11.0.1-1.el8 MariaDB-11.0 16 M Installing dependencies: MariaDB-common x86_64 11.0.1-1.el8 MariaDB-11.0 88 k MariaDB-shared x86_64 11.0.1-1.el8 MariaDB-11.0 119 k ... (and no MariaDB-client-compat)

            danblack,

            What createrepo does on ci.mariadb.org is unfortunately irrelevant, it is not the same repo as we release. Same faulty assumption was made during testing, that all of them are the same.

            If you look for example into https://ci.mariadb.org/32167/amd64-rhel-9-rpm-autobake/rpms/ which built from the release revision of 10.9, specifically file https://ci.mariadb.org/32167/amd64-rhel-9-rpm-autobake/rpms/repodata/44f64647a2f1d8d1f8d56a60ddefe5ad1acfab10018461996efbc7d5a438d517-primary.xml.gz, it has these blocks:

                <rpm:recommends>
                  <rpm:entry name="jemalloc"/>
                </rpm:recommends>
            ...
                <rpm:recommends>
                  <rpm:entry name="pv"/>
                </rpm:recommends>
            

            but the file in the actual release repo http://mirror.mariadb.org/yum/10.9/rhel9-amd64/repodata/8a22a2af34cc4f0b3fbd7c61de213cd637f1e45af18f4de1afbcca426943ca46-primary.xml.gz does not have them.

            The release build environment has 0.10.3 which is pretty old, it may be not aware of recommends dependencies same way as old rpm does not know about it.

            Same is happening with the new compat packages, except that we don't have a release-like repo yet.
            I've just created a repo here https://buildbot.mariadb.net/archive/pack/bb-11.0-all-builders/build-53221/kvm-rpm-rhel9-amd64/rpms/ , I think I am using the same createrepo version as the release process does. As you can see, compat packages are not pulled from there.

            elenst Elena Stepanova added a comment - danblack , What createrepo does on ci.mariadb.org is unfortunately irrelevant, it is not the same repo as we release. Same faulty assumption was made during testing, that all of them are the same. If you look for example into https://ci.mariadb.org/32167/amd64-rhel-9-rpm-autobake/rpms/ which built from the release revision of 10.9, specifically file https://ci.mariadb.org/32167/amd64-rhel-9-rpm-autobake/rpms/repodata/44f64647a2f1d8d1f8d56a60ddefe5ad1acfab10018461996efbc7d5a438d517-primary.xml.gz , it has these blocks: <rpm:recommends> <rpm:entry name="jemalloc"/> </rpm:recommends> ... <rpm:recommends> <rpm:entry name="pv"/> </rpm:recommends> but the file in the actual release repo http://mirror.mariadb.org/yum/10.9/rhel9-amd64/repodata/8a22a2af34cc4f0b3fbd7c61de213cd637f1e45af18f4de1afbcca426943ca46-primary.xml.gz does not have them. The release build environment has 0.10.3 which is pretty old, it may be not aware of recommends dependencies same way as old rpm does not know about it. Same is happening with the new compat packages, except that we don't have a release-like repo yet. I've just created a repo here https://buildbot.mariadb.net/archive/pack/bb-11.0-all-builders/build-53221/kvm-rpm-rhel9-amd64/rpms/ , I think I am using the same createrepo version as the release process does. As you can see, compat packages are not pulled from there.
            ralf.gebhardt Ralf Gebhardt made changes -
            Labels Preview_11.0

            People

              danblack Daniel Black
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.