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

Fixed CROSSSLOT ERROR in Cluster Mode for PUBSUB SHARDNUMSUB #1369

Open
wants to merge 4 commits into
base: unstable
Choose a base branch
from

Conversation

Nikhil-Manglore
Copy link

Resolved #560

Added key specification to the pubsub-shardnumsub.json file to force the CROSSSLOT error when a user subscribes to two channels in different hash slots.

Copy link
Contributor

@hpatro hpatro left a comment

Choose a reason for hiding this comment

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

@Nikhil-Manglore Could you also add test case for it?

Comment on lines 23 to 41
"key_specs": [
{
"flags": [
"NOT_KEY"
],
"begin_search": {
"index": {
"pos": 1
}
},
"find_keys": {
"range": {
"lastkey": -1,
"step": 1,
"limit": 0
}
}
}
],
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, with this change, doesn't it update commands.def ?

Copy link
Author

Choose a reason for hiding this comment

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

Yes it does, should I push those changes as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes please

Copy link
Contributor

Choose a reason for hiding this comment

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

It needs to be committed to make the CI pass.

Copy link
Author

@Nikhil-Manglore Nikhil-Manglore Dec 2, 2024

Choose a reason for hiding this comment

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

I have pushed the commands.def file. I'll push the test cases once I have finished running the tests.

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.

In the issue, we marked it as a breaking change, so should we release it in a major version, 9.0? Or should we consider it a bugfix and release it in 8.1? @valkey-io/core-team I guess we should decide.

@madolson
Copy link
Member

madolson commented Dec 1, 2024

It's undeniably a breaking change, since we are throwing errors when something used to work. It should go with 9.0.

@zuiderkwast
Copy link
Contributor

@Nikhil-Manglore Since this is a breaking change, we will release it only in the next major version, which is 9.0. This means that we can't merge it until after we've branched off for the 8.1 release. We'll do that around January or February. Sorry for the inconvenience.

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.79%. Comparing base (fbbfe5d) to head (90dc6f3).
Report is 1 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1369      +/-   ##
============================================
+ Coverage     70.76%   70.79%   +0.03%     
============================================
  Files           118      118              
  Lines         63405    63497      +92     
============================================
+ Hits          44866    44955      +89     
- Misses        18539    18542       +3     
Files with missing lines Coverage Δ
src/commands.def 100.00% <ø> (ø)

... and 14 files with indirect coverage changes

@Nikhil-Manglore
Copy link
Author

Nikhil-Manglore commented Dec 3, 2024

When writing the test cases in tcl I realized there was an issue with the keyspecs in my original code. I fixed that issue by changing the starting position and then tested it with the testcases. This gave the proper results and i have pushed the final changes including the tcl testcases.

@hpatro
Copy link
Contributor

hpatro commented Dec 3, 2024

@Nikhil-Manglore Thanks for the PR. As Viktor mentioned it's a breaking change, so we will merge this in for the major version (need to wait it out).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a possible backwards incompatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] PUBSUB SHARDNUMSUB doesn't return -CROSSSLOT for cross slot shard-channels
4 participants