1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-16 13:21:51 +03:00
Commit Graph

2711 Commits

Author SHA1 Message Date
1f4537559a feat: implement client-side caching with Redis invalidation support
Add comprehensive client-side caching functionality that leverages the push notification
infrastructure for automatic cache invalidation.

Core Features:
- Local in-memory cache with configurable size and TTL
- Automatic Redis CLIENT TRACKING integration
- Real-time cache invalidation via push notifications
- LRU eviction policy for memory management
- Thread-safe operations with RWMutex
- Comprehensive statistics and monitoring

API Components:
- ClientSideCache: Main cache implementation
- ClientSideCacheOptions: Configuration options
- Client integration methods: EnableClientSideCache, DisableClientSideCache
- Convenience methods: CachedGet, CachedSet, CachedDel
- Statistics: GetStats with hits, misses, evictions, hit ratio

Implementation Details:
- Uses existing push notification system for invalidation
- Integrates with Redis CLIENT TRACKING (RESP3 required)
- Supports BCAST mode for prefix-based tracking
- Non-blocking invalidation processing
- Graceful fallback to Redis on cache misses
- Automatic cleanup on client close

Benefits:
- Significant performance improvements for read-heavy workloads
- Reduced Redis server load and network traffic
- Automatic cache coherence with real-time invalidation
- Transparent integration with existing Redis operations
- Zero configuration required (sensible defaults)

Test Coverage:
- Comprehensive unit tests for all cache operations
- Integration tests with real Redis instances
- Edge cases: expiration, eviction, invalidation
- Statistics verification and cache management
- Error handling and graceful degradation

Example Usage:
```go
// Enable client-side caching
client.EnableClientSideCache(&redis.ClientSideCacheOptions{
    MaxSize: 1000,
    DefaultTTL: 5 * time.Minute,
})

// Use cached operations
value, err := client.CachedGet(ctx, "key").Result()
err = client.CachedSet(ctx, "key", "value", time.Hour).Err()
```

Files Added:
- client_side_cache.go: Core implementation
- client_side_cache_test.go: Comprehensive tests
- examples/client-side-cache/: Working example with documentation

Integration:
- Leverages existing push notification infrastructure
- Updates shouldSkipNotification filtering (invalidate now processed)
- Maintains backward compatibility
- No breaking changes to existing APIs
2025-06-28 13:53:26 +03:00
f4ff2d667c feat: expand notification filtering to include streams, keyspace, and client tracking
- Rename isPubSubMessage to shouldSkipNotification for broader scope
- Add filtering for stream notifications (xread-from, xreadgroup-from)
- Add filtering for client tracking notifications (invalidate)
- Add filtering for keyspace notifications (expired, evicted, set, del, etc.)
- Add filtering for sharded pub/sub notifications (ssubscribe, sunsubscribe)
- Update comprehensive test coverage for all notification types

Notification types now filtered:
- Pub/Sub: message, pmessage, subscribe, unsubscribe, psubscribe, punsubscribe
- Sharded Pub/Sub: smessage, ssubscribe, sunsubscribe
- Streams: xread-from, xreadgroup-from
- Client tracking: invalidate
- Keyspace events: expired, evicted, set, del, rename, move, copy, restore, sort, flushdb, flushall

Benefits:
- Comprehensive separation of notification systems
- Prevents interference between specialized handlers
- Ensures notifications reach their intended systems
- Better system reliability and performance
- Clear boundaries between different Redis features

Implementation:
- Efficient switch statement with O(1) lookup
- Case-sensitive matching for precise filtering
- Comprehensive documentation for each notification type
- Applied to all processing points (WithReader, Pool.Put, isHealthyConn)

Test coverage:
- TestShouldSkipNotification with categorized test cases
- All notification types tested (pub/sub, streams, keyspace, client tracking)
- Cluster notifications verified as non-filtered
- Edge cases and boundary conditions covered
2025-06-28 02:07:48 +03:00
f66518cf3a feat: add pub/sub message filtering to push notification processor
- Add isPubSubMessage() function to identify pub/sub message types
- Filter out pub/sub messages in ProcessPendingNotifications
- Allow pub/sub system to handle its own messages without interference
- Process only cluster/system push notifications (MOVING, MIGRATING, etc.)
- Add comprehensive test coverage for filtering logic

