Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
Signed-off-by: John Sully <[email protected]>
  • Loading branch information
JohnSully committed Jan 28, 2025
1 parent 73b4e66 commit 9ec45be
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,12 +1081,16 @@ getNodeByQuery(client *c, struct serverCommand *cmd, robj **argv, int argc, int
} else {
/* If it is not the first key/channel, make sure it is exactly
* the same key/channel as the first we saw or an allowed crossslot situation. */
int prevent_crossslot = (cmd_flags & CMD_WRITE) // eliminate issues with client->current_slot
|| pubsubshard_included // pubsub does not benefit and too many edge cases
|| c->cmd->proc == execCommand // We do not permit crossslot transactions to prevent client code which will break when cluster topology changes
// finally, if any key is migrating we cannot permit the crossslot since we don't check if the specific keys are affected
int prevent_crossslot =
(cmd_flags & CMD_WRITE) // eliminate issues with client->current_slot
|| pubsubshard_included // pubsub does not benefit and too many edge cases
|| c->cmd->proc == execCommand // We do not permit crossslot transactions to prevent client code
// which will break when cluster topology changes
// finally, if any key is migrating we cannot permit the crossslot since we don't check if the
// specific keys are affected
// this could potentially be relaxed in the future.
|| migrating_slot || importing_slot || getMigratingSlotDest(slot) != NULL || getImportingSlotSource(slot) != NULL;
|| migrating_slot || importing_slot || getMigratingSlotDest(slot) != NULL ||
getImportingSlotSource(slot) != NULL;
if (slot != thisslot && prevent_crossslot) {
/* Error: multiple keys from different slots. */
getKeysFreeResult(&result);
Expand Down

0 comments on commit 9ec45be

Please sign in to comment.