-
Notifications
You must be signed in to change notification settings - Fork 2.6k
refactor(TODO-3803): Enhance key position retrieval with CommandInfo caching #3804
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
base: master
Are you sure you want to change the base?
Changes from all commits
4bf7efa
bdd317e
83052bb
c956039
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,7 +110,7 @@ func (c *ClusterClient) executeOnAllShards(ctx context.Context, cmd Cmder, polic | |
| // executeMultiShard handles commands that operate on multiple keys across shards | ||
| func (c *ClusterClient) executeMultiShard(ctx context.Context, cmd Cmder, policy *routing.CommandPolicy) error { | ||
| args := cmd.Args() | ||
| firstKeyPos := int(cmdFirstKeyPos(cmd)) | ||
| firstKeyPos := cmdFirstKeyPosWithInfo(cmd, c.cmdInfoPeek(cmd.Name())) | ||
| stepCount := int(cmd.stepCount()) | ||
| if stepCount == 0 { | ||
| stepCount = 1 // Default to 1 if not set | ||
|
|
@@ -179,7 +179,7 @@ func (c *ClusterClient) executeMultiSlot(ctx context.Context, cmd Cmder, slotMap | |
| // createSlotSpecificCommand creates a new command for a specific slot's keys | ||
| func (c *ClusterClient) createSlotSpecificCommand(ctx context.Context, originalCmd Cmder, keys []string) Cmder { | ||
| originalArgs := originalCmd.Args() | ||
| firstKeyPos := int(cmdFirstKeyPos(originalCmd)) | ||
| firstKeyPos := cmdFirstKeyPosWithInfo(originalCmd, c.cmdInfoPeek(originalCmd.Name())) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent firstKeyPos from independent cache-dependent computationsLow Severity
Additional Locations (2)Reviewed by Cursor Bugbot for commit c956039. Configure here. |
||
|
|
||
| // Build new args with only the specified keys | ||
| newArgs := make([]interface{}, 0, firstKeyPos+len(keys)) | ||
|
|
@@ -467,7 +467,7 @@ func (c *ClusterClient) createAggregator(policy *routing.CommandPolicy, cmd Cmde | |
| } | ||
|
|
||
| if !isKeyed { | ||
| firstKeyPos := cmdFirstKeyPos(cmd) | ||
| firstKeyPos := cmdFirstKeyPosWithInfo(cmd, c.cmdInfoPeek(cmd.Name())) | ||
| isKeyed = firstKeyPos > 0 | ||
| } | ||
|
|
||
|
|
@@ -500,7 +500,7 @@ func (c *ClusterClient) pickArbitraryNode(ctx context.Context) *clusterNode { | |
|
|
||
| // hasKeys checks if a command operates on keys | ||
| func (c *ClusterClient) hasKeys(cmd Cmder) bool { | ||
| firstKeyPos := cmdFirstKeyPos(cmd) | ||
| firstKeyPos := cmdFirstKeyPosWithInfo(cmd, c.cmdInfoPeek(cmd.Name())) | ||
| return firstKeyPos > 0 | ||
| } | ||
|
|
||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.