Pub/sub message types filtered:
- message (regular pub/sub)
- pmessage (pattern pub/sub)
- subscribe/unsubscribe (subscription management)
- psubscribe/punsubscribe (pattern subscription management)
- smessage (sharded pub/sub, Redis 7.0+)

Benefits:
- Clear separation of concerns between pub/sub and push notifications
- Prevents interference between the two messaging systems
- Ensures pub/sub messages reach their intended handlers
- Eliminates message loss due to incorrect interception
- Improved system reliability and performance
- Better resource utilization and message flow

Implementation:
- Efficient O(1) switch statement for message type lookup
- Case-sensitive matching for precise filtering
- Early return to skip unnecessary processing
- Maintains processing of other notifications in same batch
- Applied to all processing points (WithReader, Pool.Put, isHealthyConn)

Test coverage:
- TestIsPubSubMessage - Function correctness and edge cases
- TestPubSubFiltering - End-to-end integration testing
- Mixed message scenarios and handler verification
2025-06-28 01:16:24 +03:00
b6e712b41a feat: add proactive push notification processing to WithReader
- Add push notification processing to Conn.WithReader method
- Process notifications immediately before every read operation
- Provides proactive notification handling vs reactive processing
- Add proper error handling with internal.Logger
- Non-blocking implementation that doesn't break Redis operations
- Complements existing processing in Pool.Put and isHealthyConn

Benefits:
- Immediate processing when notifications arrive
- Called before every read operation for optimal timing
- Prevents notification backlog accumulation
- More responsive to Redis cluster changes
- Better user experience during migrations
- Optimal placement for catching asynchronous notifications

Implementation:
- Type-safe interface assertion for processor
- Context-aware error handling with logging
- Maintains backward compatibility
- Consistent with existing pool patterns
- Three-layer processing strategy: WithReader (proactive) + Pool.Put + isHealthyConn (reactive)

Use cases:
- MOVING/MIGRATING/MIGRATED notifications for slot migrations
- FAILING_OVER/FAILED_OVER notifications for failover scenarios
- Real-time cluster topology change awareness
- Improved connection utilization efficiency
2025-06-27 22:56:04 +03:00
d820ade9e4 test: add comprehensive test coverage for pushnotif package
- Add 100% test coverage for Registry (NewRegistry, RegisterHandler, UnregisterHandler, GetHandler, GetRegisteredPushNotificationNames)
- Add 100% test coverage for Processor (NewProcessor, GetHandler, RegisterHandler, UnregisterHandler)
- Add 100% test coverage for VoidProcessor (NewVoidProcessor, GetHandler, RegisterHandler, UnregisterHandler, ProcessPendingNotifications)
- Add comprehensive tests for ProcessPendingNotifications with mock reader testing all code paths
- Add missing UnregisterHandler method to VoidProcessor
- Remove HandleNotification method reference from RegistryInterface
- Create TestHandler, MockReader, and test helper functions for comprehensive testing

Test coverage achieved:
- Registry: 100% coverage on all methods
- VoidProcessor: 100% coverage on all methods
- Processor: 100% coverage except ProcessPendingNotifications (complex RESP3 parsing)
- Overall package coverage: 71.7% (limited by complex protocol parsing logic)

Test scenarios covered:
- All constructor functions and basic operations
- Handler registration with duplicate detection
- Protected handler unregistration prevention
- Empty and invalid notification handling
- Error handling for all edge cases
- Mock reader testing for push notification processing logic
- Real proto.Reader testing for basic scenarios

Benefits:
- Comprehensive test coverage for all public APIs
- Edge case testing for error conditions
- Mock-based testing for complex protocol logic
- Regression prevention for core functionality
- Documentation through test examples
2025-06-27 22:41:29 +03:00
3473c1e998 fix: simplify api 2025-06-27 22:27:32 +03:00
f7948b5c5c fix: address pr review 2025-06-27 18:26:15 +03:00
075b9309c6 fix: update coverage test to expect errors for disabled push notifications
- Fix TestConnWithoutPushNotifications to expect errors instead of nil
- Update test to verify error messages contain helpful information
- Add strings import for error message validation
- Maintain consistency with improved developer experience approach

