Skip to content

Commit

Permalink
some todo comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Sep 24, 2024
1 parent f4b0ec3 commit 0255e06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kong/clustering/services/sync/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function _M:init_worker()

-- is dp, sync in worker 0
if ngx.worker.id() == 0 then
assert(self.rpc:sync_once(5))
assert(self.rpc:sync_once(0.5))
assert(ngx.timer.every(30, function(premature)
if premature then
return
Expand Down
6 changes: 4 additions & 2 deletions kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ local concurrency = require("kong.concurrency")
local insert_entity_for_txn = declarative.insert_entity_for_txn
local delete_entity_for_txn = declarative.delete_entity_for_txn
local DECLARATIVE_HASH_KEY = constants.DECLARATIVE_HASH_KEY
local CLUSTERING_SYNC_STATUS = constants.CLUSTERING_SYNC_STATUS
local SYNC_MUTEX_OPTS = { name = "get_delta", timeout = 0, }
local ngx_log = ngx.log
local ngx_ERR = ngx.ERR
Expand Down Expand Up @@ -53,12 +54,13 @@ function _M:init_cp(manager)
return nil, "default namespace does not exist inside params"
end

-- XXX TODO: follow update_sync_status() in control_plane.lua
local ok, err = kong.db.clustering_data_planes:upsert({ id = node_id }, {
last_seen = ngx.time(),
hostname = node_id,
ip = "127.0.7.1",
ip = "127.0.7.1", -- XXX how to get the corret ip?
version = "3.8.0.0",
sync_status = "normal",
sync_status = CLUSTERING_SYNC_STATUS.NORMAL,
config_hash = string.format("%032d", default_namespace.version),
rpc_capabilities = rpc_peers and rpc_peers[node_id] or {},
})
Expand Down

0 comments on commit 0255e06

Please sign in to comment.