Revolyssup commented on code in PR #11149:
URL: https://github.com/apache/apisix/pull/11149#discussion_r1562059953


##########
apisix/core/config_etcd.lua:
##########
@@ -328,21 +327,37 @@ local function sync_data(self)
         return true
     end
 
+    ::waitdir::
+    -- get latest uncompacted revision
+    local res, err = self.etcd_cli:get('/nonexisting',{
+        count_only = true,
+        range_end = "\0"
+    })
+    if err then
+        log.error("failed to get latest uncompacted revision: ", err)
+    end
+    local rev
+    if res and res.body and res.body.header and res.body.header.revision then
+        rev = tonumber(res.body.header.revision)
+    end
     local dir_res, err = waitdir(self.etcd_cli, self.key, self.prev_index + 1, 
self.timeout)
     log.info("waitdir key: ", self.key, " prev_index: ", self.prev_index + 1)
     log.info("res: ", json.delay_encode(dir_res, true))
-
     if not dir_res then
-        if err == "compacted" then

Review Comment:
   okay



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to