Skip to content

ipvssync changes rt of real server when changing weight if services have different rt. #6

@gvkeller

Description

@gvkeller

Given the following config, any time the weight of a real server is changed, the routing type is set to the same as the service with the lowest fwmark.

<surealived>
        <virtual name="custweb" port="80" proto="fwmark" sched="wlc" rt="dr" fwmark="1">
          <tester loopdelay="5" timeout="2" retries2fail="6" retries2ok="12" 
                  proto="tcp" testport="80"
                  stats_samples="10"
                  notify_min_reals="1"
                  remove_on_fail="0"
                />
          <real name="web1" addr="XXXX" port="80" weight="20"/>
        </virtual>
        <virtual name="custweb2" port="80" proto="fwmark" sched="wlc" rt="tun" fwmark="2">
          <tester loopdelay="5" timeout="2" retries2fail="6" retries2ok="12" 
                  proto="tcp" testport="80"
                  stats_samples="10"
                  notify_min_reals="1"
                  remove_on_fail="0"
                />
          <real name="web2" addr="XXXX" port="80" weight="20"/>
        </virtual>
</surealived>

After a fresh start of the service it looks correct:

# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
FWM  1 wlc
  -> web1:80        Route   20     0          0         
FWM  2 wlc
  -> web2:80        Tunnel  0      0          0      

After allowing the test on the second real service to succeed:

# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
FWM  1 wlc
  -> web1:80        Route   20     0          0         
FWM  2 wlc
  -> web2:80        Route   20     0          0  

I have tried different combinations of routing types and fwmarks, the consistent thing is that the real servers are always changed with the type of the service with the lowest fwmark value. The only error I have managed to catch that may be relevant is:

[2021-01-08 11:26:48.877753] debug : * add_dest: [0.0.0.0:0 proto=6 fwmark=2 :: XXXX:80 proto=6 fwmark=2] [2021-01-08 11:26:48.877907] debug : * ERROR add_dest: [0.0.0.0:0 proto=6 fwmark=2 :: XXXX:80 proto=6 fwmark=2] [File exists]

which only occurs when the lower fwmark service is changed.

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