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

fix(cassandra) kong refueses to start when a node in contact_points is down #147

Closed
wants to merge 4 commits into from

Conversation

outsinre
Copy link
Contributor

@outsinre outsinre commented May 14, 2022

fix(cassandra) kong refueses to start when a node in contact_points is down

Instead of error(...), use warn(...) to let kong start. Kong will rediscover the down nodes once they are up.

The partner kong-ee PR: https://github.com/Kong/kong-ee/pull/3192

… is down

Instead of `error(...)`, use `warn(...)` to let kong start. Kong will
rediscover the down nodes once they are up.
lib/resty/cassandra/policies/lb/req_dc_rr.lua Outdated Show resolved Hide resolved
lib/resty/cassandra/policies/lb/req_dc_rr.lua Outdated Show resolved Hide resolved
t/14-lb_req_dc_rr.t Show resolved Hide resolved
t/14-lb_req_dc_rr.t Outdated Show resolved Hide resolved
lib/resty/cassandra/policies/lb/req_dc_rr.lua Outdated Show resolved Hide resolved
…ing and equal to local_dc

Otherwise, consider peer as remote peer.

t/14-lb_req_dc_rr.t: remove duplicate Test 9. Update Test 4 to
match the code update.
@outsinre outsinre force-pushed the FTI-4018-lua-cassandra branch from 71ca1f0 to 71b9929 Compare May 17, 2022 16:01
@outsinre
Copy link
Contributor Author

@thibaultcha, really appreciate your review. I learned a lot from that. I just update the code according to your suggestions. Would you mind verifying it if available?

@outsinre outsinre requested a review from thibaultcha May 18, 2022 09:22
Makefile Outdated Show resolved Hide resolved
lib/resty/cassandra/policies/lb/req_dc_rr.lua Outdated Show resolved Hide resolved
lib/resty/cassandra/policies/lb/req_dc_rr.lua Outdated Show resolved Hide resolved
lib/resty/cassandra/policies/lb/req_dc_rr.lua Outdated Show resolved Hide resolved
lib/resty/cassandra/policies/lb/req_dc_rr.lua Outdated Show resolved Hide resolved
t/14-lb_req_dc_rr.t Outdated Show resolved Hide resolved
{host = '127.0.0.2', data_center = 'dc1'},
{host = '127.0.0.3'}
{host = '127.0.0.3', data_center = 'dc1'}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch would be more concise and less disruptive if we keep this test the way it is, only change the expected results.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this part because the bug is triggered when the first host has no data_center field.

t/14-lb_req_dc_rr.t Outdated Show resolved Hide resolved
t/14-lb_req_dc_rr.t Show resolved Hide resolved
outsinre and others added 2 commits May 19, 2022 10:06
Co-authored-by: Thibault Charbonnier <[email protected]>
1. add newline after `end`.
2. wrap line upon 80 column.
3. remove `error_code: 200` from `.t` test file.
4. remove uncessary piece from Makefile.
@outsinre outsinre requested a review from thibaultcha May 20, 2022 01:12
bungle added a commit to Kong/kong that referenced this pull request May 23, 2022
### Summary

> Released on: 2022/05/20

#### Fixed

- Improve DC-aware LB policies robustness.
  [#147](thibaultcha/lua-cassandra#147)
- Ensure request-aware + DC-aware LB policy prioritizes local peers over remote
  ones.
bungle added a commit to Kong/kong that referenced this pull request May 24, 2022
### Summary

> Released on: 2022/05/20

#### Fixed

- Improve DC-aware LB policies robustness.
  [#147](thibaultcha/lua-cassandra#147)
- Ensure request-aware + DC-aware LB policy prioritizes local peers over remote
  ones.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants