Yiyiyimu commented on a change in pull request #2299:
URL: https://github.com/apache/apisix/pull/2299#discussion_r495412704
##########
File path: apisix/core/config_etcd.lua
##########
@@ -246,24 +248,9 @@ local function sync_data(self)
return true
end
- -- for fetch the etcd index
- local key_res, _ = getkey(self.etcd_cli, self.key)
-
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 err == "timeout" then
Review comment:
But we also need to consider history compaction, or the accumulation of
history would affect performance in a long term. Reference:
https://etcd.io/docs/v3.4.0/op-guide/maintenance/#history-compaction
There are two options to tackle this problem:
1. Use etcd native client, which shown on the website, that could auto
compact history at certain revision/period gap. But since etcd and apisix could
be deployed on different machines so this could not work.
2. Develop `compact` in lua-resty-etcd. I came across some problem on it
three months ago. I could go back trying to fix it.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]