Skip to content

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

Closed
@Unigoge

Description

@Unigoge

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions