Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into CLIENT-3246-force-sing…
Browse files Browse the repository at this point in the history
…le-node
  • Loading branch information
juliannguyen4 committed Jan 23, 2025
2 parents adfb8bb + 84d9084 commit f519710
Show file tree
Hide file tree
Showing 21 changed files with 178 additions and 197 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.1.0rc2
16.0.1
28 changes: 14 additions & 14 deletions aerospike-stubs/aerospike.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -293,22 +293,22 @@ QUERY_DURATION_LONG: Literal[0]
QUERY_DURATION_SHORT: Literal[1]
QUERY_DURATION_LONG_RELAX_AP: Literal[2]

MRT_COMMIT_OK: Literal[0]
MRT_COMMIT_ALREADY_COMMITTED: Literal[1]
MRT_COMMIT_VERIFY_FAILED: Literal[2]
MRT_COMMIT_MARK_ROLL_FORWARD_ABANDONED: Literal[3]
MRT_COMMIT_ROLL_FORWARD_ABANDONED: Literal[4]
MRT_COMMIT_CLOSE_ABANDONED: Literal[5]
COMMIT_OK: Literal[0]
COMMIT_ALREADY_COMMITTED: Literal[1]
COMMIT_VERIFY_FAILED: Literal[2]
COMMIT_MARK_ROLL_FORWARD_ABANDONED: Literal[3]
COMMIT_ROLL_FORWARD_ABANDONED: Literal[4]
COMMIT_CLOSE_ABANDONED: Literal[5]

MRT_ABORT_OK: Literal[0]
MRT_ABORT_ALREADY_ABORTED: Literal[1]
MRT_ABORT_ROLL_BACK_ABANDONED: Literal[2]
MRT_ABORT_CLOSE_ABANDONED: Literal[3]
ABORT_OK: Literal[0]
ABORT_ALREADY_ABORTED: Literal[1]
ABORT_ROLL_BACK_ABANDONED: Literal[2]
ABORT_CLOSE_ABANDONED: Literal[3]

MRT_STATE_OPEN: Literal[0]
MRT_STATE_VERIFIED: Literal[1]
MRT_STATE_COMMITTED: Literal[2]
MRT_STATE_ABORTED: Literal[3]
TXN_STATE_OPEN: Literal[0]
TXN_STATE_VERIFIED: Literal[1]
TXN_STATE_COMMITTED: Literal[2]
TXN_STATE_ABORTED: Literal[3]

