Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/wrpc #8357

Merged
merged 34 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2f790a0
feat(wrpc) basic working. Behind cluster_protocol==wRPC flag
javierguerragiraldez Jan 8, 2022
2eab0e3
feat(wrpc) lint fixes
javierguerragiraldez Feb 2, 2022
d21d899
feat(wrpc) more error and expirations handling
javierguerragiraldez Feb 3, 2022
8ff6f5f
feat(wrpc) inter-worker channel
javierguerragiraldez Feb 3, 2022
2435641
feat(wrpc) do calls from anywhere
javierguerragiraldez Feb 4, 2022
eb957f9
feat(wrpc) declare new files
javierguerragiraldez Feb 4, 2022
a91c7ab
feat(wrpc) remove ugly non-conn hack (and obsolete tests)
javierguerragiraldez Feb 4, 2022
4ea442d
feat(wrpc) update client status on receiving pings
javierguerragiraldez Feb 4, 2022
c6890ab
feat(wrpc) repeat clustering tests under wRPC
javierguerragiraldez Feb 4, 2022
4b7c85c
feat(wrpc) start making update_sync_status less context-specific
javierguerragiraldez Feb 5, 2022
b02ea59
feat(wrpc) include .proto files
javierguerragiraldez Feb 6, 2022
686a317
Apply suggestions from code review
javierguerragiraldez Feb 8, 2022
aba2d28
feat(wrpc) add function docs, remove old commented code
javierguerragiraldez Feb 8, 2022
7d897e1
feat(wrpc) use lowercase config option
javierguerragiraldez Feb 8, 2022
586a3b3
feat(wrpc) removed unrelated .proto files
javierguerragiraldez Feb 8, 2022
2e8657e
feat(clustering) factor some protobuf generic functions
javierguerragiraldez Feb 16, 2022
585892e
feat(clustering) cosmetic renames
javierguerragiraldez Feb 17, 2022
51da17a
feat(clustering) new proto_emitter to get nicer config exports
javierguerragiraldez Feb 17, 2022
20696fc
feat(clustering) pass expanded foreign references (route.service)
javierguerragiraldez Feb 17, 2022
0e34c1e
feat(clustering) update .proto files
javierguerragiraldez Feb 17, 2022
7c98f24
feat(clustering) Wait for CP response to initial BasicInfo
javierguerragiraldez Feb 18, 2022
812ba9b
feat(clustering) rename initial DP report from BasicInfo to Metadata
javierguerragiraldez Feb 18, 2022
3afff8d
feat(clustering) removing post-transfer hacks via better decoding
javierguerragiraldez Feb 22, 2022
75ecdc3
feat(clustering) fixing log levels
javierguerragiraldez Mar 21, 2022
a4ce1ec
feat(clustering) don't hold on the config_semaphore longer than needed
javierguerragiraldez Mar 21, 2022
edd25e1
feat(clustering) don't push config to every DP when a new one joins
javierguerragiraldez Mar 21, 2022
d69c347
feat(clustering) fix test
javierguerragiraldez Mar 22, 2022
6948dea
feat(clustering) remove unused variable
javierguerragiraldez Mar 22, 2022
48a9ca4
feat(clustering) allow peer and remote_peer to specify a channel name
javierguerragiraldez Mar 23, 2022
6120601
feat(clustering) max payload is now a config, not a constant
javierguerragiraldez Mar 28, 2022
f34d6b0
feat(clustering) flaky test
javierguerragiraldez Mar 30, 2022
7cf815e
feat(clustering) CP handles both protocols at the same time.
javierguerragiraldez Mar 30, 2022
9d77ca6
feat(clustering) add Parameters entity (carries cluster_id)
javierguerragiraldez Mar 31, 2022
88d0ce9
feat(clustering) add hash to the Config and Ping methods
javierguerragiraldez Mar 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions kong-2.8.0-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ build = {
["kong.clustering"] = "kong/clustering/init.lua",
["kong.clustering.data_plane"] = "kong/clustering/data_plane.lua",
["kong.clustering.control_plane"] = "kong/clustering/control_plane.lua",
["kong.clustering.wrpc_data_plane"] = "kong/clustering/wrpc_data_plane.lua",
["kong.clustering.wrpc_control_plane"] = "kong/clustering/wrpc_control_plane.lua",
["kong.clustering.compat.removed_fields"] = "kong/clustering/compat/removed_fields.lua",

["kong.cluster_events"] = "kong/cluster_events/init.lua",
Expand Down Expand Up @@ -136,6 +138,9 @@ build = {
["kong.tools.sandbox"] = "kong/tools/sandbox.lua",
["kong.tools.uri"] = "kong/tools/uri.lua",
["kong.tools.kong-lua-sandbox"] = "kong/tools/kong-lua-sandbox.lua",
["kong.tools.protobuf"] = "kong/tools/protobuf.lua",
["kong.tools.wrpc"] = "kong/tools/wrpc.lua",
["kong.tools.channel"] = "kong/tools/channel.lua",

["kong.runloop.handler"] = "kong/runloop/handler.lua",
["kong.runloop.certificate"] = "kong/runloop/certificate.lua",
Expand Down
29 changes: 26 additions & 3 deletions kong/clustering/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,20 @@ function _M.new(conf)
local key = assert(pl_file.read(conf.cluster_cert_key))
self.cert_key = assert(ssl.parse_pem_priv_key(key))

self.child = require("kong.clustering." .. conf.role).new(self)
print("role: ", conf.role, " protocol: ", conf.cluster_protocol)

if conf.role == "control_plane" then
self.json_handler = require("kong.clustering.control_plane").new(self)
self.wrpc_handler = require("kong.clustering.wrpc_control_plane").new(self)

else
local clustering_submodule = conf.role
if conf.cluster_protocol == "wrpc" then
clustering_submodule = "wrpc_" .. clustering_submodule
end

self.child = require("kong.clustering." .. clustering_submodule).new(self)
end

return self
end
Expand Down Expand Up @@ -184,7 +197,11 @@ end


function _M:handle_cp_websocket()
return self.child:handle_cp_websocket()
return self.json_handler:handle_cp_websocket()
end

function _M:handle_wrpc_websocket()
return self.wrpc_handler:handle_cp_websocket()
end


Expand All @@ -198,7 +215,13 @@ function _M:init_worker()
return { name = p.name, version = p.handler.VERSION, }
end, self.plugins_list)

self.child:init_worker()
for _, ch in ipairs{"child", "json_handler", "wrpc_handler"} do
local child = self[ch]
if child then
child:init_worker()
end
end
--self.child:init_worker()
end


Expand Down
Loading