mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-14 08:51:29 +08:00
parent
0654687aed
commit
f2655013b1
@ -290,6 +290,13 @@ local function sync_data(self)
|
||||
log.info("res: ", json.delay_encode(dir_res, true))
|
||||
|
||||
if not dir_res then
|
||||
if err == "compacted" then
|
||||
self.need_reload = true
|
||||
log.warn("waitdir [", self.key, "] err: ", err,
|
||||
", need to fully reload")
|
||||
return false
|
||||
end
|
||||
|
||||
return false, err
|
||||
end
|
||||
|
||||
|
@ -118,6 +118,15 @@ function _M.watch_format(v3res)
|
||||
v2res.body = {
|
||||
node = {}
|
||||
}
|
||||
|
||||
local compact_revision = v3res.result.compact_revision
|
||||
if compact_revision and tonumber(compact_revision) > 0 then
|
||||
-- When the revisions are compacted, there might be compacted changes
|
||||
-- which are unsynced. So we need to do a fully sync.
|
||||
-- TODO: cover this branch in CI
|
||||
return nil, "compacted"
|
||||
end
|
||||
|
||||
for i, event in ipairs(v3res.result.events) do
|
||||
v2res.body.node[i] = kvs_to_node(event.kv)
|
||||
if event.type == "DELETE" then
|
||||
|
Loading…
Reference in New Issue
Block a user