From 4632d09770bf85b78a5a22e6eb6f1685ebffec8d Mon Sep 17 00:00:00 2001 From: chronolaw Date: Sun, 3 Nov 2024 13:40:36 +0800 Subject: [PATCH] debug logs --- kong/clustering/services/sync/rpc.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/kong/clustering/services/sync/rpc.lua b/kong/clustering/services/sync/rpc.lua index e29b899ef332..1095a89c01e0 100644 --- a/kong/clustering/services/sync/rpc.lua +++ b/kong/clustering/services/sync/rpc.lua @@ -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