Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-10605

puppetlab-mysql : get_mysql_id creates duplicate server_id

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mysql
    • Labels:
    • Template:
      MODULES Bug Template
    • Acceptance Criteria:
      Hide

      Duplicate keys not happening

      Show
      Duplicate keys not happening
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      Basic Info
      Module Version: 10.4.0
      Puppet Version: n/a
      OS Name/Version: n/a

      mysql_server_id.rb/[https://github.com/puppetlabs/puppetlabs-mysql/blob/95f9b982ef55a257b5641d3ae5289c3b37c70254/lib/facter/mysql_server_id.rb] has code that creates duplicate mysql_server_id. This seems to be related to the fact that we aren't using all possible ids. By using `<< 6` we are getting a maximum id of `67907775`. However if we use `<< 8` we get a maximum of `4294967295` which matches the maximum server_id of mysql

      Desired Behavior:

      irb(main):003:0> "e4:43:4b:28:e6:5c".split(':')[2..-1].reduce(0) { |total, value| (total << 8) + value.hex }
      => 1260971612
      irb(main):004:0> "e4:43:4b:28:e7:1c".split(':')[2..-1].reduce(0) { |total, value| (total << 8) + value.hex }
      => 1260971804

      Actual Behavior:

      irb(main):001:0> "e4:43:4b:28:e6:5c".split(':')[2..-1].reduce(0) { |total, value| (total << 6) + value.hex }
      => 19839452
      irb(main):002:0> "e4:43:4b:28:e7:1c".split(':')[2..-1].reduce(0) { |total, value| (total << 6) + value.hex }
      => 19839452

       

      Previous issue: https://tickets.puppetlabs.com/browse/MODULES-2675

        Attachments

          Activity

            People

            Assignee:
            sheena Sheena Tharakanparampil
            Reporter:
            tomkrouper Tom Krouper
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support