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

replicate- filters for slaves with a connection name that contain an underscore are ignored

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • 10.0.10
    • 10.0.11
    • None
    • None

    Description

      Following the documentation here:

      https://mariadb.com/kb/en/multi-source-replication/

      The replicate- variables do not work if the connection_name has an underscore. Considering the example on the page:

      mysqld --main_connection.replicate_do_db=main_database

      If that were to be put in a config file, it would not be loaded because of the underscore in 'main_connection'. I have tried quoting numerous ways and was advised to make a bug report, "There is something about replacing _ with - (or vice versa) in option names, probably that is interfering"

      Attachments

        Activity

          elenst Elena Stepanova added a comment - - edited

          Could you please attach all your config files which contain either this-instance-specific or common sections, and the complete output of SHOW VARIABLES and SHOW ALL SLAVES STATUS \G ? (Please remove/obfuscate the passwords and any private info).

          And the server command line as returned by ps -ef | grep mysqld or alike.

          Thanks.

          elenst Elena Stepanova added a comment - - edited Could you please attach all your config files which contain either this-instance-specific or common sections, and the complete output of SHOW VARIABLES and SHOW ALL SLAVES STATUS \G ? (Please remove/obfuscate the passwords and any private info). And the server command line as returned by ps -ef | grep mysqld or alike. Thanks.
          sophomeric Eric Webster added a comment -

          Ah, looking at ps, I can see the mysqld portion of it looks like this:

          --signup-archive.replicate-wild-do-table=mysql.%

          You can see the _ has been replaced by a hyphen. The command is listed correctly on the mysqld_safe part of the process:

          --signup_archive.replicate-wild-do-table=mysql.%

          I think that is fairly telling.

          sophomeric Eric Webster added a comment - Ah, looking at ps, I can see the mysqld portion of it looks like this: --signup-archive.replicate-wild-do-table=mysql.% You can see the _ has been replaced by a hyphen. The command is listed correctly on the mysqld_safe part of the process: --signup_archive.replicate-wild-do-table=mysql.% I think that is fairly telling.

          Thanks.

          So, the problem is the whole chain.
          mysqld_multi converts the pseudo-cnf into a command line and feeds it to mysqld_safe.
          mysqld_safe takes the options from the command line and "normalizes" them by replacing _ with -.
          mysqld reads the options and acts accordingly.

          If it wasn't mysqld_multi's pseudo config, but a normal config, standard server's section, it wouldn't have happened because the options would remain in the cnf file where mysqld would have read them from as they are.
          Or, if mysqd_multi was calling mysqld directly rather than via mysqld_safe, it would have worked because mysqld_multi doesn't modify the options, and mysqld is able to process them.

          You can use either of that as a workaround.

          elenst Elena Stepanova added a comment - Thanks. So, the problem is the whole chain. mysqld_multi converts the pseudo-cnf into a command line and feeds it to mysqld_safe. mysqld_safe takes the options from the command line and "normalizes" them by replacing _ with -. mysqld reads the options and acts accordingly. If it wasn't mysqld_multi's pseudo config, but a normal config, standard server's section, it wouldn't have happened because the options would remain in the cnf file where mysqld would have read them from as they are. Or, if mysqd_multi was calling mysqld directly rather than via mysqld_safe, it would have worked because mysqld_multi doesn't modify the options, and mysqld is able to process them. You can use either of that as a workaround.
          sophomeric Eric Webster added a comment -

          It does work correctly when using mysql (not mysqld_multi), so I think the problem is there.

          sophomeric Eric Webster added a comment - It does work correctly when using mysql (not mysqld_multi), so I think the problem is there.

          serg,

          This is something for you to decide, I'm not sure what would be a better (or less bad) fix.

          The logic which mixes up slave identificators and option names doesn't look great, but since we've let it reach GA, I guess it will have to stay (I really don't remember how it made it there).

          The logic which replaces '_' with '-' in mysqld_safe is intentional, it was introduced by the following revision:

          revision-id: guilhem@mysql.com-20091118203617-3jfudef971r7bf2y
          committer: Guilhem Bichot <guilhem@mysql.com>
          branch nick: mysql-next-mr-bugfixing
          timestamp: Wed 2009-11-18 21:36:17 +0100
          message:
            Backport of the fix for BUG#40368 "mysqld_safe not honouring underscore same as dash on server options" from 6.0
            (revision-id:guilhem@mysql.com-20090505113602-l12kxupeatve18dh).
            Such bug led "mysqld_safe --core_file_size=#" to not work because mysqld_safe wouldn't recognize
            that "ulimit -c" is needed; only --core-file-size=# worked. Same for --open_files_limit and other
            options with _ where mysqld_safe needs to do something more than passing to mysqld.
            Original fix by Erik Ljungstrom erik at ibiblio dot org ; slightly modified here.
            Tested on all internally accessible Unix.

          So, while technically it's primitive to remove the conversion, probably we'll need to re-do core_file_size and the others. Since the "other options" are not listed, we might have to do that for every option which has special logic in mysqld_safe, and then it might make sense to do it a different way, e.g. to make a local copy of options for mysqld_safe's tampering, but keep the original ones to pass to mysqld, but it makes the change rather big. Or maybe you'll come up with a better idea, I don't like any of those.

          elenst Elena Stepanova added a comment - serg , This is something for you to decide, I'm not sure what would be a better (or less bad) fix. The logic which mixes up slave identificators and option names doesn't look great, but since we've let it reach GA, I guess it will have to stay (I really don't remember how it made it there). The logic which replaces '_' with '-' in mysqld_safe is intentional, it was introduced by the following revision: revision-id: guilhem@mysql.com-20091118203617-3jfudef971r7bf2y committer: Guilhem Bichot <guilhem@mysql.com> branch nick: mysql-next-mr-bugfixing timestamp: Wed 2009-11-18 21:36:17 +0100 message: Backport of the fix for BUG#40368 "mysqld_safe not honouring underscore same as dash on server options" from 6.0 (revision-id:guilhem@mysql.com-20090505113602-l12kxupeatve18dh). Such bug led "mysqld_safe --core_file_size=#" to not work because mysqld_safe wouldn't recognize that "ulimit -c" is needed; only --core-file-size=# worked. Same for --open_files_limit and other options with _ where mysqld_safe needs to do something more than passing to mysqld. Original fix by Erik Ljungstrom erik at ibiblio dot org ; slightly modified here. Tested on all internally accessible Unix. So, while technically it's primitive to remove the conversion, probably we'll need to re-do core_file_size and the others. Since the "other options" are not listed, we might have to do that for every option which has special logic in mysqld_safe, and then it might make sense to do it a different way, e.g. to make a local copy of options for mysqld_safe's tampering, but keep the original ones to pass to mysqld, but it makes the change rather big. Or maybe you'll come up with a better idea, I don't like any of those.

          People

            serg Sergei Golubchik
            sophomeric Eric Webster
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.