@final
class CDTInfinite:
Expand Down
42 changes: 21 additions & 21 deletions aerospike_helpers/batch/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class BatchRecord:
Attributes:
key (:obj:`tuple`): The aerospike key to operate on.
record (:ref:`aerospike_record_tuple`): The record corresponding to the requested key.
result (int): The status code of the operation.
in_doubt (bool): Is it possible that the write transaction completed even though an error was generated. \
result (int): The status code of the command.
in_doubt (bool): Is it possible that the write command completed even though an error was generated. \
This may be the case when a client error occurs (like timeout) after the command was sent \
to the server.
"""
Expand All @@ -58,18 +58,18 @@ def __init__(self, key: tuple) -> None:


class Write(BatchRecord):
""" Write is used for executing Batch write operations with batch_write and retrieving batch write results.
""" Write is used for executing Batch write commands with batch_write and retrieving batch write results.
Attributes:
key (:obj:`tuple`): The aerospike key to operate on.
key (:obj:`tuple`): The aerospike key to send the command to.
record (:obj:`tuple`): The record corresponding to the requested key.
result (int): The status code of the operation.
in_doubt (bool): Is it possible that the write transaction completed even though an error was generated. \
result (int): The status code of the command.
in_doubt (bool): Is it possible that the write command completed even though an error was generated. \
This may be the case when a client error occurs (like timeout) after the command was sent \
to the server.
ops (:ref:`aerospike_operation_helpers.operations`): A list of aerospike operation dictionaries to perform
on the record at key.
meta (dict): the metadata to set for the operations in this BatchRecord
meta (dict): the metadata to set for this command
policy (:ref:`aerospike_batch_write_policies`, optional): An optional dictionary of batch write policy
flags.
"""
Expand Down Expand Up @@ -109,18 +109,18 @@ def __init__(


class Read(BatchRecord):
""" Read is used for executing Batch read operations with batch_write and retrieving results.
""" Read is used for executing Batch read commands with batch_write and retrieving results.
Attributes:
key (:obj:`tuple`): The aerospike key to operate on.
key (:obj:`tuple`): The aerospike key to send the command to.
record (:obj:`tuple`): The record corresponding to the requested key.
result (int): The status code of the operation.
in_doubt (bool): Is it possible that the write transaction completed even though an error was generated. \
result (int): The status code of the command.
in_doubt (bool): Is it possible that the write command completed even though an error was generated. \
This may be the case when a client error occurs (like timeout) after the command was sent \
to the server.
ops (:ref:`aerospike_operation_helpers.operations`): list of aerospike operation dictionaries to perform on
the record at key.
meta (dict): the metadata to set for the operations in this BatchRecord
meta (dict): the metadata to set for this command
read_all_bins (bool, optional): An optional bool, if True, read all bins in the record.
policy (:ref:`aerospike_batch_read_policies`, optional): An optional dictionary of batch read policy flags.
"""
Expand Down Expand Up @@ -165,7 +165,7 @@ def __init__(


class Apply(BatchRecord):
""" BatchApply is used for executing Batch UDF (user defined function) apply operations with batch_write and
""" BatchApply is used for executing Batch UDF (user defined function) apply commands with batch_write and
retrieving results.
Attributes:
Expand All @@ -174,8 +174,8 @@ class Apply(BatchRecord):
function (str): Name of the UDF to invoke.
args (:obj:`list`): List of arguments to pass to the UDF.
record (:ref:`aerospike_record_tuple`): The record corresponding to the requested key.
result (int): The status code of the operation.
in_doubt (bool): Is it possible that the write transaction completed even though an error was generated. \
result (int): The status code of the command.
in_doubt (bool): Is it possible that the write command completed even though an error was generated. \
This may be the case when a client error occurs (like timeout) after the command was sent \
to the server.
policy (:ref:`aerospike_batch_apply_policies`, optional): An optional dictionary of batch apply policy
Expand Down Expand Up @@ -219,13 +219,13 @@ def __init__(


class Remove(BatchRecord):
""" Remove is used for executing Batch remove operations with batch_write and retrieving results.
""" Remove is used for executing Batch remove commands with batch_write and retrieving results.
Attributes:
key (:obj:`tuple`): The aerospike key to operate on.
record (:ref:`aerospike_record_tuple`): The record corresponding to the requested key.
result (int): The status code of the operation.
in_doubt (bool): Is it possible that the write transaction completed even though an error was generated. \
result (int): The status code of the command.
in_doubt (bool): Is it possible that the write command completed even though an error was generated. \
This may be the case when a client error occurs (like timeout) after the command was sent \
to the server.
policy (:ref:`aerospike_batch_remove_policies`, optional): An optional dictionary of batch remove policy
Expand Down Expand Up @@ -261,13 +261,13 @@ class BatchRecords:
Attributes:
batch_records (list): A list of BatchRecord subtype objects used to \
define batch operations and hold results. BatchRecord Types can be Remove, Write, \
define batched commands and hold results. BatchRecord Types can be Remove, Write, \
Read, and Apply.
result (int): The status code of the last batch call that used this BatchRecords.
``0`` if all batch subtransactions succeeded (or if the only failures were \
``0`` if all batched commands succeeded (or if the only failures were \
``FILTERED_OUT`` or ``RECORD_NOT_FOUND``)
Not ``0`` if an error occurred. The most common error is ``-16`` \
(One or more batch sub transactions failed).
(One or more batched commands failed).
"""

def __init__(self, batch_records: Optional[TypeBatchRecordList] = None) -> None:
Expand Down
1 change: 0 additions & 1 deletion aerospike_helpers/expressions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class Unknown(_BaseExpr):
:class:`~aerospike.exception.OpNotApplicable`. These failures can be ignored with the policy flags
:class:`aerospike.EXP_READ_EVAL_NO_FAIL` for read expressions and
:class:`aerospike.EXP_WRITE_EVAL_NO_FAIL` for write expressions.
This would then allow subsequent operations in the transaction to proceed.
This expression is only useful from a
:class:`~aerospike_helpers.expressions.base.Cond` conditional expression within
Expand Down
2 changes: 1 addition & 1 deletion aerospike_helpers/operations/bitwise_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Helper functions to create bit operation dictionary arguments for:
* :mod:`aerospike.Client.operate` and :mod:`aerospike.Client.operate_ordered`
* Certain batch operations listed in :mod:`aerospike_helpers.batch.records`
* Certain batched commands listed in :mod:`aerospike_helpers.batch.records`
.. note:: Bitwise operations require server version >= 4.6.0
Expand Down
2 changes: 1 addition & 1 deletion aerospike_helpers/operations/expression_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
This module provides helper functions to produce dictionaries to be used with:
* :mod:`aerospike.Client.operate` and :mod:`aerospike.Client.operate_ordered`
* Certain batch operations listed in :mod:`aerospike_helpers.batch.records`
* Certain batched commands listed in :mod:`aerospike_helpers.batch.records`
Expression operations support reading and writing the result of Aerospike expressions.
Expand Down
2 changes: 1 addition & 1 deletion aerospike_helpers/operations/hll_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Helper functions to create HyperLogLog operation dictionary arguments for:
* :mod:`aerospike.Client.operate` and :mod:`aerospike.Client.operate_ordered`
* Certain batch operations listed in :mod:`aerospike_helpers.batch.records`
* Certain batched commands listed in :mod:`aerospike_helpers.batch.records`
HyperLogLog bins and operations allow for your application to form fast, reasonable approximations
of members in the union or intersection between multiple HyperLogLog bins.
Expand Down
2 changes: 1 addition & 1 deletion aerospike_helpers/operations/list_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
This module provides helper functions to produce dictionaries to be used with:
* :mod:`aerospike.Client.operate` and :mod:`aerospike.Client.operate_ordered`
* Certain batch operations listed in :mod:`aerospike_helpers.batch.records`
* Certain batched commands listed in :mod:`aerospike_helpers.batch.records`
List operations support nested CDTs through an optional ctx context argument.
The ctx argument is a list of cdt_ctx context operation objects. See :class:`aerospike_helpers.cdt_ctx`.
Expand Down
2 changes: 1 addition & 1 deletion aerospike_helpers/operations/map_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Helper functions to create map operation dictionaries arguments for:
* :mod:`aerospike.Client.operate` and :mod:`aerospike.Client.operate_ordered`
* Certain batch operations listed in :mod:`aerospike_helpers.batch.records`
* Certain batched commands listed in :mod:`aerospike_helpers.batch.records`
Map operations support nested CDTs through an optional ctx context argument.
The ctx argument is a list of cdt_ctx context operation objects. See :class:`aerospike_helpers.cdt_ctx`.
Expand Down
2 changes: 1 addition & 1 deletion aerospike_helpers/operations/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Module with helper functions to create dictionaries used by:
* :mod:`aerospike.Client.operate` and :mod:`aerospike.Client.operate_ordered`
* Certain batch operations listed in :mod:`aerospike_helpers.batch.records`
* Certain batched commands listed in :mod:`aerospike_helpers.batch.records`
"""
import warnings

Expand Down
52 changes: 26 additions & 26 deletions doc/aerospike.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Overview

The Aerospike client enables you to build an application in Python with an
Aerospike cluster as its database. The client manages the connections to the
cluster and handles the transactions performed against it.
cluster and handles the commands performed against it.

Methods
=======
Expand Down Expand Up @@ -51,7 +51,7 @@ Client
# Configure the client to first connect to a cluster node at 127.0.0.1
# The client will learn about the other nodes in the cluster from the seed node.
# Also sets a top level policy for read operations
# Also sets a top level policy for read commands
config = {
'hosts': [ ('127.0.0.1', 3000) ],
'policies': {'read': {'total_timeout': 1000}},
Expand Down Expand Up @@ -441,7 +441,7 @@ Only the `hosts` key is required; the rest of the keys are optional.
* **max_retries** (:class:`int`)
**Deprecated**: set this individually in the :ref:`aerospike_policies` dictionaries.

Representing the number of times to retry a transaction
Representing the number of times to retry a command
* **replica**
**Deprecated**: set this in one or all of the following policy dictionaries:

Expand Down Expand Up @@ -604,7 +604,7 @@ Only the `hosts` key is required; the rest of the keys are optional.
so the client does not attempt to use a socket that has already been reaped by the server.

If server's ``proto-fd-idle-ms`` is zero (no reap), then ``max_socket_idle`` should also be zero.
Connections retrieved from a pool in transactions will not be checked for ``max_socket_idle`` when ``max_socket_idle`` is zero.
Connections retrieved from a pool in commands will not be checked for ``max_socket_idle`` when ``max_socket_idle`` is zero.
Idle connections will still be trimmed down from peak connections to min connections \
(``min_conns_per_node`` and ``async_min_conns_per_node``) using a hard-coded 55 second limit in the cluster tend thread.

Expand All @@ -629,7 +629,7 @@ Only the `hosts` key is required; the rest of the keys are optional.

The counted error types are any error that causes the connection to close (socket errors and client timeouts), server device overload and server timeouts.

The application should backoff or reduce the transaction load until :exc:`~aerospike.exception.MaxErrorRateExceeded` stops being returned.
The application should backoff or reduce the command load until :exc:`~aerospike.exception.MaxErrorRateExceeded` stops being returned.

Default: ``100``
* **error_rate_window** (:class:`int`)
Expand Down Expand Up @@ -665,7 +665,7 @@ Only the `hosts` key is required; the rest of the keys are optional.

This is useful for:

- Directing read operations to run on the same rack as the client.
- Directing read commands to run on the same rack as the client.
- Lowering cloud provider costs when nodes are distributed across different availability zones (represented as racks).

In order to enable this functionality:
Expand Down Expand Up @@ -871,7 +871,7 @@ Specifies the TTL constants.
NOTE: only applies to the policies mentioned below.

Use the applicable policy ttl in write, operate, batch write, and scan policies.
If the policy is not defined for the transaction, use the default client-level policy's ttl.
If the policy is not defined for the command, use the default client-level policy's ttl.

.. _auth_mode:

Expand Down Expand Up @@ -1583,66 +1583,66 @@ Query Duration

.. _mrt_commit_status_constants:

MRT Commit Status
-----------------
Transaction Commit Status
-------------------------

.. data:: MRT_COMMIT_OK
.. data:: COMMIT_OK

Commit succeeded.

.. data:: MRT_COMMIT_ALREADY_COMMITTED
.. data:: COMMIT_ALREADY_COMMITTED

Transaction has already been committed.

.. data:: MRT_COMMIT_VERIFY_FAILED
.. data:: COMMIT_VERIFY_FAILED

Transaction verify failed. Transaction will be aborted.

.. data:: MRT_COMMIT_MARK_ROLL_FORWARD_ABANDONED
.. data:: COMMIT_MARK_ROLL_FORWARD_ABANDONED

Transaction mark roll forward abandoned. Transaction will be aborted when error is not in doubt.
If the error is in doubt (usually timeout), the commit is in doubt.

.. data:: MRT_COMMIT_ROLL_FORWARD_ABANDONED
.. data:: COMMIT_ROLL_FORWARD_ABANDONED

Client roll forward abandoned. Server will eventually commit the transaction.

.. data:: MRT_COMMIT_CLOSE_ABANDONED
.. data:: COMMIT_CLOSE_ABANDONED

Transaction has been rolled forward, but client transaction close was abandoned.
Server will eventually close the transaction.

.. _mrt_abort_status_constants:

MRT Abort Status
----------------
Transaction Abort Status
------------------------

.. data:: MRT_ABORT_OK
.. data:: ABORT_OK

Abort succeeded.

.. data:: MRT_ABORT_ALREADY_ABORTED
.. data:: ABORT_ALREADY_ABORTED

Transaction has already been aborted.

.. data:: MRT_ABORT_ROLL_BACK_ABANDONED
.. data:: ABORT_ROLL_BACK_ABANDONED

Client roll back abandoned. Server will eventually abort the transaction.

.. data:: MRT_ABORT_CLOSE_ABANDONED
.. data:: ABORT_CLOSE_ABANDONED

Transaction has been rolled back, but client transaction close was abandoned.
Server will eventually close the transaction.

.. _mrt_state:

Multi-record Transaction State
Transaction State
------------------------------

.. data:: MRT_STATE_OPEN
.. data:: TXN_STATE_OPEN

.. data:: MRT_STATE_VERIFIED
.. data:: TXN_STATE_VERIFIED

.. data:: MRT_STATE_COMMITTED
.. data:: TXN_STATE_COMMITTED

.. data:: MRT_STATE_ABORTED
.. data:: TXN_STATE_ABORTED
Loading

0 comments on commit f519710

Please sign in to comment.