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

Valkey-8: add BY/GET support for SORT/RO in cluster mode #2252

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

shohamazon
Copy link
Collaborator

No description provided.

@shohamazon shohamazon force-pushed the sort-valkey-8 branch 2 times, most recently from 8ad4757 to 8b95058 Compare September 9, 2024 13:44
@shohamazon shohamazon added python node java issues and fixes related to the java client Valkey-8 Support for Valkey-8 features labels Sep 9, 2024
@shohamazon shohamazon force-pushed the sort-valkey-8 branch 2 times, most recently from daeef61 to c03ac99 Compare September 10, 2024 14:43
@shohamazon shohamazon marked this pull request as ready for review September 10, 2024 15:01
@shohamazon shohamazon requested a review from a team as a code owner September 10, 2024 15:01
Comment on lines +1256 to +1259
* @apiNote When in cluster mode, both <code>key</code> and the patterns specified in {@link
* SortOptions#byPattern} and {@link SortOptions#getPatterns} must hash to the same slot. The
* use of {@link SortOptions#byPattern} and {@link SortOptions#getPatterns} in cluster mode is
* supported since Valkey version 8.0.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add sross slot test there

*/
export type SortOptions = SortBaseOptions & {
export type SortOptions = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

According to new starndards introduced by Avi, this should an interface

@@ -9,8 +9,7 @@ import {
Decoder,
DecoderOption,
GlideString,
PubSubMsg,
ReadFrom, // eslint-disable-line @typescript-eslint/no-unused-vars
PubSubMsg, // eslint-disable-line @typescript-eslint/no-unused-vars
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please revert

@@ -9,8 +9,7 @@ import {
Decoder,
DecoderOption,
GlideString,
PubSubMsg,
ReadFrom, // eslint-disable-line @typescript-eslint/no-unused-vars
PubSubMsg, // eslint-disable-line @typescript-eslint/no-unused-vars
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

@@ -6,8 +6,7 @@ import {
BaseClient, // eslint-disable-line @typescript-eslint/no-unused-vars
GlideRecord,
GlideString,
HashDataType,
ReadFrom, // eslint-disable-line @typescript-eslint/no-unused-vars
HashDataType, // eslint-disable-line @typescript-eslint/no-unused-vars
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same

@@ -3006,7 +3006,9 @@ export function runBaseTests(config: {
expect(
await client.sinter(
[Buffer.from(key1), Buffer.from(key2)],
{ decoder: Decoder.Bytes },
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

why? linter? why?

node/src/GlideClusterClient.ts Show resolved Hide resolved
@@ -1251,6 +1308,7 @@ CompletableFuture<String> restore(
* This command is routed depending on the client's {@link ReadFrom} strategy.
*
* @since Valkey 7.0 and above.
* @see <a href="https://valkey.io/commands/sort_ro/">valkey.io</a> for details.
Copy link
Collaborator

Choose a reason for hiding this comment

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

404 not found

@@ -1269,6 +1327,7 @@ CompletableFuture<String> restore(
* This command is routed depending on the client's {@link ReadFrom} strategy.
*
* @since Valkey 7.0 and above.
* @see <a href="https://valkey.io/commands/sort_ro/">valkey.io</a> for details.
Copy link
Collaborator

Choose a reason for hiding this comment

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

404 not found

* use of {@link SortOptions#byPattern} and {@link SortOptions#getPatterns} in cluster mode is
* supported since Valkey version 8.0.
* @since Valkey 7.0 and above.
* @see <a href="https://valkey.io/commands/sort_ro/">valkey.io</a> for details.
Copy link
Collaborator

Choose a reason for hiding this comment

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

404 not found
I'm not sure we should be added a reference here that doesn't exist. It kind of looks bad. Maybe just add a link to sort?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I dont know why this page doesnt exist

* same slot. The use of {@link SortOptionsBinary#byPattern} and {@link
* SortOptionsBinary#getPatterns} in cluster mode is supported since Valkey version 8.0.
* @since Valkey 7.0 and above.
* @see <a href="https://valkey.io/commands/sort_ro/">valkey.io</a> for details.
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

@MethodSource("getClients")
public void sort_with_pattern(BaseClient client) {
if (client instanceof GlideClusterClient) {
assumeTrue(SERVER_VERSION.isGreaterThanOrEqualTo("7.9.0"), "This feature added in version 8");
Copy link
Collaborator

@yipin-chen yipin-chen Sep 11, 2024

Choose a reason for hiding this comment

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

I know Valkey 7.9 is 8 (while in RC). I am just wondering whether we need to update the test to use "8.0.0" or just leave "7.9.0" as is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have an issue to change that once valkey 8 is released

@shohamazon shohamazon force-pushed the sort-valkey-8 branch 2 times, most recently from e75d3d0 to e4f14f2 Compare September 12, 2024 11:23
Signed-off-by: Shoham Elias <shohame@amazon.com>
@shohamazon shohamazon merged commit 783a9f0 into valkey-io:main Sep 12, 2024
29 checks passed
@shohamazon shohamazon deleted the sort-valkey-8 branch September 12, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java issues and fixes related to the java client node python Release blocker Valkey-8 Support for Valkey-8 features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants