Skip to content

Commit 7cf4f19

Browse files
committed
fix mset docs
Signed-off-by: BoazBD <boaz@bardavid.com>
1 parent 8b53ef1 commit 7cf4f19

File tree

1 file changed

+11
-9
lines changed
  • python/python/glide/async_commands

1 file changed

+11
-9
lines changed

python/python/glide/async_commands/batch.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)