![]() |
Generic policy fields shared among all policies.
Definition at line 350 of file as_policy.h.
#include "as_policy.h"
Data Fields | |
uint32_t | max_retries |
uint32_t | sleep_between_retries |
uint32_t | socket_timeout |
uint32_t | total_timeout |
uint32_t as_policy_base::max_retries |
Maximum number of retries before aborting the current transaction. The initial attempt is not counted as a retry.
If max_retries is exceeded, the transaction will return error AEROSPIKE_ERR_TIMEOUT.
WARNING: Database writes that are not idempotent (such as "add") should not be retried because the write operation may be performed multiple times if the client timed out previous transaction attempts. It's important to use a distinct write policy for non-idempotent writes which sets max_retries = 0;
Default: 2 (initial attempt + 2 retries = 3 attempts)
Definition at line 396 of file as_policy.h.
uint32_t as_policy_base::sleep_between_retries |
Milliseconds to sleep between retries. Enter zero to skip sleep. This field is ignored in async mode.
Reads do not have to sleep when a node goes down because the cluster does not shut out reads during cluster reformation. The default for reads is zero.
Writes need to wait for the cluster to reform when a node goes down. Immediate write retries on node failure have been shown to consistently result in errors. The default for writes is 500ms.
Definition at line 410 of file as_policy.h.
uint32_t as_policy_base::socket_timeout |
Socket idle timeout in milliseconds when processing a database command.
If socket_timeout is not zero and the socket has been idle for at least socket_timeout, both max_retries and total_timeout are checked. If max_retries and total_timeout are not exceeded, the transaction is retried.
If both socket_timeout and total_timeout are non-zero and socket_timeout > total_timeout, then socket_timeout will be set to total_timeout. If socket_timeout is zero, there will be no socket idle limit.
Default: 0 (no socket idle time limit).
Definition at line 365 of file as_policy.h.
uint32_t as_policy_base::total_timeout |
Total transaction timeout in milliseconds.
The total_timeout is tracked on the client and sent to the server along with the transaction in the wire protocol. The client will most likely timeout first, but the server also has the capability to timeout the transaction.
If total_timeout is not zero and total_timeout is reached before the transaction completes, the transaction will return error AEROSPIKE_ERR_TIMEOUT. If totalTimeout is zero, there will be no total time limit.
Default: 1000
Definition at line 380 of file as_policy.h.