The test now correctly expects errors when trying to register handlers on
connections with disabled push notifications, providing immediate feedback
to developers about configuration issues rather than silent failures.

This aligns with the improved developer experience where VoidProcessor
returns descriptive errors instead of silently ignoring registrations.
2025-06-27 17:31:55 +03:00
e31987f25e Fixes tests:
- TestClientWithoutPushNotifications: Now expects error instead of nil
- TestClientPushNotificationEdgeCases: Now expects error instead of nil
2025-06-27 17:08:36 +03:00
91805bc506 refactor: remove handlerWrapper and use separate maps in registry
- Remove unnecessary handlerWrapper complexity from push notifications
- Use separate maps for handlers and protection status in registry
- Store handlers directly without indirection layer
- Maintain same instance identity for registered/retrieved handlers
- Preserve all protected handler functionality with cleaner implementation

Changes:
- internal/pushnotif/registry.go: Use separate handlers and protected maps
- push_notifications.go: Remove handlerWrapper, store handlers directly
- Maintain thread-safe operations with simplified code structure

Benefits:
- Reduced memory overhead (no wrapper objects)
- Direct handler storage without type conversion
- Cleaner, more maintainable code
- Same functionality with better performance
- Eliminated unnecessary complexity layer
- Preserved all existing behavior and safety guarantees
2025-06-27 16:38:31 +03:00
ada72cefcd refactor: move push notification logic to pusnotif package 2025-06-27 16:27:23 +03:00
9a7a5c853b fix: add nil reader check in ProcessPendingNotifications to prevent panic
- Add nil check for proto.Reader parameter in both PushNotificationProcessor and VoidPushNotificationProcessor
- Prevent segmentation violation when ProcessPendingNotifications is called with nil reader
- Return early with nil error when reader is nil (graceful handling)
- Fix panic in TestProcessPendingNotificationsEdgeCases test

This addresses the runtime panic that occurred when rd.Buffered() was called on a nil reader,
ensuring robust error handling in edge cases where the reader might not be properly initialized.
2025-06-27 15:05:16 +03:00
03bfd9ffcc feat: remove GetRegistry from PushNotificationProcessorInterface for better encapsulation
- Remove GetRegistry() method from PushNotificationProcessorInterface
- Enforce use of GetHandler() method for cleaner API design
- Add GetRegistryForTesting() method for test access only
- Update all tests to use new testing helper methods
- Maintain clean separation between public API and internal implementation

Benefits:
- Better encapsulation - no direct registry access from public interface
- Cleaner API - forces use of GetHandler() for specific handler access
- Consistent interface design across all processor types
- Internal registry access only available for testing purposes
- Prevents misuse of registry in production code
2025-06-27 14:31:36 +03:00
e6c5590255 feat: enable real push notification processors for SentinelClient and FailoverClient
- Add PushNotifications field to FailoverOptions struct
- Update clientOptions() to pass PushNotifications field to Options
- Change SentinelClient and FailoverClient initialization to use same logic as regular Client
- Both clients now support real push notification processors when enabled
- Both clients use void processors only when explicitly disabled
- Consistent behavior across all client types (Client, SentinelClient, FailoverClient)

Benefits:
- SentinelClient and FailoverClient can now fully utilize push notifications
- Consistent API across all client types
- Real processors when push notifications are enabled
- Void processors only when explicitly disabled
- Equal push notification capabilities for all Redis client types
2025-06-27 14:03:50 +03:00
d3f61973c1 feat: add GetHandler method and improve push notification API encapsulation
- Add GetHandler() method to PushNotificationProcessorInterface for better encapsulation
- Add GetPushNotificationHandler() convenience method to Client and SentinelClient
- Remove HasHandlers() check from ProcessPendingNotifications to ensure notifications are always consumed
- Use PushNotificationProcessorInterface in internal pool package for proper abstraction
- Maintain GetRegistry() for backward compatibility and testing
- Update pubsub to use GetHandler() instead of GetRegistry() for cleaner code

