- 
                Notifications
    You must be signed in to change notification settings 
- Fork 15
Readonly replica selection #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| ✅ Pull request no significant performance differences ✅ SummaryNew baseline 'pull_request' is WITHIN the 'main' baseline thresholds. Full Benchmark ComparisonComparing results between 'main' and 'pull_request'ValkeyBenchmarksClient: GET benchmark metricsMalloc (total): results within specified thresholds, fold down for details.
 
 
 Client: GET benchmark | parallel 20 | 20 concurrent connections metricsMalloc (total): results within specified thresholds, fold down for details.
 
 
 Connection: GET benchmark metricsMalloc (total): results within specified thresholds, fold down for details.
 
 
 Connection: GET benchmark – NoOpTracer metricsMalloc (total): results within specified thresholds, fold down for details.
 
 
 Connection: Pipeline array benchmark metricsMalloc (total): results within specified thresholds, fold down for details.
 
 
 Connection: Pipeline benchmark metricsMalloc (total): results within specified thresholds, fold down for details.
 
 
 HashSlot – {user}.whatever metricsMalloc (total): results within specified thresholds, fold down for details.
 
 
 ValkeyCommandEncoder – Command with 7 words metricsMalloc (total): results within specified thresholds, fold down for details.
 
 
 ValkeyCommandEncoder – Simple GET metricsMalloc (total): results within specified thresholds, fold down for details.
 
 
 ValkeyCommandEncoder – Simple MGET 15 keys metricsMalloc (total): results within specified thresholds, fold down for details.
 
 
 | 
25bf5aa    to
    d16658d      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good. Added some comments around support for reads from all nodes.
| } | ||
|  | ||
| @available(valkeySwift 1.0, *) | ||
| extension ValkeyClientConfiguration.ReadOnlyReplicaSelection { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is for replica selection, can we just call it  ValkeyClientConfiguration.ReplicaSelection ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In future we would also want to add support for other flavors of valkey such as non-cluster mode clusters such as pure client side shared clusters with 1 leader and n replicas. For such configurations the replicas take read by default. So having a generic name like ValkeyClientConfiguration.ReplicaSelection will also make sense for that flavor of Valkey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I included ReadOnly in the name because it is for readonly commands. To make it clearer I could call it ReadOnlyCommandReplicaSelection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually renamed it to ReadOnlyCommandNodeSelection as it can return the primary node as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
It's failing some documentation related checks but looks good overall.
cc7d300    to
    4d355ad      
    Compare
  
    Signed-off-by: Adam Fowler <adamfowler71@gmail.com>
Signed-off-by: Adam Fowler <adamfowler71@gmail.com>
Signed-off-by: Adam Fowler <adamfowler71@gmail.com>
Signed-off-by: Adam Fowler <adamfowler71@gmail.com>
Signed-off-by: Adam Fowler <adamfowler71@gmail.com>
- Moved nodeSelection setting into it own function getNodeSelection - Added `cycleAllNode` - Renamed `ReadOnlyReplicaSelection` to `ReadOnlyCommandNodeSelection` Signed-off-by: Adam Fowler <adamfowler71@gmail.com>
Signed-off-by: Adam Fowler <adamfowler71@gmail.com>
4d355ad    to
    3b8b882      
    Compare
  
    
readOnlyReplicaSelectionselection toValkeyClientConfigurationnodeSelectiontoValkeyClusterClient.nodeClient(for:). Before calling this work out if commands you want to run are readOnly and then combined withValkeyClientConfiguration. readOnlyReplicaSelectionwork out the nodeSelection parameter.