From 7e23b57014e65a5225260924979c9a359cd0f98e Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Fri, 27 Feb 2026 00:49:27 +0300 Subject: [PATCH] Do not save watch revision from initial created: true messages --- src/client/etcd_state_client.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/etcd_state_client.cpp b/src/client/etcd_state_client.cpp index 5cdaa399..bacf348d 100644 --- a/src/client/etcd_state_client.cpp +++ b/src/client/etcd_state_client.cpp @@ -414,7 +414,10 @@ void etcd_state_client_t::start_etcd_watcher() } // Save revision only if it's present in the message - because sometimes etcd sends something without a header, like: // {"error": {"grpc_code": 14, "http_code": 503, "http_status": "Service Unavailable", "message": "error reading from server: EOF"}} - if (etcd_watches_initialised == ETCD_TOTAL_WATCHES && !data["result"]["header"]["revision"].is_null()) + // Also don't save revision from the initial created: true messages because they always contain the latest revision + if (etcd_watches_initialised == ETCD_TOTAL_WATCHES && + !data["result"]["header"]["revision"].is_null() && + !data["result"]["created"].bool_value()) { // Restart watchers from the same revision number as in the last received message, // not from the next one to protect against revision being split into multiple messages,