Skip to content

Commit

Permalink
feat(clustering): full sync threshold should be configureable (#13893)
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw authored Dec 2, 2024
1 parent b2f8366 commit f345fb5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ local ngx_DEBUG = ngx.DEBUG


-- number of versions behind before a full sync is forced
local FULL_SYNC_THRESHOLD = 512
local DEFAULT_FULL_SYNC_THRESHOLD = 512


function _M.new(strategy)
Expand Down Expand Up @@ -62,6 +62,10 @@ end
function _M:init_cp(manager)
local purge_delay = manager.conf.cluster_data_plane_purge_delay

-- number of versions behind before a full sync is forced
local FULL_SYNC_THRESHOLD = manager.conf.cluster_full_sync_threshold or
DEFAULT_FULL_SYNC_THRESHOLD

-- CP
-- Method: kong.sync.v2.get_delta
-- Params: versions: list of current versions of the database
Expand Down
1 change: 1 addition & 0 deletions kong/conf_loader/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ local CONF_PARSERS = {
cluster_dp_labels = { typ = "array" },
cluster_rpc = { typ = "boolean" },
cluster_incremental_sync = { typ = "boolean" },
cluster_full_sync_threshold = { typ = "number" },
cluster_cjson = { typ = "boolean" },

kic = { typ = "boolean" },
Expand Down
1 change: 1 addition & 0 deletions kong/templates/kong_defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cluster_use_proxy = off
cluster_dp_labels = NONE
cluster_rpc = off
cluster_incremental_sync = off
cluster_full_sync_threshold = 512
cluster_cjson = off
lmdb_environment_path = dbless.lmdb
Expand Down

1 comment on commit f345fb5

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:f345fb5ad9a23cfc065a1ac06fc77d8306d603a9
Artifacts available https://github.com/Kong/kong/actions/runs/12113594853

Please sign in to comment.