Skip to content

Commit 42b064a

Browse files
xuniqKseniia Antonova
authored andcommitted
draft
1 parent 63e18a9 commit 42b064a

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

doc/platform/sharding/vshard_admin.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ When such an operation is applied again, the value for the field increases by 2
563563

564564
.. note::
565565

566-
Any write requests that are intended to be executed repeatedly should be idempotent.
566+
Any write requests that are intended to be executed repeatedly (for example, retried after an error) should be idempotent.
567567
The operations' idempotency ensures that the change is applied **only once**.
568568

569569
A request may need to be run again if an error occurs on the server or client side.
@@ -588,11 +588,15 @@ In this case:
588588
Lack of such a check might lead to duplicate records or unplanned data changes.
589589

590590
For example, a client has sent a request to the server. The client is waiting for a response within a specified timeout.
591-
If the server sends a successful response after this time has elapsed, the client will receive an error.
591+
If the server sends a successful response after this time has elapsed,
592+
the client won't see this response due to a timeout, and will consider the request as failed.
592593
When re-executing this request without additional check, the operation may be applied twice.
593594

594-
A write request can be executed repeatedly without a check only if the error occurred on the server side --
595-
for example, `ER_READONLY`.
595+
A write request can be executed repeatedly without a check in two cases:
596+
- The request is idempotent.
597+
- It's known for sure that the previous request errored before executing any write operations.
598+
For example, ER_READONLY was thrown by the server.
599+
In this case, we know that the request couldn't complete due to server in read-only mode.
596600

597601
**Deduplication examples**
598602

doc/reference/reference_rock/vshard/vshard_router.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ Router public API
132132
* ``timeout`` — a request timeout, in seconds. If the ``router`` cannot identify a
133133
shard with the specified ``bucket_id``, it will retry until the timeout is reached.
134134

135+
* ``request_timeout`` — timeout in seconds
136+
135137
* other :ref:`net.box options <net_box-options>`, such as ``is_async``,
136138
``buffer``, ``on_push`` are also supported.
137139

@@ -163,12 +165,16 @@ Router public API
163165
optional attribute containing a message with the human-readable error description,
164166
and other attributes specific for the error code.
165167

168+
.. reference_vshard_note_start
169+
166170
.. note::
167171

168-
Any write requests that are intended to be executed repeatedly should be idempotent.
172+
Any write requests that are intended to be executed repeatedly (for example, retried after an error) should be idempotent.
169173
The operations' idempotency ensures that the change is applied **only once**.
170174
Read more: :ref:`<vshard-deduplication>`.
171175

176+
.. reference_vshard_note_end
177+
172178
**Examples:**
173179

174180
To call ``customer_add`` function from ``vshard/example``, say:
@@ -254,6 +260,10 @@ Router public API
254260
optional attribute containing a message with the human-readable error description,
255261
and other attributes specific for this error code.
256262

263+
.. include:: /reference/reference_rock/vshard/vshard_router.rst
264+
:start-after: reference_vshard_note_start
265+
:end-before: reference_vshard_note_end
266+
257267
.. _router_api-callre:
258268

259269
.. function:: vshard.router.callre(bucket_id, function_name, {argument_list}, {options})

0 commit comments

Comments
 (0)