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

changes to ipvs checkers #181

Merged
merged 9 commits into from
Aug 17, 2015
Merged

changes to ipvs checkers #181

merged 9 commits into from
Aug 17, 2015

Conversation

andriyanov
Copy link
Contributor

Hi, Alexandre.

Please consider these changes:

  1. Http retry logic refined, tcp retry feature added
  2. ipvs reflector respects kernel result code
  3. fix re-adding RS caused by rs weight change on reload
  4. ip family config option for a fwmak service
  5. Some minor optimizations around scheduler

New tcp check config option "retry" sets the check retry counter.
If tcp check fails on an alive server, keepalived will perform
another checks until n_retry counter reaches zero, or until the check
succeeds. The delay between retry checks is configured by the
"delay_before_retry" config option.

The default value is 1 retry after 1 second.

This is the same feature that already exists in HTTP checker
(config option "nb_get_retry").
Retry on every error, including timeout and connection
error, but only when RS is up.

This is needed to reduce rs flaps: we shut the server down
only after nb_get_retry failed checks.

Also, do not wait for delay_loop after a successfull check to
bring the server UP.
Previously, if the IPVS reflector was unable to perform
its task, it reported error through syslog and ignored it.

This behavior leads to inconsistancies with quorum-handler:
it is called with UP even if no RS were added into the IPVS.
This could take place, for example, when there is a limit of
opened filehandles and keepalived was unable to open netlink
socket (it is opened on every call to the ipvs_talk).

Now the check is not marked as OK unless IPVS reflector reports
OK. Following successfull check will try to add an RS again.

The special case errors "ENOENT on remove" and "EEXIST on add"
are treated with OK result code.
These functions are turned from int into void:
ipvs_group_sync_entry, ipvs_group_remove_entry, ipvs_syncd_cmd.
	do MD5 calculation only when configured to do so
timer_cmp is called too often and eats much of cpu cycles. Make the comparison more effective.
Increase code re-using in monotonic_gettimeofday().
Use timer_reset_lazy() where possible to omit the excess memset() call.
Since threads are sorted by t->sands, we could break the cycle
when not expired thread found.
Do not remove and re-add a real_server when reloading config
if its weight has changed. Just edit the existing ipvs rs entry.
This option explicitly specifies the address family of a
fwmark IPVS service entry. Previously it was determined by
the AF of the first real server. This logic is kept as a fallback
when the "ip_family" option is missing.

Also, now it is possible to create two different services
for v4 and v6 with the same fwmark number.
acassen added a commit that referenced this pull request Aug 17, 2015
@acassen acassen merged commit 90ea67d into acassen:master Aug 17, 2015
azryve pushed a commit to azryve/keepalived that referenced this pull request Nov 29, 2016
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

Successfully merging this pull request may close these issues.

2 participants