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

openresty-1.13.6.1 - get_primary_peers() and get_backup_peers() fail to return a proper peer's tables #61

Closed
Unigoge opened this issue May 18, 2018 · 2 comments

Comments

@Unigoge
Copy link

Unigoge commented May 18, 2018

Hi,

I have a simple upstream configuration

upstream default {

        zone backend_default 512k;
        
        server 1.1.1.1 max_fails=30 fail_timeout=1;
        server 2.2.2.2 backup;
        server 3.3.3.3 backup;
        keepalive 1000;
}

inside my code I have this

                local backup_servers = upstream_conf.get_backup_peers( "default" );
                ngx.log( ngx.DEBUG, "Backups:\n", utils.serializeTable( backup_servers ));

...which prints this into log file...

2018/05/18 20:12:34 [error] 15726#15726: *5 [lua] tilecache_balancer.lua:113: check_upstreams(): Backups:
{
 1 = {
  current_weight = 0,
  id = 0,
  name = "2.2.2.2:80",
  conns = 0,
  weight = 1,
  fail_timeout = 10,
  effective_weight = 1,
  fails = 0,
  max_fails = 1,
 },
 2 = {
  current_weight = 0,
  id = 1,
  name = "",
  conns = 1.405243031191e+14,
  accessed = 1.4052430311923e+14,
  checked = 12,
  weight = 0,
  fail_timeout = 0,
  effective_weight = 0,
  fails = 15,
  max_fails = 1.4052430312251e+14,
 },
}, client: 127.0.0.1, server: _, request: "GET /health_check HTTP/1.1", host: "127.0.0.1"

...the table for a second backup server looks corrupted ...I have tried to add a second server to primary peers - it also doesn't work properly...

Thanks,
Gene

@agentzh
Copy link
Member

agentzh commented May 18, 2018

@Unigoge This module does not work with the zone directive. This is a known limitation.

@Unigoge
Copy link
Author

Unigoge commented May 19, 2018

Thanks! Good to know :)

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