-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
When Cassandra is temporarily down make sure the connection is resumed #11
Comments
#28 now uses the cosocket API. So we might loose some queries but the connection will be resumed as soon as cassandra is reachable again. Now we need to know if this doesn't throw any unexpected errors that could disturb the execution of plugins not using the DB. |
Right now this doesn't happen. Connection to Cassandra is never resumed and nginx logs the following error:
|
if the cluster shuts down and restarts, prepared queries are dropped and need to be re-prepared. |
BTW, re-reading the issue: it won't cause any issue if cassandra is unreachable because of network issues beyond dropping the queries. It will only be a more critical issue if cassandra was restarted for some reason, because the statements aren't prepared anymore, resulting in errors and no query will succeed. |
If Cassandra returns an unprepared error, the DAO will re-prepare it and try the query again. This fixes #11, and handles the case where Cassandra would go down, and then up again while Kong is still running. Other changes: - docs: base_dao and the factory have been given a better documentation. - refactor: - `kong_query` is now the prefered term for _queries elements. - `params` becomes `args_keys` and `values` `args` for consistance with the driver. - The `_execute` method was renamed to `_execute_kong_query` and broken into smaller chunks. - Batch statements now need to use the raw `_execute` method (the new one, not the one renamed to `_execute_kong_query`. - Cassandra errors now also have the error code.
If Cassandra returns an unprepared error, the DAO will re-prepare it and try the query again. This fixes #11, and handles the case where Cassandra would go down, and then up again while Kong is still running. Other changes: - docs: base_dao and the factory have been given a better documentation. - refactor: - `kong_query` is now the prefered term for _queries elements. - `params` becomes `args_keys` and `values` `args` for consistance with the driver. - The `_execute` method was renamed to `_execute_kong_query` and broken into smaller chunks. - Batch statements now need to use the raw `_execute` method (the new one, not the one renamed to `_execute_kong_query`. - Cassandra errors now also have the error code.
If Cassandra returns an unprepared error, the DAO will re-prepare it and try the query again. This fixes #11, and handles the case where Cassandra would go down, and then up again while Kong is still running. Other changes: - docs: base_dao and the factory have been given a better documentation. - refactor: - `kong_query` is now the prefered term for _queries elements. - `params` becomes `args_keys` and `values` `args` for consistance with the driver. - The `_execute` method was renamed to `_execute_kong_query` and broken into smaller chunks. - Batch statements now need to use the raw `_execute` method (the new one, not the one renamed to `_execute_kong_query`. - Cassandra errors now also have the error code.
[feature] support unprepared statement errors. fix #11
If Cassandra returns an unprepared error, the DAO will re-prepare it and try the query again. This fixes Kong#11, and handles the case where Cassandra would go down, and then up again while Kong is still running. Other changes: - docs: base_dao and the factory have been given a better documentation. - refactor: - `kong_query` is now the prefered term for _queries elements. - `params` becomes `args_keys` and `values` `args` for consistance with the driver. - The `_execute` method was renamed to `_execute_kong_query` and broken into smaller chunks. - Batch statements now need to use the raw `_execute` method (the new one, not the one renamed to `_execute_kong_query`. - Cassandra errors now also have the error code.
[feature] support unprepared statement errors. fix Kong#11
* fix(session) do not try to use body if it cannot be read on logout * chore(session) 2.1.1
… schema (#11) It is no longer needed as service mesh support is removed from Kong
### Summary Before this commit: ``` patching file LuaJIT-2.1-20190507/src/lj_tab.c patching file LuaJIT-2.1-20190507/src/lj_asm_arm.h patching file LuaJIT-2.1-20190507/src/lj_api.c patching file LuaJIT-2.1-20190507/src/lj_arch.h patching file LuaJIT-2.1-20190507/src/lj_cconv.c patching file LuaJIT-2.1-20190507/src/lj_obj.h patching file LuaJIT-2.1-20190507/src/lj_state.c patching file lua-resty-core-0.1.17/lib/resty/core/socket_tcp.lua patching file lua-resty-core-0.1.17/lib/resty/core/socket_tcp.lua patching file lua-resty-core-0.1.17/lib/resty/core/socket_tcp.lua patching file lua-resty-core-0.1.17/lib/resty/core/socket_tcp.lua patching file lua-resty-core-0.1.17/lib/resty/core/socket_tcp.lua patching file lua-resty-core-0.1.17/lib/resty/core.lua patching file lua-resty-core-0.1.17/lib/resty/core/socket_tcp.lua patching file lua-resty-core-0.1.17/lib/ngx/balancer.lua patching file lua-resty-websocket-0.07/lib/resty/websocket/client.lua patching file nginx-1.15.8/src/http/ngx_http_upstream.c Hunk #2 succeeded at 1691 (offset -3 lines). Hunk #4 succeeded at 1768 (offset -7 lines). patching file nginx-1.15.8/src/http/ngx_http_special_response.c patching file nginx-1.15.8/src/stream/ngx_stream_proxy_module.c Hunk #2 succeeded at 802 (offset 20 lines). patching file ngx_lua-0.10.15/src/ngx_http_lua_socket_tcp.c Hunk #5 succeeded at 1556 (offset 48 lines). Hunk #6 succeeded at 1626 (offset 48 lines). Hunk #7 succeeded at 1726 (offset 48 lines). Hunk #8 succeeded at 1749 (offset 48 lines). Hunk #9 succeeded at 1760 (offset 48 lines). Hunk #10 succeeded at 1775 (offset 48 lines). Hunk #11 succeeded at 1816 (offset 48 lines). Hunk #12 succeeded at 1827 (offset 48 lines). Hunk #13 succeeded at 1849 (offset 48 lines). Hunk #14 succeeded at 1868 (offset 48 lines). Hunk #15 succeeded at 1878 (offset 48 lines). Hunk #16 succeeded at 2008 (offset 48 lines). Hunk #17 succeeded at 6101 (offset 62 lines). patching file ngx_lua-0.10.15/src/ngx_http_lua_socket_tcp.h patching file ngx_lua-0.10.15/src/ngx_http_lua_socket_tcp.c Hunk #1 succeeded at 1647 (offset 48 lines). patching file ngx_lua-0.10.15/src/ngx_http_lua_socket_tcp.c Hunk #3 succeeded at 1579 (offset 48 lines). Hunk #4 succeeded at 1644 (offset 48 lines). Hunk #5 succeeded at 1668 (offset 48 lines). patching file ngx_lua-0.10.15/src/ngx_http_lua_socket_tcp.c Hunk #1 succeeded at 1756 (offset 48 lines). patching file ngx_lua-0.10.15/src/ngx_http_lua_balancer.c patching file ngx_lua-0.10.15/src/ngx_http_lua_common.h patching file ngx_lua-0.10.15/src/ngx_http_lua_module.c patching file ngx_lua-0.10.15/src/ngx_http_lua_string.c patching file ngx_stream_lua-0.0.7/src/ngx_stream_lua_control.c patching file ngx_stream_lua-0.0.7/src/ngx_stream_lua_variable.c patching file ngx_stream_lua-0.0.7/src/ngx_stream_lua_common.h patching file ngx_stream_lua-0.0.7/src/ngx_stream_lua_util.c patching file ngx_stream_lua-0.0.7/src/api/ngx_stream_lua_api.h ``` vs. (after this commit) ``` patching file LuaJIT-2.1-20190507/src/lj_tab.c patching file LuaJIT-2.1-20190507/src/lj_asm_arm.h patching file LuaJIT-2.1-20190507/src/lj_api.c patching file LuaJIT-2.1-20190507/src/lj_arch.h patching file LuaJIT-2.1-20190507/src/lj_cconv.c patching file LuaJIT-2.1-20190507/src/lj_obj.h patching file LuaJIT-2.1-20190507/src/lj_state.c patching file lua-resty-core-0.1.17/lib/resty/core/socket_tcp.lua patching file lua-resty-core-0.1.17/lib/resty/core/socket_tcp.lua patching file lua-resty-core-0.1.17/lib/resty/core/socket_tcp.lua patching file lua-resty-core-0.1.17/lib/resty/core/socket_tcp.lua patching file lua-resty-core-0.1.17/lib/resty/core/socket_tcp.lua patching file lua-resty-core-0.1.17/lib/resty/core.lua patching file lua-resty-core-0.1.17/lib/resty/core/socket_tcp.lua patching file lua-resty-core-0.1.17/lib/ngx/balancer.lua patching file lua-resty-websocket-0.07/lib/resty/websocket/client.lua patching file nginx-1.15.8/src/http/ngx_http_upstream.c patching file nginx-1.15.8/src/http/ngx_http_special_response.c patching file nginx-1.15.8/src/stream/ngx_stream_proxy_module.c patching file ngx_lua-0.10.15/src/ngx_http_lua_socket_tcp.c patching file ngx_lua-0.10.15/src/ngx_http_lua_socket_tcp.h patching file ngx_lua-0.10.15/src/ngx_http_lua_socket_tcp.c patching file ngx_lua-0.10.15/src/ngx_http_lua_socket_tcp.c patching file ngx_lua-0.10.15/src/ngx_http_lua_socket_tcp.c patching file ngx_lua-0.10.15/src/ngx_http_lua_balancer.c patching file ngx_lua-0.10.15/src/ngx_http_lua_common.h patching file ngx_lua-0.10.15/src/ngx_http_lua_module.c patching file ngx_lua-0.10.15/src/ngx_http_lua_string.c patching file ngx_stream_lua-0.0.7/src/ngx_stream_lua_control.c patching file ngx_stream_lua-0.0.7/src/ngx_stream_lua_variable.c patching file ngx_stream_lua-0.0.7/src/ngx_stream_lua_common.h patching file ngx_stream_lua-0.0.7/src/ngx_stream_lua_util.c patching file ngx_stream_lua-0.0.7/src/api/ngx_stream_lua_api.h ```
It may happen because of network issues, and we need to make sure it doesn't crash the application but it logs the error and resumes the connection as soon as it's available again.
Make sure that when testing this nginx runs with
daemon on;
.The text was updated successfully, but these errors were encountered: