HashiCorp Consul 00:00:01 Another payments till joins the market The market opens a second payment service. Starting the process, registering its address and passing its health check happen at different moments. Watch those states before allowing the new till to receive shoppers. payments 1 runs and is listed. payments 2 is not there yet. In this registration example the new check begins critical. Its initial status is a configured property of the health check. The server leader replicates the catalog update. Two out of three voting servers form the example majority. The agent calls the health address beside the program. It succeeds, and the new state is stored. The local agent can report service and health information to Consul's servers. A catalog entry can exist even while a health-filtered discovery query excludes it. 00:00:49 Choose what a healthy directory answer means A caller asks for payments through Consul DNS. Give the second till a warning status. Will its address still appear? First identify the query's consistency setting and the health filtering configured for the service. The program asks for the name. Its machine sends consul names to the local agent. With stale DNS reads permitted in this configuration, a follower can return an answer. It may lag a more recent catalog update. This illustrated default filter excludes critical checks while allowing warning instances. With only_passing on, the warning copy is hidden as well. In this example a stricter passing-only setting removes the warning instance as well. Filtering decides which candidates can appear. The caller still has to establish a working connection to its chosen candidate. 00:01:39 One machine disappears while its name is cached Now unplug a market machine. For a short time it remains in some previously obtained address lists. Failure detection and client-side caching introduce different delays, neither of which is eliminated merely by registering a health check. Both copies pass. The machine dies. The list still names it, so some calls fail and the caller must try again. Membership probes and gossip help the agents detect an unreachable node. The associated node-level health state becomes critical. All services of that machine leave the answers, whatever their own checks last said. Once the node's critical status is reflected in the relevant answers, its services are excluded by the filter. Existing clients can still have a cached answer or an open connection. Bound how long each failed call may wait. 00:02:27 The catalog leader vanishes Losing a service instance and losing the catalog leader are different experiments. This time stop the leading server while two healthy voters remain. Follow who can commit a new registration while the election is in progress. Writes go to server 1 and are copied. During election, operations requiring a leader wait or fail. Configured stale reads may continue from a reachable server. Server 2 asks for votes. It gets its own and server 3's: two of three. Server 2 leads. One more loss would stop writes, so replace server 1 soon. The surviving servers can elect a leader and continue committing new state. One further voting-member loss would remove their majority. Stale discovery availability does not prove the control plane is accepting changes. 00:03:19 An old lock holder wakes after the market reopens One worker acquires a session-backed lock for settlement. It freezes, loses its session and a replacement later acquires the lock. The dangerous moment is the original process waking up with yesterday's confidence. Worker A creates a session and acquires the key. It receives number 1. Worker B gets no. It watches the key with a blocking query. A stops answering. Its node check turns critical, the session ends and the lock is freed. After the lock delay B acquires the key and receives number 2. The destination has observed acquisition number two. In this design it rejects a later write carrying the older number one. That last comparison is made by storage, not by a wish that the old worker has stopped. Use a suitable increasing fencing value that the destination actually enforces. The market now distinguishes registration from health, cached discovery from current membership, and lock ownership from authority to perform the final write.