From 5b4a5806ebfe5c019e57ef5d94f0e19a23315365 Mon Sep 17 00:00:00 2001 From: ADD-SP Date: Tue, 14 Jan 2025 04:03:29 +0000 Subject: [PATCH] fix(clustering/rpc): record the default workspace after the dropping the lmdb --- kong/clustering/services/sync/rpc.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kong/clustering/services/sync/rpc.lua b/kong/clustering/services/sync/rpc.lua index 108c54d7fdd..94bc6e35ead 100644 --- a/kong/clustering/services/sync/rpc.lua +++ b/kong/clustering/services/sync/rpc.lua @@ -318,8 +318,10 @@ local function do_sync() -- store current sync version t:set(DECLARATIVE_HASH_KEY, fmt("%032d", version)) - -- store the correct default workspace uuid - if default_ws_changed then + -- record the default workspace into LMDB for any of the following case: + -- * wipe is false, but the default workspace has been changed + -- * wipe is true (full sync) + if default_ws_changed or wipe then t:set(DECLARATIVE_DEFAULT_WORKSPACE_KEY, kong.default_workspace) end