From 6185a022f3a22d32664d35e57f3436c1921e58a6 Mon Sep 17 00:00:00 2001 From: chronolaw Date: Thu, 7 Nov 2024 13:58:48 +0800 Subject: [PATCH] move to default --- kong/clustering/services/sync/rpc.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kong/clustering/services/sync/rpc.lua b/kong/clustering/services/sync/rpc.lua index cebb6ccc5aa4..30a459183f61 100644 --- a/kong/clustering/services/sync/rpc.lua +++ b/kong/clustering/services/sync/rpc.lua @@ -49,7 +49,7 @@ function _M:init_cp(manager) -- CP -- Method: kong.sync.v2.get_delta -- Params: versions: list of current versions of the database - -- example: { default = { version = 1000, }, } + -- example: { default = { version = 1000, node = "3.9.0"}, } manager.callbacks:register("kong.sync.v2.get_delta", function(node_id, current_versions) ngx_log(ngx_DEBUG, "[kong.sync.v2] config push (connected client)") @@ -72,7 +72,7 @@ function _M:init_cp(manager) last_seen = ngx.time(), hostname = node_id, ip = kong.rpc:get_peer_ip(node_id), -- try to get the correct ip - version = current_versions.node_version, -- get from rpc call + version = default_namespace.node, -- get from rpc call sync_status = CLUSTERING_SYNC_STATUS.NORMAL, config_hash = fmt("%032d", default_namespace_version), rpc_capabilities = rpc_peers and rpc_peers[node_id] or {}, @@ -187,9 +187,8 @@ local function do_sync() { default = { version = tonumber(declarative.get_current_hash()) or 0, + node = kong.version, -- cp need this info }, - -- cp need this info - node_version = kong.version, }) if not ns_deltas then ngx_log(ngx_ERR, "sync get_delta error: ", err)