# Seamless at DNS discovery and seamless reload

**URL:** <https://discourse.haproxy.org/t/seamless-at-dns-discovery-and-seamless-reload/7330>\
**Category:** Help!\
**Created:** [January 27, 2022, 1:03pm UTC](https://discourse.haproxy.org/t/seamless-at-dns-discovery-and-seamless-reload/7330 "2022-01-27T13:03:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nimdrak](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@nimdrak](https://discourse.haproxy.org/u/nimdrak)\
**Post date:** [January 27, 2022, 1:03pm UTC](https://discourse.haproxy.org/t/seamless-at-dns-discovery-and-seamless-reload/7330/1 "2022-01-27T13:03:33Z")

</div>

I wonder that connection lost occur or not (seamless, graceful or not)

- when a existing server disappears at a A record from DNS discovery
- when a new server appears at a A record from DNS discovery

I tested them found that there is no connection lost.  
But I still wonder it’s really seamless and how it works.  
However it is hard to find their answer at document [HAProxy version 2.5-dev0 - Configuration Manual](https://cbonte.github.io/haproxy-dconv/2.5/configuration.html#5.3). It looks there is no answer about below questions, at the document.

1. When a existing server disappears or a new server appears at a A record from DNS discovery, HAProxy process reloads its configure?

2. If it’s not, HAProxy process just modify its ip from a A record, like `echo "set server address" | socat stdio /var/run/hapee-lb.sock`? If then, `set server address` is always seamless?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [January 27, 2022, 3:19pm UTC](https://discourse.haproxy.org/t/seamless-at-dns-discovery-and-seamless-reload/7330/2 "2022-01-27T15:19:46Z")

</div>

1. DNS discovery does not use reloads.
2. Yes, that’s a good comparison, the DNS discovery updates the server similarly to how a `set server address` would update the IP address.

The important thing is: the list of configured servers in a backend is only used for _new connections_, established connections (or in HTTP mode in flight transactions) are never interrupted, because the routing decision is only made once.

---

<div class="post-metadata">

**Author:** ![nimdrak](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@nimdrak](https://discourse.haproxy.org/u/nimdrak)\
**Post date:** [January 27, 2022, 3:32pm UTC](https://discourse.haproxy.org/t/seamless-at-dns-discovery-and-seamless-reload/7330/3 "2022-01-27T15:32:45Z")

</div>

Thank you so much again. 🙇‍♂️  
Then although the list of configured servers are updated through `set server address`, established connections at a server on outdated backend can close gracefully because they are never interrupted.  
Is it correct?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [January 27, 2022, 4:11pm UTC](https://discourse.haproxy.org/t/seamless-at-dns-discovery-and-seamless-reload/7330/4 "2022-01-27T16:11:37Z")

</div>

Yes correct.

There are differences between HTTP mode (this applies to a HTTP transaction, since there is no 1:1 connection relationships) and TCP mode (this applies to an actual connection - since there is a 1:1 releationship between a connection on the frontend and a connection on the backend), but the point is that the client will not be see anything surprising, only you use “stop/restart” commands (killing haproxy) or use something like `shutdown session` on the admin socket.

---

<div class="post-metadata">

**Author:** ![nimdrak](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@nimdrak](https://discourse.haproxy.org/u/nimdrak)\
**Post date:** [January 28, 2022, 1:18am UTC](https://discourse.haproxy.org/t/seamless-at-dns-discovery-and-seamless-reload/7330/5 "2022-01-28T01:18:27Z")

</div>

I see. I appreciate your reply!

- although there is difference of 1:1 connection in HTTP mode and TCP mode, connections are not lost at Two modes when DNS remove a server in A record. is it correct?
- You mean at HTTP mode, each http connection is handled by `http-reuse` connection pool and there is no 1:1 connection relations?
- Could you explain the words `only you use “stop/restart” commands (killing haproxy) or use something like `shutdown session` on the admin socket.`? It mean the client only notice when the haproxy stop/restart or shutdown session?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [January 28, 2022, 9:49am UTC](https://discourse.haproxy.org/t/seamless-at-dns-discovery-and-seamless-reload/7330/6 "2022-01-28T09:49:27Z")

</div>

No client will never notice anything, everything is gracefully handled in a reload or DNS update situation. Only if you stop, restart or shutdown a session manually on the admin socket will the client be disconnected and the in flight data interrupted.

---

<div class="post-metadata">

**Author:** ![nimdrak](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@nimdrak](https://discourse.haproxy.org/u/nimdrak)\
**Post date:** [February 3, 2022, 3:28am UTC](https://discourse.haproxy.org/t/seamless-at-dns-discovery-and-seamless-reload/7330/7 "2022-02-03T03:28:12Z")

</div>

I understand. Thanks for your detailed explanation!
