@@ -396,21 +396,23 @@ def mset(self: TBatch, key_value_map: Mapping[TEncodable, TEncodable]) -> TBatch
396396
397397 See [valkey.io](https://valkey.io/commands/mset/) for more details.
398398
399+ Note:
400+ In cluster mode:
401+ - If the command is used in an atomic batch (Transaction), all keys must map to the same slot.
402+ - If this command is used in a non-atomic batch (pipeline) and the keys in `key_value_map` map to different hash slots,
403+ the command will be split across these slots and executed separately for each.
404+ This means the command is atomic only at the slot level.
405+ If one or more slot-specific requests fail, the entire call will return the first encountered error, even
406+ though some requests may have succeeded while others did not.
407+ If this behavior impacts your application logic, consider splitting the
408+ request into sub-requests per slot to ensure atomicity.
409+
399410 Args:
400411 parameters (Mapping[TEncodable, TEncodable]): A map of key value pairs.
401412
402413 Command response:
403414 OK: a simple OK response.
404415
405- Note:
406- In cluster mode, if this command is used in a non-atomic batch (pipeline)
407- and the keys in `key_value_map` map to different hash slots,
408- the command will be split across these slots and executed separately for each.
409- This means the command is atomic only at the slot level.
410- If one or more slot-specific requests fail, the entire call will return the first encountered error, even
411- though some requests may have succeeded while others did not.
412- If this behavior impacts your application logic, consider splitting the
413- request into sub-requests per slot to ensure atomicity.
414416 """
415417 parameters : List [TEncodable ] = []
416418 for pair in key_value_map .items ():
0 commit comments