From a7ba490157ca1fc746f1cf84fad9840e7ba2d290 Mon Sep 17 00:00:00 2001 From: Xiaochen Wang Date: Tue, 29 Oct 2024 11:42:22 +0800 Subject: [PATCH] fix(incremental sync): added comment for 2 times do_sync (#13801) Co-authored-by: Datong Sun --- kong/clustering/services/sync/rpc.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kong/clustering/services/sync/rpc.lua b/kong/clustering/services/sync/rpc.lua index f3b6cb9229ad..1a8f749af01d 100644 --- a/kong/clustering/services/sync/rpc.lua +++ b/kong/clustering/services/sync/rpc.lua @@ -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