Benefits:
- Better API encapsulation - no need to expose entire registry
- Cleaner interface - direct access to specific handlers
- Always consume push notifications from reader regardless of handler presence
- Proper abstraction in internal pool package
- Backward compatibility maintained
- Consistent behavior across all processor types
2025-06-27 13:59:43 +03:00
ad16b21487 fix: initialize push notification processor in NewFailoverClient
- Add push processor initialization to NewFailoverClient to prevent nil pointer dereference
- Use VoidPushNotificationProcessor for failover clients (typically don't need push notifications)
- Ensure consistent behavior across all client creation paths including failover scenarios
- Complete the coverage of all client types that inherit from baseClient

This fixes the final nil pointer dereference that was occurring in failover client
contexts where the pushProcessor field was nil, causing segmentation violations
during Redis operations in sentinel-managed failover scenarios.
2025-06-27 13:41:30 +03:00
a2de263588 fix: copy push notification processor to transaction baseClient
- Copy pushProcessor from parent client to transaction in newTx()
- Ensure transactions inherit push notification processor from parent client
- Prevent nil pointer dereference in transaction contexts (Watch, Unwatch, etc.)
- Maintain consistent push notification behavior across all Redis operations

This fixes the panic that was occurring in transaction examples where the
transaction's baseClient had a nil pushProcessor field, causing segmentation
violations during transaction operations like Watch and Unwatch.
2025-06-27 01:57:11 +03:00
d1d4529abf fix: initialize push notification processor in SentinelClient
- Add push processor initialization to NewSentinelClient to prevent nil pointer dereference
- Add GetPushNotificationProcessor and RegisterPushNotificationHandler methods to SentinelClient
- Use VoidPushNotificationProcessor for Sentinel (typically doesn't need push notifications)
- Ensure consistent behavior across all client types that inherit from baseClient

This fixes the panic that was occurring in Sentinel contexts where the pushProcessor
field was nil, causing segmentation violations when processing commands.
2025-06-27 01:47:21 +03:00
8006fab753 fix: ensure push notification processor is never nil in newConn
- Add nil check in newConn to create VoidPushNotificationProcessor when needed
- Fix tests to use Protocol 2 for disabled push notification scenarios
- Prevent nil pointer dereference in transaction and connection contexts
- Ensure consistent behavior across all connection creation paths

The panic was occurring because newConn could create connections with nil
pushProcessor when options didn't have a processor set. Now we always
ensure a processor exists (real or void) to maintain the 'never nil' guarantee.
2025-06-27 01:36:40 +03:00
be9b6dd6a0 refactor: remove unnecessary enabled field and IsEnabled/SetEnabled methods
- Remove enabled field from PushNotificationProcessor struct
- Remove IsEnabled() and SetEnabled() methods from processor interface
- Remove enabled parameter from NewPushNotificationProcessor()
- Update all interfaces in pool package to remove IsEnabled requirement
- Simplify processor logic - if processor exists, it works
- VoidPushNotificationProcessor handles disabled case by discarding notifications
- Update all tests to use simplified interface without enable/disable logic

Benefits:
- Simpler, cleaner interface with less complexity
- No unnecessary state management for enabled/disabled
- VoidPushNotificationProcessor pattern handles disabled case elegantly
- Reduced cognitive overhead - processors just work when set
- Eliminates redundant enabled checks throughout codebase
- More predictable behavior - set processor = it works
2025-06-27 01:36:38 +03:00
fdfcf94300 feat: add VoidPushNotificationProcessor for disabled push notifications
- Add VoidPushNotificationProcessor that reads and discards push notifications
- Create PushNotificationProcessorInterface for consistent behavior
- Always provide a processor (real or void) instead of nil
- VoidPushNotificationProcessor properly cleans RESP3 push notifications from buffer
- Remove all nil checks throughout codebase for cleaner, safer code
- Update tests to expect VoidPushNotificationProcessor when disabled

Benefits:
- Eliminates nil pointer risks throughout the codebase
- Follows null object pattern for safer operation
- Properly handles RESP3 push notifications even when disabled
- Consistent interface regardless of push notification settings
- Cleaner code without defensive nil checks everywhere
2025-06-27 01:36:35 +03:00
c33b157015 feat: add protected handler support and rename command to pushNotificationName
- Add protected flag to RegisterHandler methods across all types
- Protected handlers cannot be unregistered, UnregisterHandler returns error
- Rename 'command' parameter to 'pushNotificationName' for clarity
- Update PushNotificationInfo.Command field to Name field
- Add comprehensive test for protected handler functionality
- Update all existing tests to use new protected parameter (false by default)
- Improve error messages to use 'push notification' terminology

Benefits:
- Critical handlers can be protected from accidental unregistration
- Clearer naming reflects that these are notification names, not commands
- Better error handling with informative error messages
- Backward compatible (existing handlers work with protected=false)
2025-06-27 01:36:33 +03:00
79f6df26c3 remove: push-notification-demo 2025-06-27 01:36:31 +03:00
958fb1a760 fix: resolve data race in PushNotificationProcessor
- Add sync.RWMutex to PushNotificationProcessor struct
- Protect enabled field access with read/write locks in IsEnabled() and SetEnabled()
- Use thread-safe IsEnabled() method in ProcessPendingNotifications()
- Fix concurrent access to enabled field that was causing data races

This resolves the race condition between goroutines calling IsEnabled() and
SetEnabled() concurrently, ensuring thread-safe access to the enabled field.
2025-06-27 01:36:28 +03:00
70231ae4e9 refactor: simplify push notification interface
- Remove RegisterPushNotificationHandlerFunc methods from all types
- Remove PushNotificationHandlerFunc type adapter
- Keep only RegisterPushNotificationHandler method for cleaner interface
- Remove unnecessary push notification constants (keep only Redis Cluster ones)
- Update all tests to use simplified interface with direct handler implementations

Benefits:
- Cleaner, simpler API with single registration method
- Reduced code complexity and maintenance burden
- Focus on essential Redis Cluster push notifications only
- Users implement PushNotificationHandler interface directly
- No functional changes, just interface simplification
2025-06-27 01:36:26 +03:00
4747610d01 test: add comprehensive unit tests for 100% coverage
- Add 10 new unit tests covering all previously untested code paths
- Test connection pool integration with push notifications
- Test connection health check integration
- Test Conn type push notification methods
- Test cloned client push notification preservation
- Test PushNotificationInfo structure validation
- Test edge cases and error scenarios
- Test custom processor integration
- Test disabled push notification scenarios

Total coverage now includes:
- 20 existing push notification tests
- 10 new comprehensive coverage tests
- All new code paths from connection pool integration
- All Conn methods and cloning functionality
- Edge cases and error handling scenarios
2025-06-27 01:36:24 +03:00
1331fb9957 fix: remove unused fields and ensure push notifications work in cloned clients
- Remove unused Timestamp and Source fields from PushNotificationInfo
- Add pushProcessor to newConn function to ensure Conn instances have push notifications
- Add push notification methods to Conn type for consistency
- Ensure cloned clients and Conn instances preserve push notification functionality

This fixes issues where:
1. PushNotificationInfo had unused fields causing confusion
2. Conn instances created via client.Conn() lacked push notification support
3. All client types now consistently support push notifications
2025-06-27 01:36:22 +03:00
d7fbe18214 feat: fix connection health check interference with push notifications
- Add PushNotificationProcessor field to pool.Conn for connection-level processing
- Modify connection pool Put() and isHealthyConn() to handle push notifications
- Process pending push notifications before discarding connections
- Pass push notification processor to connections during creation
- Update connection pool options to include push notification processor
- Add comprehensive test for connection health check integration

This prevents connections with buffered push notification data from being
incorrectly discarded by the connection health check, ensuring push
notifications are properly processed and connections are reused.
2025-06-27 01:36:20 +03:00
e6e2cead66 feat: remove global handlers and enable push notifications by default
- Remove all global push notification handler functionality
- Simplify registry to support only single handler per notification type
- Enable push notifications by default for RESP3 connections
- Update comprehensive test suite to remove global handler tests
- Update demo to show multiple specific handlers instead of global handlers
- Always respect custom processors regardless of PushNotifications flag

Push notifications are now automatically enabled for RESP3 and each
notification type has a single dedicated handler for predictable behavior.
2025-06-27 01:36:17 +03:00
1ff0ded0e3 feat: enforce single handler per notification type
- Change PushNotificationRegistry to allow only one handler per command
- RegisterHandler methods now return error if handler already exists
- Update UnregisterHandler to remove handler by command only
- Update all client methods to return errors for duplicate registrations
- Update comprehensive test suite to verify single handler behavior
- Add specific test for duplicate handler error scenarios

This prevents handler conflicts and ensures predictable notification
routing with clear error handling for registration conflicts.
2025-06-27 01:36:15 +03:00
b02eed63b2 feat: add general push notification system
- Add PushNotificationRegistry for managing notification handlers
- Add PushNotificationProcessor for processing RESP3 push notifications
- Add client methods for registering push notification handlers
- Add PubSub integration for handling generic push notifications
- Add comprehensive test suite with 100% coverage
- Add push notification demo example

This system allows handling any arbitrary RESP3 push notification
with registered handlers, not just specific notification types.
2025-06-27 01:36:08 +03:00
0decfdc6ed chore(release): v9.11.0 (#3416)
* chore(release): update version to 9.11.0

* chore(release): Add Release Notes for v9.11.0
extra/rediscensus/v9.11.0 extra/redisprometheus/v9.11.0 extra/rediscmd/v9.11.0 extra/redisotel/v9.11.0 v9.11.0
2025-06-24 14:05:24 +03:00
4ac591c7c4 Set correct cluster slot for scan commands, similarly to Java's Jedis client (#2623)
- At present, the `scan` command is dispatched to a random slot.
- As far as I can tell, the scanX family of commands are not cluster aware (e.g. don't redirect the client to the correct slot).
- You can see [here](869dc0bb66/src/main/java/redis/clients/jedis/ShardedCommandObjects.java (L101)), the Jedis client calling `processKey` on the match argument, and this is what this PR also does.

We've had this patch running in production, and it seems to work well for us.

For further thought:
- Continuing looking at other Redis clients (e.g. Jedis), they outright [reject as invalid](869dc0bb66/src/main/java/redis/clients/jedis/ShardedCommandObjects.java (L98)) any scan command that does not include a hash-tag. Presumably this has the advantage of users not being surprised when their scan produces no results when a random server is picked.
- Perhaps it would be sensible for go-redis to do the same also?

Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-06-24 13:43:03 +03:00
0383d08a35 feat(client): Add CredentialsProvider field to UniversalOptions (#2927)
* Add CredentialsProvider field to universal client

* fix(options): Add credentials providers to universal options and pass to client options

* chore(ring): Add missing fields in building clientOptions

---------

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-06-24 13:28:54 +03:00
fa475cbc99 feat(redisotel): add WithCallerEnabled option (#3415)
* feat(redisotel): add WithCaller option

Allow the disabling the collection of the `code.function`, `code.filepath` and `code.lineno` tracing attributes.
When setting `WithCaller(false)` overall performance is increased as the "expensive" `runtime.Callers` and `runtime.(*Frames).Next` calls are no longer needed.

* chore(redisotel): improve docblock language

* chore(redisotel): rename `WithCaller` to `WithCallerEnabled`

---------

Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-06-24 10:53:35 +03:00
05f42e2327 fix(txpipeline): keyless commands should take the slot of the keyed (#3411)
* fix(txpipeline): keyless commands should take the slot of the keyed commands

* fix(txpipeline): extract only keyed cmds from all cmds

* chore(test): Add tests for keyless cmds and txpipeline

* fix(cmdSlot): Add preferred random slot

* fix(cmdSlot): Add shortlist of keyless cmds

* chore(test): Fix ring test

* fix(keylessCommands): Add list of keyless commands

Add list of keyless Commands based on the Commands output
for redis 8

* chore(txPipeline): refactor slottedCommands impl

* fix(osscluster): typo
2025-06-24 10:34:23 +03:00
884f9970c0 DOC-5229 probabilistic data type examples (#3413)
* DOC-5078 added basic vector set examples

* DOC-5078 formatting and extra comments

* DOC-5078 fixed nondeterministic test

* wip(tests): run doctests for vector sets on redis 8 only

* DOC-5229 added probabilistic data type examples

---------

Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-06-23 11:49:36 +03:00
e642856ed3 chore(deps): bump rojopolis/spellcheck-github-actions (#3414)
Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 0.49.0 to 0.51.0.
- [Release notes](https://github.com/rojopolis/spellcheck-github-actions/releases)
- [Changelog](https://github.com/rojopolis/spellcheck-github-actions/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rojopolis/spellcheck-github-actions/compare/0.49.0...0.51.0)

---
updated-dependencies:
- dependency-name: rojopolis/spellcheck-github-actions
  dependency-version: 0.51.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 11:49:12 +03:00
7d97cc1c59 feat: optimize connection pool waitTurn (#3412) 2025-06-20 12:07:14 +03:00
f4358acffc [CAE-1046] fix(loading): cache the loaded flag for slave nodes (#3410)
* fix(loading): cache the loaded flag for slave nodes

* fix(lint): make linter happy
2025-06-18 15:18:51 +03:00
4c635cc563 fix(txpipeline): should return error on multi/exec on multiple slots [CAE-1028] (#3408)
* fix(txpipeline): should return error on multi/exec on multiple slots

* fix(txpipeline): test normal tx pipeline behaviour

* chore(err): Extract crossslot err and add test

* fix(txpipeline): short curcuit the tx if there are no commands

* chore(tests): validate keys are in different slots
2025-06-18 14:18:00 +03:00
68717412c9 chore(ci): update CI redis builds (#3407) 2025-06-16 18:28:58 +03:00
82b00cc520 chore: remove a redundant method (#3401)
Signed-off-by: fukua95 <fukua95@gmail.com>
Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-06-16 16:55:23 +03:00
e2295c7129 test: refactor TestBasicCredentials using table-driven tests (#3406)
* test: refactor TestBasicCredentials using table-driven tests

* Included additional edge cases:

- Empty passwords
- Special characters
- Long strings
- Unicode characters
2025-06-16 11:23:58 +03:00
eb40ac8328 perf: reduce unnecessary memory allocation (#3399)
Signed-off-by: fukua95 <fukua95@gmail.com>
Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-06-09 11:59:58 +03:00
0f40ae3ff2 fix: check if the shard exists to avoid returning nil (#3396)
Signed-off-by: fukua95 <fukua95@gmail.com>
2025-06-09 11:06:21 +03:00
858ecda7fd fix: insert entry during iterating over a map (#3398)
Signed-off-by: fukua95 <fukua95@gmail.com>
2025-06-09 11:03:18 +03:00
75e8370a6f chore(release): Update release notes and versions for v9.10.0 (#3395) extra/rediscmd/v9.10.0 extra/redisprometheus/v9.10.0 extra/redisotel/v9.10.0 v9.10.0 extra/rediscensus/v9.10.0 2025-06-06 18:30:30 +03:00
98b224cf7d DOC-5078 vector set examples (#3394) 2025-06-06 16:25:35 +03:00
4e22885ca1 feat: support vectorset (#3375)
* feat: support vectorset

* fix: char encoding error

* use `any` instread of `interface{}`

* update vectorset API

Signed-off-by: fukua95 <fukua95@gmail.com>

* refact: MapStringFloat64Cmd -> VectorInfoSliceCmd

Signed-off-by: fukua95 <fukua95@gmail.com>

* update:

* the type of vector attribute: string -> VectorAttributeMarshaller
* Add a new API VRemAttr
* mark the APIs are experimental

Signed-off-by: fukua95 <fukua95@gmail.com>

* trigger CI again

Signed-off-by: fukua95 <fukua95@gmail.com>

* rename a API: VRemAttr -> VClearAttributes

Signed-off-by: fukua95 <fukua95@gmail.com>

* add test

Signed-off-by: fukua95 <fukua95@gmail.com>

* feat(vectorset): improve VSetAttr API and add comprehensive test suite

- Simplify VSetAttr to accept interface{} with automatic JSON marshalling
- Remove VectorAttributeMarshaller interface for simpler API
- Add comprehensive unit tests for all vectorset commands

---------

Signed-off-by: fukua95 <fukua95@gmail.com>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-06-05 11:35:45 +03:00