Skip to content

Commit

Permalink
Add constants
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Oct 3, 2024
1 parent d06760c commit 9e393c2
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
50 changes: 50 additions & 0 deletions doc/aerospike.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1575,3 +1575,53 @@ Query Duration

Treat query as a LONG query, but relax read consistency for AP namespaces.
This value is treated exactly like :data:`aerospike.QUERY_DURATION_LONG` for server versions < 7.1.

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

.. data:: MRT_COMMIT_OK

Commit succeeded.

.. This doesn't make sense TODO
.. data:: MRT_COMMIT_ALREADY_ATTEMPTED

Commit or abort already attempted.

.. data:: MRT_COMMIT_VERIFY_FAILED

Transaction verify failed. Transaction will be aborted.

.. data:: MRT_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

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

.. data:: MRT_COMMIT_CLOSE_ABANDONED

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

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

.. data:: MRT_ABORT_OK

Abort succeeded.

.. data:: ABORT_ALREADY_ATTEMPTED

Abort or commit already attempted.

.. data:: ABORT_ROLL_BACK_ABANDONED

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

.. data:: ABORT_CLOSE_ABANDONED

Transaction has been rolled back, but client transaction close was abandoned.
Server will eventually close the transaction.
13 changes: 13 additions & 0 deletions src/main/aerospike.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <aerospike/as_admin.h>
#include <aerospike/as_record.h>
#include <aerospike/as_exp_operations.h>
#include <aerospike/aerospike_txn.h>

PyObject *py_global_hosts;
int counter = 0xA8000000;
Expand Down Expand Up @@ -500,6 +501,18 @@ static struct module_constant_name_to_value module_constants[] = {
{"LOG_LEVEL_DEBUG", .value.integer = AS_LOG_LEVEL_DEBUG},
{"LOG_LEVEL_TRACE", .value.integer = AS_LOG_LEVEL_TRACE},

{"MRT_COMMIT_OK", .value.integer = AS_COMMIT_OK},
{"MRT_COMMIT_ALREADY_ATTEMPTED", .value.integer = AS_COMMIT_ALREADY_ATTEMPTED},
{"MRT_COMMIT_VERIFY_FAILED", .value.integer = AS_COMMIT_VERIFY_FAILED},
{"MRT_COMMIT_MARK_ROLL_FORWARD_ABANDONED", .value.integer = AS_COMMIT_MARK_ROLL_FORWARD_ABANDONED},
{"MRT_COMMIT_ROLL_FORWARD_ABANDONED", .value.integer = AS_COMMIT_ROLL_FORWARD_ABANDONED},
{"MRT_COMMIT_CLOSE_ABANDONED", .value.integer = AS_COMMIT_CLOSE_ABANDONED},

{"MRT_ABORT_OK", .value.integer = AS_ABORT_OK},
{"MRT_ABORT_ALREADY_ATTEMPTED", .value.integer = AS_ABORT_ALREADY_ATTEMPTED},
{"MRT_ABORT_ROLL_BACK_ABANDONED", .value.integer = AS_ABORT_ROLL_BACK_ABANDONED},
{"MRT_ABORT_CLOSE_ABANDONED", .value.integer = AS_ABORT_CLOSE_ABANDONED},

{"JOB_SCAN", .is_str_value = true, .value.string = "scan"},
{"JOB_QUERY", .is_str_value = true, .value.string = "query"}};

Expand Down

0 comments on commit 9e393c2

Please sign in to comment.