Skip to content

Commit

Permalink
fix(incremental sync): added comment for 2 times do_sync (#13801)
Browse files Browse the repository at this point in the history
Co-authored-by: Datong Sun <datong.sun@konghq.com>
  • Loading branch information
2 people authored and chronolaw committed Oct 31, 2024
1 parent fc26c42 commit 60ef6c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ local function sync_handler(premature)
end

local res, err = concurrency.with_worker_mutex(SYNC_MUTEX_OPTS, function()
-- here must be 2 times
-- `do_sync()` is run twice in a row to report back new version number
-- to CP quickly after sync. (`kong.sync.v2.get_delta` is used for both pulling delta
-- as well as status reporting)
for _ = 1, 2 do
local ok, err = do_sync()
if not ok then
Expand Down

0 comments on commit 60ef6c3

Please sign in to comment.