Skip to content

Commit

Permalink
fix(incremental sync): added comment for 2 times do_sync (3)
Browse files Browse the repository at this point in the history
Co-authored-by: Datong Sun <[email protected]>
  • Loading branch information
chobits and dndx authored Oct 29, 2024
1 parent f3b64e6 commit 11a6aa2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,9 @@ local function sync_handler(premature)
end

local res, err = concurrency.with_worker_mutex(SYNC_MUTEX_OPTS, function()
-- must be 2 times for retrieving the latest delta version and latest deltas
--
-- The second call to do_sync() on `kong.sync.v2.get_delta` retrieves the
-- latest delta version directly, without requiring additional API calls.
-- `do_sync` is run twice in a row to report back new version number
-- to CP quickly. `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 11a6aa2

Please sign in to comment.