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

Allow Module blocking operations (not blocked on keys) to succeed when cluster is down #693

Merged
merged 8 commits into from
Jul 1, 2024

Conversation

KarthikSubbarao
Copy link
Member

@KarthikSubbarao KarthikSubbarao commented Jun 25, 2024

Proposing a fix for this issue - #619 - and adding tests.

Module blocking operations (which are not blocked on keys) currently gets rejected when the "cluster is down" from the client timeout cron job (clientsCronHandleTimeout). Example: Module Authentication with a blocking implementation.

This PR exempts clients blocked by a Module (but not on keys) from being rejected here on a failed cluster state.

@KarthikSubbarao KarthikSubbarao changed the title Allow Module authentication to suceed when cluster is done Allow Module authentication to succeed when cluster is done Jun 25, 2024
@KarthikSubbarao KarthikSubbarao changed the title Allow Module authentication to succeed when cluster is done Allow Module authentication to succeed when cluster is down Jun 25, 2024
Copy link

codecov bot commented Jun 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.08%. Comparing base (752b6ee) to head (2be807e).

Current head 2be807e differs from pull request most recent head fba04c5

Please upload reports for the commit fba04c5 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable     #693      +/-   ##
============================================
- Coverage     70.20%   70.08%   -0.13%     
============================================
  Files           111      110       -1     
  Lines         60242    60102     -140     
============================================
- Hits          42295    42122     -173     
- Misses        17947    17980      +33     
Files Coverage Δ
src/cluster.c 87.51% <100.00%> (-0.76%) ⬇️

... and 30 files with indirect coverage changes

Signed-off-by: KarthikSubbarao <[email protected]>
Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

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

LGTM. Just a minor comment about the test case.

tests/unit/moduleapi/cluster.tcl Show resolved Hide resolved
src/cluster.c Outdated Show resolved Hide resolved
Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

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

Awesome. Thank you!

@madolson madolson added the release-notes This issue should get a line item in the release notes label Jul 1, 2024
@madolson madolson merged commit fa01a29 into valkey-io:unstable Jul 1, 2024
17 checks passed
@KarthikSubbarao KarthikSubbarao changed the title Allow Module authentication to succeed when cluster is down Allow Module blocking operations (not blocked on keys) to succeed when cluster is down Jul 1, 2024
@KarthikSubbarao
Copy link
Member Author

Thank you - I updated the PR title and description because we made this fix generic to Module blocking operations (which are not blocked on keys)

PingXie pushed a commit to PingXie/valkey that referenced this pull request Jul 8, 2024
…o#693)

Module Authentication using a blocking implementation currently gets
rejected when the "cluster is down" from the client timeout cron job
(`clientsCronHandleTimeout`).

This PR exempts clients blocked on Module Authentication from being
rejected here.

---------

Signed-off-by: KarthikSubbarao <[email protected]>
PingXie pushed a commit to PingXie/valkey that referenced this pull request Jul 9, 2024
…o#693)

Module Authentication using a blocking implementation currently gets
rejected when the "cluster is down" from the client timeout cron job
(`clientsCronHandleTimeout`).

This PR exempts clients blocked on Module Authentication from being
rejected here.

---------

Signed-off-by: KarthikSubbarao <[email protected]>
PingXie pushed a commit to PingXie/valkey that referenced this pull request Jul 9, 2024
…o#693)

Module Authentication using a blocking implementation currently gets
rejected when the "cluster is down" from the client timeout cron job
(`clientsCronHandleTimeout`).

This PR exempts clients blocked on Module Authentication from being
rejected here.

---------

Signed-off-by: KarthikSubbarao <[email protected]>
Signed-off-by: Ping Xie <[email protected]>
PingXie pushed a commit that referenced this pull request Jul 10, 2024
Module Authentication using a blocking implementation currently gets
rejected when the "cluster is down" from the client timeout cron job
(`clientsCronHandleTimeout`).

This PR exempts clients blocked on Module Authentication from being
rejected here.

---------

Signed-off-by: KarthikSubbarao <[email protected]>
Signed-off-by: Ping Xie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes This issue should get a line item in the release notes
Projects
Status: Backported
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG] A client blocked on authentication through a module can't log into a cluster when it is down
4 participants