Skip to content

Commit

Permalink
debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Nov 3, 2024
1 parent 9ad5262 commit 4632d09
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,32 @@ function _M:init_dp(manager)
return nil, "default namespace does not exist inside params"
end

ngx_log(ngx_INFO,
"[kong.sync.v2] notify_new_version: ", node_id,
", new_version of CP is ", default_new_version)

local version = default_new_version.new_version
if not version then
return nil, "'new_version' key does not exist"
end

local lmdb_ver = tonumber(declarative.get_current_hash()) or 0

ngx_log(ngx_INFO,
"[kong.sync.v2] notify_new_version: ", node_id,
", current_version is ", lmdb_ver)

if lmdb_ver < version then
ngx_log(ngx_INFO,
"[kong.sync.v2] notify_new_version: ", node_id,
", start a sync.")
return self:sync_once()
end

ngx_log(ngx_INFO,
"[kong.sync.v2] notify_new_version: ", node_id,
", dose not start a sync.")

return true
end)
end
Expand Down

0 comments on commit 4632d09

Please sign in to comment.