Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop mysql_servers loading to runtime #185

Open
dblore opened this issue Jan 11, 2022 · 1 comment
Open

Stop mysql_servers loading to runtime #185

dblore opened this issue Jan 11, 2022 · 1 comment

Comments

@dblore
Copy link

dblore commented Jan 11, 2022

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.3.0
  • Ruby: 2.5.1p57
  • Distribution: Ubuntu 18.04.5
  • Module version: 5.1.0

How to reproduce (e.g Puppet code you use)


proxysql::mysql_servers:
  - "db-1.%{lookup('base::domain::internal')}":
      port: 3306
      hostgroup_id: 101
      max_connections: 2000
      weight: 1000
      load_to_runtime: false
  - "db-2.%{lookup('base::domain::internal')}":
      port: 3306
      hostgroup_id: 101
      max_connections: 2000
      weight: 1000
      load_to_runtime: false
  - "db-3.%{lookup('base::domain::internal')}":
      port: 3306
      hostgroup_id: 101
      max_connections: 2000
      weight: 1000
      load_to_runtime: false

What are you seeing

Error: Evaluation Error: Error while evaluating a Resource Statement, undefined method `set_optional' for #<Puppet::Pops::Types::ExtraneousKey:0x00007f82d90fd670> at /var/folders/wd/5ty8823s09s4f6h9r1_tkb240000gp/T/ocd-ipc-20220111-22542-1ok330z/ocd-builddir-20220111-22547-12gqe2m/environments/us_perftest/modules/fd_profiles/manifests/mysql/proxysql.pp:25:5

Line 25 is just calling the module

    class { '::proxysql':
      admin_password         => Sensitive($admin_password),
      errorlog_file          => $errorlog_file,
      errorlog_file_mode     => $errorlog_file_mode,
      errorlog_file_owner    => $errorlog_file_owner,
      errorlog_file_group    => $errorlog_file_group,
      monitor_password       => Sensitive($monitor_password),
      package_source         => $package_source,
      package_checksum_value => $package_checksum_value,
      package_checksum_type  => $package_checksum_type,
    }

What behaviour did you expect instead

load_to_runtime to be set false for each mysql server in the hash.

Output log

Any additional information you'd like to impart

It looks to be missing in https://github.com/voxpupuli/puppet-proxysql/blob/35865f2cecc747da6d310fe2d8918d1dddcbcb83/types/server.pp but present in

def flush
update_server(@property_flush) if @property_flush
@property_hash.clear
load_to_runtime = @resource[:load_to_runtime]
mysql([defaults_file, '-NBe', 'LOAD MYSQL SERVERS TO RUNTIME'].compact) if load_to_runtime == :true
save_to_disk = @resource[:save_to_disk]
mysql([defaults_file, '-NBe', 'SAVE MYSQL SERVERS TO DISK'].compact) if save_to_disk == :true
end

This could be a case of us misunderstanding the README, but the end goal is for us not to automatically load just the mysql_servers into runtime via the hiera hash, because our scheduler handles that for us.

It does work when calling proxy_mysql_server directly though

+ Proxy_mysql_server[db-1.blah] =>
   parameters =>
     "hostgroup_id": 100,
     "hostname": "db-1.blah",
     "load_to_runtime": false,
     "port": 3306
@morganhowarth-fd
Copy link

Hey, I'm working with @dblore on this issue and we managed to fix the issue we raised by adding:

Optional[load_to_runtime] => Boolean,

To types/server.pp and testing this on a local instance.

We're not sure if this is the correct place to add this though, given server.pp just seems to have columns that belong to ProxySQL.

If this would be the correct place to add the fix let us know and we can raise a PR for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants