From 913562d906587b1129ed07abdae6e0d0cd1de13b Mon Sep 17 00:00:00 2001 From: chronolaw Date: Tue, 17 Dec 2024 13:03:24 +0800 Subject: [PATCH] comments change --- kong/conf_loader/init.lua | 2 +- kong/global.lua | 2 +- kong/init.lua | 8 ++++---- kong/runloop/handler.lua | 6 +++--- spec/01-unit/01-db/10-declarative_spec.lua | 2 +- spec/01-unit/01-db/11-declarative_lmdb_spec.lua | 4 ++-- spec/02-integration/09-hybrid_mode/01-sync_spec.lua | 6 +++--- .../09-hybrid_mode/09-config-compat_spec.lua | 2 +- spec/02-integration/09-hybrid_mode/12-errors_spec.lua | 2 +- .../09-hybrid_mode/14-dp_privileged_agent_spec.lua | 4 ++-- spec/02-integration/19-incrmental_sync/01-sync_spec.lua | 4 ++-- .../19-incrmental_sync/02-multiple_dp_nodes_spec.lua | 4 ++-- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/kong/conf_loader/init.lua b/kong/conf_loader/init.lua index 3dca1778ae62..3a32433b3320 100644 --- a/kong/conf_loader/init.lua +++ b/kong/conf_loader/init.lua @@ -1035,7 +1035,7 @@ local function load(path, custom_conf, opts) end if conf.cluster_rpc_sync and not conf.cluster_rpc then - log.warn("Cluster incremental sync has been forcibly disabled, " .. + log.warn("Cluster rpc sync has been forcibly disabled, " .. "please enable cluster RPC.") conf.cluster_rpc_sync = false end diff --git a/kong/global.lua b/kong/global.lua index 55ef7adfd991..a67e612ff0c4 100644 --- a/kong/global.lua +++ b/kong/global.lua @@ -193,7 +193,7 @@ function _GLOBAL.init_worker_events(kong_config) local enable_privileged_agent = false if kong_config.dedicated_config_processing and kong_config.role == "data_plane" and - not kong.sync -- for incremental sync there is no privileged_agent + not kong.sync -- for rpc sync there is no privileged_agent then enable_privileged_agent = true end diff --git a/kong/init.lua b/kong/init.lua index a45a9d2c674b..731540f80720 100644 --- a/kong/init.lua +++ b/kong/init.lua @@ -885,8 +885,8 @@ function Kong.init_worker() local is_dp_sync_v1 = is_data_plane(kong.configuration) and not kong.sync local using_dedicated = kong.configuration.dedicated_config_processing - -- CP needs to support both full and incremental sync - -- full sync is only enabled for DP if incremental sync is disabled + -- CP needs to support both v1 and v2 sync + -- v1 sync is only enabled for DP if v2 sync is disabled if is_cp or is_dp_sync_v1 then kong.clustering:init_worker() end @@ -992,7 +992,7 @@ function Kong.init_worker() plugin_servers.start() end - -- rpc and incremental sync + -- rpc and sync if is_http_module then -- init rpc connection @@ -1000,7 +1000,7 @@ function Kong.init_worker() kong.rpc:init_worker() end - -- init incremental sync + -- init sync -- should run after rpc init successfully if kong.sync then kong.sync:init_worker() diff --git a/kong/runloop/handler.lua b/kong/runloop/handler.lua index 37efc7f8bb78..54eb8cf0ba30 100644 --- a/kong/runloop/handler.lua +++ b/kong/runloop/handler.lua @@ -363,10 +363,10 @@ local function new_router(version) -- like rebuild_router_timer. And it relies on core_cache to detect changes. -- -- 1. stratey off (dbless) - -- incremental_sync on: + -- rpc_sync on: -- non init worker: true(kong.core_cache) -- init worker: false - -- incremental_sync off: false + -- rpc_sync off: false -- 2. strategy on (non dbless): true(kong.core_cache) local detect_changes = kong.core_cache and (db.strategy ~= "off" or (kong.sync and get_phase() ~= "init_worker")) @@ -986,7 +986,7 @@ return { -- start some rebuild timers for -- 1. traditional mode - -- 2. DP with incremental sync on (dbless mode) + -- 2. DP with rpc sync on (dbless mode) if strategy ~= "off" or kong.sync then local worker_state_update_frequency = kong.configuration.worker_state_update_frequency or 1 diff --git a/spec/01-unit/01-db/10-declarative_spec.lua b/spec/01-unit/01-db/10-declarative_spec.lua index be683a2df37b..137bebb206e4 100644 --- a/spec/01-unit/01-db/10-declarative_spec.lua +++ b/spec/01-unit/01-db/10-declarative_spec.lua @@ -56,7 +56,7 @@ keyauth_credentials: assert.equals("services|123|fieldname|" .. sha256_hex("test"), key) end) - -- since incremental sync the param `unique_across_ws` is useless + -- since rpc sync the param `unique_across_ws` is useless -- this test case is just for compatibility it("does not omits the workspace id when 'unique_across_ws' is 'true'", function() local key = unique_field_key("services", "123", "fieldname", "test", true) diff --git a/spec/01-unit/01-db/11-declarative_lmdb_spec.lua b/spec/01-unit/01-db/11-declarative_lmdb_spec.lua index 6fbe9181c967..047fadae604a 100644 --- a/spec/01-unit/01-db/11-declarative_lmdb_spec.lua +++ b/spec/01-unit/01-db/11-declarative_lmdb_spec.lua @@ -202,7 +202,7 @@ describe("#off preserve nulls", function() local id, item = next(entities.basicauth_credentials) - -- format changed after incremental sync + -- format changed after rpc sync local cache_key = concat({ "basicauth_credentials|", item.ws_id, @@ -225,7 +225,7 @@ describe("#off preserve nulls", function() for _, plugin in pairs(entities.plugins) do if plugin.name == PLUGIN_NAME then - -- format changed after incremental sync + -- format changed after rpc sync cache_key = concat({ "plugins|", plugin.ws_id, diff --git a/spec/02-integration/09-hybrid_mode/01-sync_spec.lua b/spec/02-integration/09-hybrid_mode/01-sync_spec.lua index 989d30c0c2e9..bb941bd4ed30 100644 --- a/spec/02-integration/09-hybrid_mode/01-sync_spec.lua +++ b/spec/02-integration/09-hybrid_mode/01-sync_spec.lua @@ -796,7 +796,7 @@ describe("CP/DP labels #" .. strategy, function() assert.equal(CLUSTERING_SYNC_STATUS.NORMAL, v.sync_status) assert.equal(CLUSTERING_SYNC_STATUS.NORMAL, v.sync_status) -- TODO: The API output does include labels and certs when the - -- incremental sync is enabled. + -- rpc sync is enabled. if rpc_sync == "off" then assert.equal("mycloud", v.labels.deployment) assert.equal("us-east-1", v.labels.region) @@ -860,7 +860,7 @@ describe("CP/DP cert details(cluster_mtls = shared) #" .. strategy, function() for _, v in pairs(json.data) do if v.ip == "127.0.0.1" then -- TODO: The API output does include labels and certs when the - -- incremental sync is enabled. + -- rpc sync is enabled. if rpc_sync == "off" then assert.equal(1888983905, v.cert_details.expiry_timestamp) end @@ -929,7 +929,7 @@ describe("CP/DP cert details(cluster_mtls = pki) #" .. strategy, function() for _, v in pairs(json.data) do if v.ip == "127.0.0.1" then -- TODO: The API output does include labels and certs when the - -- incremental sync is enabled. + -- rpc sync is enabled. if rpc_sync == "off" then assert.equal(1897136778, v.cert_details.expiry_timestamp) end diff --git a/spec/02-integration/09-hybrid_mode/09-config-compat_spec.lua b/spec/02-integration/09-hybrid_mode/09-config-compat_spec.lua index f437572d1ba2..79a73e5ec500 100644 --- a/spec/02-integration/09-hybrid_mode/09-config-compat_spec.lua +++ b/spec/02-integration/09-hybrid_mode/09-config-compat_spec.lua @@ -76,7 +76,7 @@ local function get_sync_status(id) end --- XXX TODO: helpers.clustering_client supports incremental sync +-- XXX TODO: helpers.clustering_client supports rpc sync for _, rpc_sync in ipairs { "off" } do for _, strategy in helpers.each_strategy() do diff --git a/spec/02-integration/09-hybrid_mode/12-errors_spec.lua b/spec/02-integration/09-hybrid_mode/12-errors_spec.lua index 9fd176fceb32..52b3147a6ae4 100644 --- a/spec/02-integration/09-hybrid_mode/12-errors_spec.lua +++ b/spec/02-integration/09-hybrid_mode/12-errors_spec.lua @@ -69,7 +69,7 @@ local function get_error_report(client, msg) end --- XXX TODO: mock_cp does not support incremental sync rpc +-- XXX TODO: mock_cp does not support rpc sync rpc for _, rpc_sync in ipairs { "off" } do for _, strategy in helpers.each_strategy() do describe("CP/DP sync error-reporting with #" .. strategy .. " rpc_sync=" .. rpc_sync .. " backend", function() diff --git a/spec/02-integration/09-hybrid_mode/14-dp_privileged_agent_spec.lua b/spec/02-integration/09-hybrid_mode/14-dp_privileged_agent_spec.lua index bd33fe784a41..fd219f43d384 100644 --- a/spec/02-integration/09-hybrid_mode/14-dp_privileged_agent_spec.lua +++ b/spec/02-integration/09-hybrid_mode/14-dp_privileged_agent_spec.lua @@ -20,7 +20,7 @@ describe("DP diabled Incremental Sync RPC #" .. strategy, function() cluster_listen = "127.0.0.1:9005", nginx_conf = "spec/fixtures/custom_nginx.template", - cluster_rpc_sync = "on", -- ENABLE incremental sync + cluster_rpc_sync = "on", -- ENABLE rpc sync })) assert(helpers.start_kong({ @@ -35,7 +35,7 @@ describe("DP diabled Incremental Sync RPC #" .. strategy, function() nginx_worker_processes = 2, -- multiple workers cluster_rpc = "off", -- DISABLE rpc - cluster_rpc_sync = "off", -- DISABLE incremental sync + cluster_rpc_sync = "off", -- DISABLE rpc sync dedicated_config_processing = dedicated, -- privileged agent })) diff --git a/spec/02-integration/19-incrmental_sync/01-sync_spec.lua b/spec/02-integration/19-incrmental_sync/01-sync_spec.lua index 1b8e7b7ee3f3..a608e6432edb 100644 --- a/spec/02-integration/19-incrmental_sync/01-sync_spec.lua +++ b/spec/02-integration/19-incrmental_sync/01-sync_spec.lua @@ -36,7 +36,7 @@ describe("Incremental Sync RPC #" .. strategy, function() cluster_listen = "127.0.0.1:9005", nginx_conf = "spec/fixtures/custom_nginx.template", cluster_rpc = "on", - cluster_rpc_sync = "on", -- incremental sync + cluster_rpc_sync = "on", -- rpc sync })) assert(helpers.start_kong({ @@ -50,7 +50,7 @@ describe("Incremental Sync RPC #" .. strategy, function() nginx_conf = "spec/fixtures/custom_nginx.template", nginx_worker_processes = 4, -- multiple workers cluster_rpc = "on", - cluster_rpc_sync = "on", -- incremental sync + cluster_rpc_sync = "on", -- rpc sync worker_state_update_frequency = 1, })) end) diff --git a/spec/02-integration/19-incrmental_sync/02-multiple_dp_nodes_spec.lua b/spec/02-integration/19-incrmental_sync/02-multiple_dp_nodes_spec.lua index 8eb6b87df6f6..fe7f89432a5a 100644 --- a/spec/02-integration/19-incrmental_sync/02-multiple_dp_nodes_spec.lua +++ b/spec/02-integration/19-incrmental_sync/02-multiple_dp_nodes_spec.lua @@ -10,7 +10,7 @@ local function start_cp(strategy, port) cluster_listen = "127.0.0.1:" .. port, nginx_conf = "spec/fixtures/custom_nginx.template", cluster_rpc = "on", - cluster_rpc_sync = "on", -- incremental sync + cluster_rpc_sync = "on", -- rpc sync })) end @@ -26,7 +26,7 @@ local function start_dp(prefix, port) nginx_conf = "spec/fixtures/custom_nginx.template", nginx_worker_processes = 4, -- multiple workers cluster_rpc = "on", - cluster_rpc_sync = "on", -- incremental sync + cluster_rpc_sync = "on", -- rpc sync worker_state_update_frequency = 1, })) end