Skip to content

Conversation

@affonsov
Copy link
Collaborator

@affonsov affonsov commented Aug 27, 2025

Add Multi-Database Support for Cluster Mode (Valkey 9.0+)

Overview

This PR adds comprehensive support for multi-database functionality in cluster mode, leveraging the new cluster-databases configuration introduced in Valkey 9.0+. Previously, cluster mode was limited to database 0 only, but Valkey 9.0+ allows configuring multiple databases in cluster mode when cluster-databases is set to a value greater than 1.

Key Features

🔧 Core Implementation

  • Rust Core: Added automatic database selection during cluster client creation
  • Python Client: Added database_id parameter to cluster client configurations

🎯 Client Configuration

Before (Cluster mode limited to database 0):

client = await GlideClusterClient.create_client(
    GlideClusterClientConfiguration(
        addresses=[NodeAddress("localhost", 6379)]
        # database_id not supported in cluster mode
    )
)

After (Cluster mode supports multiple databases):

client = await GlideClusterClient.create_client(
    GlideClusterClientConfiguration(
        addresses=[NodeAddress("localhost", 6379)],
        database_id=5  # Now supported in Valkey 9.0+ cluster mode
    )
)

Technical Changes

Rust Core (glide-core)

  • Database Selection Logic: Added automatic database selection during cluster client creation
  • Error Handling: Proper error propagation when database selection fails
  • Logging: Added detailed logging for database selection operations

Python Client

  • Configuration: Extended both async and sync cluster configurations with database_id parameter
  • Validation: Added client-side validation for database_id (must be non-negative integer)
  • Documentation: Added comprehensive warnings about reconnection behavior

Test Coverage

  • Integration Tests: Comprehensive test suite for multi-database functionality

Server Compatibility

Valkey 9.0+ Requirements

  • Configuration: Requires cluster-databases > 1 in server configuration
  • Default Behavior: Maintains backward compatibility (defaults to database 0)
  • Error Handling: Graceful handling when multi-database cluster mode is not supported

Test Environment Setup

  • Cluster Manager: Updated to automatically configure cluster-databases 16 for Valkey 9.0+
  • Conditional Testing: Tests skip gracefully on older servers or misconfigured clusters

Issue link

This Pull Request is linked to issue (URL): [#4500]

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

Copy link
Contributor

@leszek-bq leszek-bq left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Copy link
Collaborator

@shohamazon shohamazon left a comment

Choose a reason for hiding this comment

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

Few points:

  1. I dont understand the need for a new file of test, we should have a single simple test like standalone.
  2. Cant we check for server version in the test instead of printing that failing is expected?

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>
Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>
Copy link
Collaborator

@yipin-chen yipin-chen left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@shohamazon shohamazon left a comment

Choose a reason for hiding this comment

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

Few comment, great work!

@liorsve
Copy link
Contributor

liorsve commented Sep 7, 2025

Please note that we removed the select command for now from the sync client - #4684

refactored extract_client_id to be in utilities

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>
added custom command test using select

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>
@affonsov affonsov merged commit d1b0ae7 into main Sep 8, 2025
75 of 81 checks passed
affonsov added a commit that referenced this pull request Sep 8, 2025
* - Implement database selection for cluster clients when database_id != 0
- Send SELECT command to all cluster nodes using MultiNode routing
- Add comprehensive error handling with clear error messages
- Include test for database selection error handling in cluster mode
- Support backward compatibility with servers that don't support multi-db cluster mode
- Enable cluster-databases=16 for Valkey 9.0+ in cluster manager

This enables cluster clients to work with non-default databases on Valkey 9.0+
servers configured with cluster-databases support, while gracefully handling
older servers that don't support this feature.

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* update valkey9 multi db tests

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix lint

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fixing valkey 9 cluster tests

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* add to route to all nodes in the core

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* rust lint fix

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* implement database selection in cluster mode via connection parameters

- Add database_id field to ClusterParams and BuilderParams structs
- Add database() method to ClusterClientBuilder for setting database ID
- Pass database_id through connection info instead of post-connection SELECT
- Remove SELECT command from cluster routing
- Remove post-connection SELECT command logic from create_cluster_client
- Add comprehensive tests for database isolation and reconnection behavior
- Verify database ID persistence across node reconnections
- Test multi-database cluster support with proper isolation verification

This change moves database selection from a post-connection SELECT command
to a connection parameter, which is more reliable for cluster mode and
handles reconnections automatically. The approach works with servers that
support multi-database cluster configurations (like Valkey 9.0+).

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* add valkey9 constraint in the core tests

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix core test not skipping test when version was lower than valkey 9

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* Fix version check

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* refactored test test_set_database_id_after_reconnection to be similar from standalone
removed is_valkey_9_or_higher

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* removed tests and cleanup

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* renamed builder.database to builder.database_id

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* python: Add multi-database support for cluster and standalone modes

- Add database_id parameter to BaseClientConfiguration, GlideClientConfiguration, and GlideClusterClientConfiguration
- Implement SELECT command for both cluster and standalone modes with comprehensive documentation
- Add validation for database_id parameter (0-15 range, integer type)
- Refactor configuration protobuf request creation with helper methods for better maintainability
- Add extensive test coverage for database_id configuration and validation
- Include production warnings and recommended approaches in SELECT command documentation
- Support routing configuration for cluster mode SELECT operations
- Ensure database_id persists across reconnections when set in client configuration

Documentation:
- Added comprehensive docstrings with warnings about SELECT command limitations
- Included examples showing recommended database_id configuration approach
- Documented reconnection behavior and cluster-specific routing requirements

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fixing database_id restriction

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fixed test test_standalone_client_with_very_high_database_ids

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix python tests with higher databases id

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix lint error

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* refactoring out the route option from the select command

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* Remove SELECT command from cluster mode and enable cluster tests

- Remove select() method from ClusterCommands in both async and sync clients
- Enable cluster mode testing for database_id tests (parametrize True, False)
- Delete database_id integration test file

The SELECT command is not recommended for cluster mode due to reconnection
behavior where nodes revert to configured database_id, not the selected one.

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* removed database_id validation|
renamed tests to be cluster/standalone agnostic
clean up comments

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* added changelog

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* lint fix

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix test database_id should be skipped for versions lower than 9.0.0

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix test

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* added select rounting
refactored extract_client_id to be in utilities

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix database_id documentation
added custom command test using select

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

---------

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>
affonsov added a commit that referenced this pull request Sep 8, 2025
… Valkey 9.0 (#4694)

Python: Add Multi-Database Support for Cluster Mode Valkey 9.0 (#4659)

* - Implement database selection for cluster clients when database_id != 0
- Send SELECT command to all cluster nodes using MultiNode routing
- Add comprehensive error handling with clear error messages
- Include test for database selection error handling in cluster mode
- Support backward compatibility with servers that don't support multi-db cluster mode
- Enable cluster-databases=16 for Valkey 9.0+ in cluster manager

This enables cluster clients to work with non-default databases on Valkey 9.0+
servers configured with cluster-databases support, while gracefully handling
older servers that don't support this feature.



* update valkey9 multi db tests



* fix lint



* fixing valkey 9 cluster tests



* add to route to all nodes in the core



* rust lint fix



* implement database selection in cluster mode via connection parameters

- Add database_id field to ClusterParams and BuilderParams structs
- Add database() method to ClusterClientBuilder for setting database ID
- Pass database_id through connection info instead of post-connection SELECT
- Remove SELECT command from cluster routing
- Remove post-connection SELECT command logic from create_cluster_client
- Add comprehensive tests for database isolation and reconnection behavior
- Verify database ID persistence across node reconnections
- Test multi-database cluster support with proper isolation verification

This change moves database selection from a post-connection SELECT command
to a connection parameter, which is more reliable for cluster mode and
handles reconnections automatically. The approach works with servers that
support multi-database cluster configurations (like Valkey 9.0+).



* add valkey9 constraint in the core tests



* fix core test not skipping test when version was lower than valkey 9



* Fix version check



* refactored test test_set_database_id_after_reconnection to be similar from standalone
removed is_valkey_9_or_higher



* removed tests and cleanup



* renamed builder.database to builder.database_id



* python: Add multi-database support for cluster and standalone modes

- Add database_id parameter to BaseClientConfiguration, GlideClientConfiguration, and GlideClusterClientConfiguration
- Implement SELECT command for both cluster and standalone modes with comprehensive documentation
- Add validation for database_id parameter (0-15 range, integer type)
- Refactor configuration protobuf request creation with helper methods for better maintainability
- Add extensive test coverage for database_id configuration and validation
- Include production warnings and recommended approaches in SELECT command documentation
- Support routing configuration for cluster mode SELECT operations
- Ensure database_id persists across reconnections when set in client configuration

Documentation:
- Added comprehensive docstrings with warnings about SELECT command limitations
- Included examples showing recommended database_id configuration approach
- Documented reconnection behavior and cluster-specific routing requirements



* fixing database_id restriction



* fixed test test_standalone_client_with_very_high_database_ids



* fix python tests with higher databases id



* fix lint error



* refactoring out the route option from the select command



* Remove SELECT command from cluster mode and enable cluster tests

- Remove select() method from ClusterCommands in both async and sync clients
- Enable cluster mode testing for database_id tests (parametrize True, False)
- Delete database_id integration test file

The SELECT command is not recommended for cluster mode due to reconnection
behavior where nodes revert to configured database_id, not the selected one.



* removed database_id validation|
renamed tests to be cluster/standalone agnostic
clean up comments



* added changelog



* lint fix



* fix test database_id should be skipped for versions lower than 9.0.0



* fix test



* added select rounting
refactored extract_client_id to be in utilities



* fix database_id documentation
added custom command test using select



---------

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>
@affonsov affonsov deleted the python/affonsov-cluster-multidb-support branch September 15, 2025 15:20
jbrinkman added a commit that referenced this pull request Sep 18, 2025
* Go: Add MUSL support (#4476)

* Go: Switch to MUSL binary

Signed-off-by: James Xin <james.xin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* rustup add musl targets

Signed-off-by: James Xin <james.xin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* lint

Signed-off-by: James Xin <james.xin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* rustup add musl targets in Makefile

Signed-off-by: James Xin <james.xin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Add pathing

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Trigger CodeQL on main

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix typo

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix typo

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Modify CD

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Modify CD

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Modify CD

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Modify CD

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update docs

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Format

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Address feedback

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update doc

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

---------

Signed-off-by: James Xin <james.xin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
Co-authored-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
Co-authored-by: Alexey Temnikov <alexey.temnikov@improving.com>

* Java: Migration guide for Jedis compatibility layer (#4672) (#4681)

* Java: Migration guide for Jedis compatibility layer

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* [Backport to 2.1] Python: Add Multi-Database Support for Cluster Mode Valkey 9.0  (#4694)

Python: Add Multi-Database Support for Cluster Mode Valkey 9.0 (#4659)

* - Implement database selection for cluster clients when database_id != 0
- Send SELECT command to all cluster nodes using MultiNode routing
- Add comprehensive error handling with clear error messages
- Include test for database selection error handling in cluster mode
- Support backward compatibility with servers that don't support multi-db cluster mode
- Enable cluster-databases=16 for Valkey 9.0+ in cluster manager

This enables cluster clients to work with non-default databases on Valkey 9.0+
servers configured with cluster-databases support, while gracefully handling
older servers that don't support this feature.



* update valkey9 multi db tests



* fix lint



* fixing valkey 9 cluster tests



* add to route to all nodes in the core



* rust lint fix



* implement database selection in cluster mode via connection parameters

- Add database_id field to ClusterParams and BuilderParams structs
- Add database() method to ClusterClientBuilder for setting database ID
- Pass database_id through connection info instead of post-connection SELECT
- Remove SELECT command from cluster routing
- Remove post-connection SELECT command logic from create_cluster_client
- Add comprehensive tests for database isolation and reconnection behavior
- Verify database ID persistence across node reconnections
- Test multi-database cluster support with proper isolation verification

This change moves database selection from a post-connection SELECT command
to a connection parameter, which is more reliable for cluster mode and
handles reconnections automatically. The approach works with servers that
support multi-database cluster configurations (like Valkey 9.0+).



* add valkey9 constraint in the core tests



* fix core test not skipping test when version was lower than valkey 9



* Fix version check



* refactored test test_set_database_id_after_reconnection to be similar from standalone
removed is_valkey_9_or_higher



* removed tests and cleanup



* renamed builder.database to builder.database_id



* python: Add multi-database support for cluster and standalone modes

- Add database_id parameter to BaseClientConfiguration, GlideClientConfiguration, and GlideClusterClientConfiguration
- Implement SELECT command for both cluster and standalone modes with comprehensive documentation
- Add validation for database_id parameter (0-15 range, integer type)
- Refactor configuration protobuf request creation with helper methods for better maintainability
- Add extensive test coverage for database_id configuration and validation
- Include production warnings and recommended approaches in SELECT command documentation
- Support routing configuration for cluster mode SELECT operations
- Ensure database_id persists across reconnections when set in client configuration

Documentation:
- Added comprehensive docstrings with warnings about SELECT command limitations
- Included examples showing recommended database_id configuration approach
- Documented reconnection behavior and cluster-specific routing requirements



* fixing database_id restriction



* fixed test test_standalone_client_with_very_high_database_ids



* fix python tests with higher databases id



* fix lint error



* refactoring out the route option from the select command



* Remove SELECT command from cluster mode and enable cluster tests

- Remove select() method from ClusterCommands in both async and sync clients
- Enable cluster mode testing for database_id tests (parametrize True, False)
- Delete database_id integration test file

The SELECT command is not recommended for cluster mode due to reconnection
behavior where nodes revert to configured database_id, not the selected one.



* removed database_id validation|
renamed tests to be cluster/standalone agnostic
clean up comments



* added changelog



* lint fix



* fix test database_id should be skipped for versions lower than 9.0.0



* fix test



* added select rounting
refactored extract_client_id to be in utilities



* fix database_id documentation
added custom command test using select



---------

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* [Backport 2.1] Go: Add Multi-Database Support for Cluster Mode Valkey 9.0 (#4696)

Go: Add Multi-Database Support for Cluster Mode Valkey 9.0 (#4660)

* - Implement database selection for cluster clients when database_id != 0
- Send SELECT command to all cluster nodes using MultiNode routing
- Add comprehensive error handling with clear error messages
- Include test for database selection error handling in cluster mode
- Support backward compatibility with servers that don't support multi-db cluster mode
- Enable cluster-databases=16 for Valkey 9.0+ in cluster manager

This enables cluster clients to work with non-default databases on Valkey 9.0+
servers configured with cluster-databases support, while gracefully handling
older servers that don't support this feature.



* update valkey9 multi db tests



* fix lint



* fixing valkey 9 cluster tests



* add to route to all nodes in the core



* rust lint fix



* implement database selection in cluster mode via connection parameters

- Add database_id field to ClusterParams and BuilderParams structs
- Add database() method to ClusterClientBuilder for setting database ID
- Pass database_id through connection info instead of post-connection SELECT
- Remove SELECT command from cluster routing
- Remove post-connection SELECT command logic from create_cluster_client
- Add comprehensive tests for database isolation and reconnection behavior
- Verify database ID persistence across node reconnections
- Test multi-database cluster support with proper isolation verification

This change moves database selection from a post-connection SELECT command
to a connection parameter, which is more reliable for cluster mode and
handles reconnections automatically. The approach works with servers that
support multi-database cluster configurations (like Valkey 9.0+).



* add valkey9 constraint in the core tests



* fix core test not skipping test when version was lower than valkey 9



* Fix version check



* refactored test test_set_database_id_after_reconnection to be similar from standalone
removed is_valkey_9_or_higher



* removed tests and cleanup



* renamed builder.database to builder.database_id



* go: Add multi-database support for cluster mode clients

- Add DatabaseId field to baseClientConfiguration for both standalone and cluster clients
- Implement WithDatabaseId() method for ClusterClientConfiguration
- Add database ID validation with proper error handling for negative values
- Refactor standalone client to use shared database ID logic from base configuration
- Add Select() and SelectWithOptions() methods for cluster clients with routing support
- Include comprehensive test coverage for database isolation, reconnection persistence, and error handling
- Add backward compatibility support - clients default to database 0 when no database_id specified
- Add server version compatibility checks (cluster multi-database requires Valkey 9.0+)
- Update documentation with warnings about SELECT command limitations and recommended configuration approach

This enables cluster mode clients to connect to specific databases at initialization time,
with the database selection persisting across reconnections, unlike the SELECT command
which resets on reconnection.



* fixed go tests
- batch tests
- database id tests



* removed selectWithOptions



* go: Remove Select command from cluster clients

- Remove Select method from ClusterClient and related interfaces
- Delete comprehensive database_id integration tests
- Remove Select command from batch operations
- Remove Select examples and tests
- Add example for cluster client with database_id configuration

The Select command is being removed in favor of using the database_id
configuration parameter, which provides persistent database selection
across reconnections.



* remove config validation
simplified tests



* added changelog



* removing batch test, and readding standalone select and removing batch select



---------

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* [Backport 2.1] Java: Multi-Database Support for Cluster Mode Valkey 9.0 (#4697)

Java: Multi-Database Support for Cluster Mode Valkey 9.0 (#4658)

* - Implement database selection for cluster clients when database_id != 0
- Send SELECT command to all cluster nodes using MultiNode routing
- Add comprehensive error handling with clear error messages
- Include test for database selection error handling in cluster mode
- Support backward compatibility with servers that don't support multi-db cluster mode
- Enable cluster-databases=16 for Valkey 9.0+ in cluster manager

This enables cluster clients to work with non-default databases on Valkey 9.0+
servers configured with cluster-databases support, while gracefully handling
older servers that don't support this feature.



* update valkey9 multi db tests



* fix lint



* fixing valkey 9 cluster tests



* add to route to all nodes in the core



* rust lint fix



* implement database selection in cluster mode via connection parameters

- Add database_id field to ClusterParams and BuilderParams structs
- Add database() method to ClusterClientBuilder for setting database ID
- Pass database_id through connection info instead of post-connection SELECT
- Remove SELECT command from cluster routing
- Remove post-connection SELECT command logic from create_cluster_client
- Add comprehensive tests for database isolation and reconnection behavior
- Verify database ID persistence across node reconnections
- Test multi-database cluster support with proper isolation verification

This change moves database selection from a post-connection SELECT command
to a connection parameter, which is more reliable for cluster mode and
handles reconnections automatically. The approach works with servers that
support multi-database cluster configurations (like Valkey 9.0+).



* add valkey9 constraint in the core tests



* fix core test not skipping test when version was lower than valkey 9



* Fix version check



* refactored test test_set_database_id_after_reconnection to be similar from standalone
removed is_valkey_9_or_higher



* removed tests and cleanup



* renamed builder.database to builder.database_id



* Java: implement multi-database support for cluster mode

- Move databaseId from GlideClientConfiguration to BaseClientConfiguration
- Add databaseId validation and protobuf integration
- Update SELECT command with AllNodes routing and reconnection warnings
- Add connection management for database selection after auth
- Add comprehensive tests with Valkey 9+ version guards

Completes Java client implementation for Valkey 9 cluster multi-database support.



* fixing database id restriction



* fixed java test error select_command_invalid_database_standalone



* fixed lint errors



* Refactored select command to route to all nodes per default
Removed the option to provide a route



* java lint fix



* java: Remove SELECT command from cluster client

- Remove select() method from GlideClusterClient and ConnectionManagementClusterCommands interface
- Delete MultiDatabaseTests.java which tested SELECT command functionality
- Remove SELECT command tests from SharedCommandTests.java
- Add focused test for cluster database_id configuration in ClusterClientTests
- Remove SELECT import from GlideClusterClient

The SELECT command is being removed from the cluster client API as database
selection should be handled through client configuration (databaseId parameter)
rather than runtime commands, which provides better consistency and avoids
reconnection issues.



* remove database_id validatation and simplified tests



* added changelog



* fix documentation



* fix databaseId documentation



---------

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* [Backport 2.1] Node: Add Multi-Database Support for Cluster Mode (Valkey 9.0) (#4698)

Node: Add Multi-Database Support for Cluster Mode (Valkey 9.0) (#4657)

* - Implement database selection for cluster clients when database_id != 0
- Send SELECT command to all cluster nodes using MultiNode routing
- Add comprehensive error handling with clear error messages
- Include test for database selection error handling in cluster mode
- Support backward compatibility with servers that don't support multi-db cluster mode
- Enable cluster-databases=16 for Valkey 9.0+ in cluster manager

This enables cluster clients to work with non-default databases on Valkey 9.0+
servers configured with cluster-databases support, while gracefully handling
older servers that don't support this feature.



* update valkey9 multi db tests



* fix lint



* fixing valkey 9 cluster tests



* add to route to all nodes in the core



* rust lint fix



* implement database selection in cluster mode via connection parameters

- Add database_id field to ClusterParams and BuilderParams structs
- Add database() method to ClusterClientBuilder for setting database ID
- Pass database_id through connection info instead of post-connection SELECT
- Remove SELECT command from cluster routing
- Remove post-connection SELECT command logic from create_cluster_client
- Add comprehensive tests for database isolation and reconnection behavior
- Verify database ID persistence across node reconnections
- Test multi-database cluster support with proper isolation verification

This change moves database selection from a post-connection SELECT command
to a connection parameter, which is more reliable for cluster mode and
handles reconnections automatically. The approach works with servers that
support multi-database cluster configurations (like Valkey 9.0+).



* add valkey9 constraint in the core tests



* fix core test not skipping test when version was lower than valkey 9



* Fix version check



* refactored test test_set_database_id_after_reconnection to be similar from standalone
removed is_valkey_9_or_higher



* removed tests and cleanup



* renamed builder.database to builder.database_id



* node changes



* move tests to sharedtests.ts



* reafactoring to select to all nodes being in the core



* node: Remove SELECT command support from cluster client

- Remove select() method from GlideClusterClient
- Remove createSelect import from cluster client
- Remove extensive test coverage for SELECT functionality
- Remove database ID validation tests from client internals
- Add minimal database ID test for cluster client configuration
- Clean up ConfigurationError import that's no longer needed

This change removes the SELECT command implementation that was added
for Valkey 9.0+ cluster support, likely due to reliability concerns
with database switching in cluster mode or to simplify the API.



* added changelog



* fix test, and removed comment



---------

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* [Backport 2.1] Python sync: removed select command (#4705)

Python sync: removed select command (#4684)

removed sync select command

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

* [Backport 2.1] CI/CD: Added self hosted macOS ARM runners (#4706)

* CI: Added self hosted macOS runners (#4683)

added self hosted runners  for macos
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

* CD: removed self hosted mac arm runners from required CD platforms #4700 (#4702)

removed self hosted mac from cd, reverted npm-cd

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

---------

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

* [backport 2.1] Python: fixed pypi-cd workflow, fixed release tests (#4708)

Python: fixed pypi-cd workflow, fixed release tests (#4703)

fixed pypi upload, fixed release tests

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

* Fix FFI tests for non-alpine distros (#4711)

Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>

* MUSL Java Build Fixes (#4712)

* Use zigbuild for easier cross-compilation

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Use zigbuild for easier cross-compilation

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Use zigbuild for easier cross-compilation

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix musl classifier / detection

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix musl classifier / detection

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix musl classifier / detection

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update docs

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Exclude arm musl test

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update arm runner

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update go exclusion

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Format

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

---------

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Revert go upload step change (#4716)

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* CD: Fix Node CD delete artifact issue (#4717)

Signed-off-by: James Xin <james.xin@improving.com>

* CD: Fix Go musl CD issue (#4719)

Signed-off-by: James Xin <james.xin@improving.com>

* CD: Fix Node CD delete artifact issue 2nd try (#4718)

* CD: Fix Node CD delete artifact issue 2nd try

Signed-off-by: James Xin <james.xin@improving.com>

* Linter

Signed-off-by: James Xin <james.xin@improving.com>

* remove temporary testing

Signed-off-by: James Xin <james.xin@improving.com>

---------

Signed-off-by: James Xin <james.xin@improving.com>

* Python: Update ExpiryType enum references in hash field expiration docs (#4715)

python: Update ExpiryType enum references in hash field expiration docs

Replace deprecated ExpiryType enum values with new names in docstrings:
- EX → SEC
- PX → MILLSEC
- EXAT → UNIX_SEC
- PXAT → UNIX_MILLSEC
- KEEPTTL → KEEP_TTL

Updates documentation for hash field expiration commands in both async and sync clients.

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* [Backport 2.1] Python sync/CD: added description to pypi package of the sync client (#4720)

Python sync/CD: added description to pypi package of the sync client (#4714)

added description to sync client

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

* Java: Compatibility layer module (#4692)

* Java: Compatibility layer module

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: fix integration tests

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql for java code

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Update java cd

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: lint issues fixed

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Add signing configuration to jedis-compatibility build.gradle

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: update dependency

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Update valkey-glide-jedis-compatibility file path

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix build.gradle publishing code

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

---------

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Fix: Copy GPG secring to jedis-compatibility in Java CD workflow (#4723)

fix(java-cd): copy secring.gpg to jedis-compatibility for signing

Signed-off-by: jbrinkman <joe.brinkman@improving.com>

* [Backport 2.1] Python Sync: revert license format (#4732)

Python Sync: revert license format (#4731)

revert license format

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

* Java: Fix Jedis compatibility layer valkey-glide dependency (#4737)

* Java: Fix Jedis compatibility layer valkey-glide dependency

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* [Backport 2.1] Python: improve UDS socket error handling (#4733) (#4755)

Python: improve UDS socket error handling (#4733)

fixed uds error handling

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Co-authored-by: Lior Sventitzky <liorsve@amazon.com>

---------

Signed-off-by: James Xin <james.xin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>
Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
Signed-off-by: jbrinkman <joe.brinkman@improving.com>
Co-authored-by: James Xin <james.xin@improving.com>
Co-authored-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
Co-authored-by: Alexey Temnikov <alexey.temnikov@improving.com>
Co-authored-by: prateek-kumar-improving <prateek.kumar@improving.com>
Co-authored-by: affonsov <67347924+affonsov@users.noreply.github.com>
Co-authored-by: Lior Sventitzky <liorsve@amazon.com>
Co-authored-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
xShinnRyuu pushed a commit that referenced this pull request Sep 24, 2025
* - Implement database selection for cluster clients when database_id != 0
- Send SELECT command to all cluster nodes using MultiNode routing
- Add comprehensive error handling with clear error messages
- Include test for database selection error handling in cluster mode
- Support backward compatibility with servers that don't support multi-db cluster mode
- Enable cluster-databases=16 for Valkey 9.0+ in cluster manager

This enables cluster clients to work with non-default databases on Valkey 9.0+
servers configured with cluster-databases support, while gracefully handling
older servers that don't support this feature.

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* update valkey9 multi db tests

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix lint

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fixing valkey 9 cluster tests

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* add to route to all nodes in the core

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* rust lint fix

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* implement database selection in cluster mode via connection parameters

- Add database_id field to ClusterParams and BuilderParams structs
- Add database() method to ClusterClientBuilder for setting database ID
- Pass database_id through connection info instead of post-connection SELECT
- Remove SELECT command from cluster routing
- Remove post-connection SELECT command logic from create_cluster_client
- Add comprehensive tests for database isolation and reconnection behavior
- Verify database ID persistence across node reconnections
- Test multi-database cluster support with proper isolation verification

This change moves database selection from a post-connection SELECT command
to a connection parameter, which is more reliable for cluster mode and
handles reconnections automatically. The approach works with servers that
support multi-database cluster configurations (like Valkey 9.0+).

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* add valkey9 constraint in the core tests

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix core test not skipping test when version was lower than valkey 9

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* Fix version check

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* refactored test test_set_database_id_after_reconnection to be similar from standalone
removed is_valkey_9_or_higher

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* removed tests and cleanup

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* renamed builder.database to builder.database_id

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* python: Add multi-database support for cluster and standalone modes

- Add database_id parameter to BaseClientConfiguration, GlideClientConfiguration, and GlideClusterClientConfiguration
- Implement SELECT command for both cluster and standalone modes with comprehensive documentation
- Add validation for database_id parameter (0-15 range, integer type)
- Refactor configuration protobuf request creation with helper methods for better maintainability
- Add extensive test coverage for database_id configuration and validation
- Include production warnings and recommended approaches in SELECT command documentation
- Support routing configuration for cluster mode SELECT operations
- Ensure database_id persists across reconnections when set in client configuration

Documentation:
- Added comprehensive docstrings with warnings about SELECT command limitations
- Included examples showing recommended database_id configuration approach
- Documented reconnection behavior and cluster-specific routing requirements

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fixing database_id restriction

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fixed test test_standalone_client_with_very_high_database_ids

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix python tests with higher databases id

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix lint error

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* refactoring out the route option from the select command

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* Remove SELECT command from cluster mode and enable cluster tests

- Remove select() method from ClusterCommands in both async and sync clients
- Enable cluster mode testing for database_id tests (parametrize True, False)
- Delete database_id integration test file

The SELECT command is not recommended for cluster mode due to reconnection
behavior where nodes revert to configured database_id, not the selected one.

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* removed database_id validation|
renamed tests to be cluster/standalone agnostic
clean up comments

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* added changelog

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* lint fix

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix test database_id should be skipped for versions lower than 9.0.0

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix test

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* added select rounting
refactored extract_client_id to be in utilities

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* fix database_id documentation
added custom command test using select

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

---------

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>
xShinnRyuu pushed a commit that referenced this pull request Sep 24, 2025
* Go: Add MUSL support (#4476)

* Go: Switch to MUSL binary

Signed-off-by: James Xin <james.xin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* rustup add musl targets

Signed-off-by: James Xin <james.xin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* lint

Signed-off-by: James Xin <james.xin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* rustup add musl targets in Makefile

Signed-off-by: James Xin <james.xin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Add pathing

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Trigger CodeQL on main

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update CI

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix typo

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix typo

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Modify CD

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Modify CD

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Modify CD

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Modify CD

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update docs

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Format

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Address feedback

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update doc

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

---------

Signed-off-by: James Xin <james.xin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
Co-authored-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
Co-authored-by: Alexey Temnikov <alexey.temnikov@improving.com>

* Java: Migration guide for Jedis compatibility layer (#4672) (#4681)

* Java: Migration guide for Jedis compatibility layer

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* [Backport to 2.1] Python: Add Multi-Database Support for Cluster Mode Valkey 9.0  (#4694)

Python: Add Multi-Database Support for Cluster Mode Valkey 9.0 (#4659)

* - Implement database selection for cluster clients when database_id != 0
- Send SELECT command to all cluster nodes using MultiNode routing
- Add comprehensive error handling with clear error messages
- Include test for database selection error handling in cluster mode
- Support backward compatibility with servers that don't support multi-db cluster mode
- Enable cluster-databases=16 for Valkey 9.0+ in cluster manager

This enables cluster clients to work with non-default databases on Valkey 9.0+
servers configured with cluster-databases support, while gracefully handling
older servers that don't support this feature.



* update valkey9 multi db tests



* fix lint



* fixing valkey 9 cluster tests



* add to route to all nodes in the core



* rust lint fix



* implement database selection in cluster mode via connection parameters

- Add database_id field to ClusterParams and BuilderParams structs
- Add database() method to ClusterClientBuilder for setting database ID
- Pass database_id through connection info instead of post-connection SELECT
- Remove SELECT command from cluster routing
- Remove post-connection SELECT command logic from create_cluster_client
- Add comprehensive tests for database isolation and reconnection behavior
- Verify database ID persistence across node reconnections
- Test multi-database cluster support with proper isolation verification

This change moves database selection from a post-connection SELECT command
to a connection parameter, which is more reliable for cluster mode and
handles reconnections automatically. The approach works with servers that
support multi-database cluster configurations (like Valkey 9.0+).



* add valkey9 constraint in the core tests



* fix core test not skipping test when version was lower than valkey 9



* Fix version check



* refactored test test_set_database_id_after_reconnection to be similar from standalone
removed is_valkey_9_or_higher



* removed tests and cleanup



* renamed builder.database to builder.database_id



* python: Add multi-database support for cluster and standalone modes

- Add database_id parameter to BaseClientConfiguration, GlideClientConfiguration, and GlideClusterClientConfiguration
- Implement SELECT command for both cluster and standalone modes with comprehensive documentation
- Add validation for database_id parameter (0-15 range, integer type)
- Refactor configuration protobuf request creation with helper methods for better maintainability
- Add extensive test coverage for database_id configuration and validation
- Include production warnings and recommended approaches in SELECT command documentation
- Support routing configuration for cluster mode SELECT operations
- Ensure database_id persists across reconnections when set in client configuration

Documentation:
- Added comprehensive docstrings with warnings about SELECT command limitations
- Included examples showing recommended database_id configuration approach
- Documented reconnection behavior and cluster-specific routing requirements



* fixing database_id restriction



* fixed test test_standalone_client_with_very_high_database_ids



* fix python tests with higher databases id



* fix lint error



* refactoring out the route option from the select command



* Remove SELECT command from cluster mode and enable cluster tests

- Remove select() method from ClusterCommands in both async and sync clients
- Enable cluster mode testing for database_id tests (parametrize True, False)
- Delete database_id integration test file

The SELECT command is not recommended for cluster mode due to reconnection
behavior where nodes revert to configured database_id, not the selected one.



* removed database_id validation|
renamed tests to be cluster/standalone agnostic
clean up comments



* added changelog



* lint fix



* fix test database_id should be skipped for versions lower than 9.0.0



* fix test



* added select rounting
refactored extract_client_id to be in utilities



* fix database_id documentation
added custom command test using select



---------

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* [Backport 2.1] Go: Add Multi-Database Support for Cluster Mode Valkey 9.0 (#4696)

Go: Add Multi-Database Support for Cluster Mode Valkey 9.0 (#4660)

* - Implement database selection for cluster clients when database_id != 0
- Send SELECT command to all cluster nodes using MultiNode routing
- Add comprehensive error handling with clear error messages
- Include test for database selection error handling in cluster mode
- Support backward compatibility with servers that don't support multi-db cluster mode
- Enable cluster-databases=16 for Valkey 9.0+ in cluster manager

This enables cluster clients to work with non-default databases on Valkey 9.0+
servers configured with cluster-databases support, while gracefully handling
older servers that don't support this feature.



* update valkey9 multi db tests



* fix lint



* fixing valkey 9 cluster tests



* add to route to all nodes in the core



* rust lint fix



* implement database selection in cluster mode via connection parameters

- Add database_id field to ClusterParams and BuilderParams structs
- Add database() method to ClusterClientBuilder for setting database ID
- Pass database_id through connection info instead of post-connection SELECT
- Remove SELECT command from cluster routing
- Remove post-connection SELECT command logic from create_cluster_client
- Add comprehensive tests for database isolation and reconnection behavior
- Verify database ID persistence across node reconnections
- Test multi-database cluster support with proper isolation verification

This change moves database selection from a post-connection SELECT command
to a connection parameter, which is more reliable for cluster mode and
handles reconnections automatically. The approach works with servers that
support multi-database cluster configurations (like Valkey 9.0+).



* add valkey9 constraint in the core tests



* fix core test not skipping test when version was lower than valkey 9



* Fix version check



* refactored test test_set_database_id_after_reconnection to be similar from standalone
removed is_valkey_9_or_higher



* removed tests and cleanup



* renamed builder.database to builder.database_id



* go: Add multi-database support for cluster mode clients

- Add DatabaseId field to baseClientConfiguration for both standalone and cluster clients
- Implement WithDatabaseId() method for ClusterClientConfiguration
- Add database ID validation with proper error handling for negative values
- Refactor standalone client to use shared database ID logic from base configuration
- Add Select() and SelectWithOptions() methods for cluster clients with routing support
- Include comprehensive test coverage for database isolation, reconnection persistence, and error handling
- Add backward compatibility support - clients default to database 0 when no database_id specified
- Add server version compatibility checks (cluster multi-database requires Valkey 9.0+)
- Update documentation with warnings about SELECT command limitations and recommended configuration approach

This enables cluster mode clients to connect to specific databases at initialization time,
with the database selection persisting across reconnections, unlike the SELECT command
which resets on reconnection.



* fixed go tests
- batch tests
- database id tests



* removed selectWithOptions



* go: Remove Select command from cluster clients

- Remove Select method from ClusterClient and related interfaces
- Delete comprehensive database_id integration tests
- Remove Select command from batch operations
- Remove Select examples and tests
- Add example for cluster client with database_id configuration

The Select command is being removed in favor of using the database_id
configuration parameter, which provides persistent database selection
across reconnections.



* remove config validation
simplified tests



* added changelog



* removing batch test, and readding standalone select and removing batch select



---------

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* [Backport 2.1] Java: Multi-Database Support for Cluster Mode Valkey 9.0 (#4697)

Java: Multi-Database Support for Cluster Mode Valkey 9.0 (#4658)

* - Implement database selection for cluster clients when database_id != 0
- Send SELECT command to all cluster nodes using MultiNode routing
- Add comprehensive error handling with clear error messages
- Include test for database selection error handling in cluster mode
- Support backward compatibility with servers that don't support multi-db cluster mode
- Enable cluster-databases=16 for Valkey 9.0+ in cluster manager

This enables cluster clients to work with non-default databases on Valkey 9.0+
servers configured with cluster-databases support, while gracefully handling
older servers that don't support this feature.



* update valkey9 multi db tests



* fix lint



* fixing valkey 9 cluster tests



* add to route to all nodes in the core



* rust lint fix



* implement database selection in cluster mode via connection parameters

- Add database_id field to ClusterParams and BuilderParams structs
- Add database() method to ClusterClientBuilder for setting database ID
- Pass database_id through connection info instead of post-connection SELECT
- Remove SELECT command from cluster routing
- Remove post-connection SELECT command logic from create_cluster_client
- Add comprehensive tests for database isolation and reconnection behavior
- Verify database ID persistence across node reconnections
- Test multi-database cluster support with proper isolation verification

This change moves database selection from a post-connection SELECT command
to a connection parameter, which is more reliable for cluster mode and
handles reconnections automatically. The approach works with servers that
support multi-database cluster configurations (like Valkey 9.0+).



* add valkey9 constraint in the core tests



* fix core test not skipping test when version was lower than valkey 9



* Fix version check



* refactored test test_set_database_id_after_reconnection to be similar from standalone
removed is_valkey_9_or_higher



* removed tests and cleanup



* renamed builder.database to builder.database_id



* Java: implement multi-database support for cluster mode

- Move databaseId from GlideClientConfiguration to BaseClientConfiguration
- Add databaseId validation and protobuf integration
- Update SELECT command with AllNodes routing and reconnection warnings
- Add connection management for database selection after auth
- Add comprehensive tests with Valkey 9+ version guards

Completes Java client implementation for Valkey 9 cluster multi-database support.



* fixing database id restriction



* fixed java test error select_command_invalid_database_standalone



* fixed lint errors



* Refactored select command to route to all nodes per default
Removed the option to provide a route



* java lint fix



* java: Remove SELECT command from cluster client

- Remove select() method from GlideClusterClient and ConnectionManagementClusterCommands interface
- Delete MultiDatabaseTests.java which tested SELECT command functionality
- Remove SELECT command tests from SharedCommandTests.java
- Add focused test for cluster database_id configuration in ClusterClientTests
- Remove SELECT import from GlideClusterClient

The SELECT command is being removed from the cluster client API as database
selection should be handled through client configuration (databaseId parameter)
rather than runtime commands, which provides better consistency and avoids
reconnection issues.



* remove database_id validatation and simplified tests



* added changelog



* fix documentation



* fix databaseId documentation



---------

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* [Backport 2.1] Node: Add Multi-Database Support for Cluster Mode (Valkey 9.0) (#4698)

Node: Add Multi-Database Support for Cluster Mode (Valkey 9.0) (#4657)

* - Implement database selection for cluster clients when database_id != 0
- Send SELECT command to all cluster nodes using MultiNode routing
- Add comprehensive error handling with clear error messages
- Include test for database selection error handling in cluster mode
- Support backward compatibility with servers that don't support multi-db cluster mode
- Enable cluster-databases=16 for Valkey 9.0+ in cluster manager

This enables cluster clients to work with non-default databases on Valkey 9.0+
servers configured with cluster-databases support, while gracefully handling
older servers that don't support this feature.



* update valkey9 multi db tests



* fix lint



* fixing valkey 9 cluster tests



* add to route to all nodes in the core



* rust lint fix



* implement database selection in cluster mode via connection parameters

- Add database_id field to ClusterParams and BuilderParams structs
- Add database() method to ClusterClientBuilder for setting database ID
- Pass database_id through connection info instead of post-connection SELECT
- Remove SELECT command from cluster routing
- Remove post-connection SELECT command logic from create_cluster_client
- Add comprehensive tests for database isolation and reconnection behavior
- Verify database ID persistence across node reconnections
- Test multi-database cluster support with proper isolation verification

This change moves database selection from a post-connection SELECT command
to a connection parameter, which is more reliable for cluster mode and
handles reconnections automatically. The approach works with servers that
support multi-database cluster configurations (like Valkey 9.0+).



* add valkey9 constraint in the core tests



* fix core test not skipping test when version was lower than valkey 9



* Fix version check



* refactored test test_set_database_id_after_reconnection to be similar from standalone
removed is_valkey_9_or_higher



* removed tests and cleanup



* renamed builder.database to builder.database_id



* node changes



* move tests to sharedtests.ts



* reafactoring to select to all nodes being in the core



* node: Remove SELECT command support from cluster client

- Remove select() method from GlideClusterClient
- Remove createSelect import from cluster client
- Remove extensive test coverage for SELECT functionality
- Remove database ID validation tests from client internals
- Add minimal database ID test for cluster client configuration
- Clean up ConfigurationError import that's no longer needed

This change removes the SELECT command implementation that was added
for Valkey 9.0+ cluster support, likely due to reliability concerns
with database switching in cluster mode or to simplify the API.



* added changelog



* fix test, and removed comment



---------

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* [Backport 2.1] Python sync: removed select command (#4705)

Python sync: removed select command (#4684)

removed sync select command

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

* [Backport 2.1] CI/CD: Added self hosted macOS ARM runners (#4706)

* CI: Added self hosted macOS runners (#4683)

added self hosted runners  for macos
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

* CD: removed self hosted mac arm runners from required CD platforms #4700 (#4702)

removed self hosted mac from cd, reverted npm-cd

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

---------

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

* [backport 2.1] Python: fixed pypi-cd workflow, fixed release tests (#4708)

Python: fixed pypi-cd workflow, fixed release tests (#4703)

fixed pypi upload, fixed release tests

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

* Fix FFI tests for non-alpine distros (#4711)

Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>

* MUSL Java Build Fixes (#4712)

* Use zigbuild for easier cross-compilation

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Use zigbuild for easier cross-compilation

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Use zigbuild for easier cross-compilation

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix musl classifier / detection

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix musl classifier / detection

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Fix musl classifier / detection

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update docs

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Exclude arm musl test

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update arm runner

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Update go exclusion

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Format

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

---------

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* Revert go upload step change (#4716)

Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>

* CD: Fix Node CD delete artifact issue (#4717)

Signed-off-by: James Xin <james.xin@improving.com>

* CD: Fix Go musl CD issue (#4719)

Signed-off-by: James Xin <james.xin@improving.com>

* CD: Fix Node CD delete artifact issue 2nd try (#4718)

* CD: Fix Node CD delete artifact issue 2nd try

Signed-off-by: James Xin <james.xin@improving.com>

* Linter

Signed-off-by: James Xin <james.xin@improving.com>

* remove temporary testing

Signed-off-by: James Xin <james.xin@improving.com>

---------

Signed-off-by: James Xin <james.xin@improving.com>

* Python: Update ExpiryType enum references in hash field expiration docs (#4715)

python: Update ExpiryType enum references in hash field expiration docs

Replace deprecated ExpiryType enum values with new names in docstrings:
- EX → SEC
- PX → MILLSEC
- EXAT → UNIX_SEC
- PXAT → UNIX_MILLSEC
- KEEPTTL → KEEP_TTL

Updates documentation for hash field expiration commands in both async and sync clients.

Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>

* [Backport 2.1] Python sync/CD: added description to pypi package of the sync client (#4720)

Python sync/CD: added description to pypi package of the sync client (#4714)

added description to sync client

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

* Java: Compatibility layer module (#4692)

* Java: Compatibility layer module

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: fix integration tests

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql for java code

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix codeql java build

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Update java cd

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: lint issues fixed

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Add signing configuration to jedis-compatibility build.gradle

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: update dependency

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Update valkey-glide-jedis-compatibility file path

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Java: Fix build.gradle publishing code

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

---------

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* Fix: Copy GPG secring to jedis-compatibility in Java CD workflow (#4723)

fix(java-cd): copy secring.gpg to jedis-compatibility for signing

Signed-off-by: jbrinkman <joe.brinkman@improving.com>

* [Backport 2.1] Python Sync: revert license format (#4732)

Python Sync: revert license format (#4731)

revert license format

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>

* Java: Fix Jedis compatibility layer valkey-glide dependency (#4737)

* Java: Fix Jedis compatibility layer valkey-glide dependency

Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>

* [Backport 2.1] Python: improve UDS socket error handling (#4733) (#4755)

Python: improve UDS socket error handling (#4733)

fixed uds error handling

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Co-authored-by: Lior Sventitzky <liorsve@amazon.com>

---------

Signed-off-by: James Xin <james.xin@improving.com>
Signed-off-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>
Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
Signed-off-by: jbrinkman <joe.brinkman@improving.com>
Co-authored-by: James Xin <james.xin@improving.com>
Co-authored-by: Alex Rehnby-Martin <alex.rehnby-martin@improving.com>
Co-authored-by: Alexey Temnikov <alexey.temnikov@improving.com>
Co-authored-by: prateek-kumar-improving <prateek.kumar@improving.com>
Co-authored-by: affonsov <67347924+affonsov@users.noreply.github.com>
Co-authored-by: Lior Sventitzky <liorsve@amazon.com>
Co-authored-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
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.

8 participants