Skip to content

Commit

Permalink
CLIENT-3269 Rename MRT to transaction in docs, comments and error str…
Browse files Browse the repository at this point in the history
…ings.

Rename MRT to TXN in private variables.
Rename "multi-record transaction" to "transaction".
  • Loading branch information
BrianNichols committed Jan 14, 2025
1 parent 3138135 commit eaab4eb
Show file tree
Hide file tree
Showing 17 changed files with 140 additions and 140 deletions.
6 changes: 3 additions & 3 deletions examples/async_examples/async_transaction/src/main/example.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2008-2024 by Aerospike.
* Copyright 2008-2025 by Aerospike.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
Expand Down Expand Up @@ -78,15 +78,15 @@ main(int argc, char* argv[])
// Connect to the aerospike database cluster.
example_connect_to_aerospike(&as);

// Create multi-record transaction.
// Create transaction.
as_txn* txn = as_txn_create();
LOG("Initialize transaction: %" PRId64, (int64_t)txn->id);

user_data* data = malloc(sizeof(user_data));
data->event_loop = as_event_loop_get();
data->txn = txn;

// Run multi-record transaction.
// Run transaction.
run_transaction(data);

// Wait till commands have completed before shutting down.
Expand Down
26 changes: 13 additions & 13 deletions src/include/aerospike/aerospike_batch.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2024 Aerospike, Inc.
* Copyright 2008-2025 Aerospike, Inc.
*
* Portions may be licensed to Aerospike, Inc. under one or more contributor
* license agreements.
Expand Down Expand Up @@ -149,9 +149,9 @@ typedef struct as_batch_read_record_s {
* Batch key and read/write operations with write policy.
*
* All fields must be allocated on the heap (or global) when an async batch write is run under a
* multi-record transaction. The reason is multi-record transactions require an extra async call
* to add write keys to the transaction monitor record and this extra call causes stack variables
* to fall out of scope before the async batch is executed.
* transaction. The reason is transactions require an extra async call to add write keys to the
* transaction monitor record and this extra call causes stack variables to fall out of scope before
* the async batch is executed.
*
* @relates as_batch_base_record
* @ingroup batch_operations
Expand Down Expand Up @@ -180,9 +180,9 @@ typedef struct as_batch_write_record_s {
* Batch UDF (user defined function) apply.
*
* All fields must be allocated on the heap (or global) when an async batch UDF is run under a
* multi-record transaction. The reason is multi-record transactions require an extra async call
* to add write keys to the transaction monitor record and this extra call causes stack variables
* to fall out of scope before the async batch is executed.
* transaction. The reason is transactions require an extra async call to add write keys to the
* transaction monitor record and this extra call causes stack variables to fall out of scope before
* the async batch is executed.
*
* @relates as_batch_base_record
* @ingroup batch_operations
Expand Down Expand Up @@ -223,9 +223,9 @@ typedef struct as_batch_apply_record_s {
* Batch delete operation.
*
* All fields must be allocated on the heap (or global) when an async batch remove is run under a
* multi-record transaction. The reason is multi-record transactions require an extra async call
* to add write keys to the transaction monitor record and this extra call causes stack variables
* to fall out of scope before the async batch is executed.
* transaction. The reason is transactions require an extra async call to add write keys to the
* transaction monitor record and this extra call causes stack variables to fall out of scope before
* the async batch is executed.
*
* @relates as_batch_base_record
* @ingroup batch_operations
Expand Down Expand Up @@ -668,9 +668,9 @@ typedef struct {
* The returned records are located in the same list.
*
* All as_batch_record pointer fields must be allocated on the heap (or global) when an async batch
* write is run under a multi-record transaction. The reason is multi-record transactions require an
* extra async call to add write keys to the transaction monitor record and this extra call causes
* stack variables to fall out of scope before the async batch is executed.
* write is run under a transaction. The reason is transactions require an extra async call to add
* write keys to the transaction monitor record and this extra call causes stack variables to fall out
* of scope before the async batch is executed.
*
* Requires server version 6.0+
*
Expand Down
20 changes: 10 additions & 10 deletions src/include/aerospike/aerospike_txn.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern "C" {
struct as_event_loop;

/**
* Multi-record transaction commit status code.
* Transaction commit status code.
*/
typedef enum {
/**
Expand Down Expand Up @@ -83,7 +83,7 @@ typedef void (*as_commit_listener)(
);

/**
* Multi-record transaction abort status code.
* Transaction abort status code.
*/
typedef enum {
/**
Expand Down Expand Up @@ -129,15 +129,15 @@ typedef void (*as_abort_listener)(
//---------------------------------

/**
* Attempt to commit the given multi-record transaction. First, the expected record versions are
* Attempt to commit the given transaction. First, the expected record versions are
* sent to the server nodes for verification. If all nodes return success, the transaction is
* committed. Otherwise, the transaction is aborted.
*
* Requires server version 8.0+
*
* @param as Aerospike instance.
* @param err Error detail structure that is populated if an error occurs.
* @param txn Multi-record transaction.
* @param txn Transaction.
* @param commit_status Indicates success or the step in the commit process that failed.
* Pass in NULL to ignore.
*
Expand All @@ -148,13 +148,13 @@ AS_EXTERN as_status
aerospike_commit(aerospike* as, as_error* err, as_txn* txn, as_commit_status* commit_status);

/**
* Abort and rollback the given multi-record transaction.
* Abort and rollback the given transaction.
*
* Requires server version 8.0+
*
* @param as Aerospike instance.
* @param err Error detail structure that is populated if an error occurs.
* @param txn Multi-record transaction.
* @param txn Transaction.
* @param abort_status Indicates success or the step in the abort process that failed.
* Pass in NULL to ignore.
*
Expand All @@ -165,15 +165,15 @@ AS_EXTERN as_status
aerospike_abort(aerospike* as, as_error* err, as_txn* txn, as_abort_status* abort_status);

/**
* Asynchronously attempt to commit the given multi-record transaction. First, the expected record
* Asynchronously attempt to commit the given transaction. First, the expected record
* versions are sent to the server nodes for verification. If all nodes return success, the transaction
* is committed. Otherwise, the transaction is aborted.
*
* Requires server version 8.0+
*
* @param as Aerospike instance.
* @param err Error detail structure that is populated if an error occurs.
* @param txn Multi-record transaction.
* @param txn Transaction.
* @param listener User function to be called with command results.
* @param udata User data that is forwarded from asynchronous command function.
* @param event_loop Event loop that this command was executed on. Use this event loop when
Expand All @@ -190,13 +190,13 @@ aerospike_commit_async(
);

/**
* Asynchronously abort and rollback the given multi-record transaction.
* Asynchronously abort and rollback the given transaction.
*
* Requires server version 8.0+
*
* @param as Aerospike instance.
* @param err Error detail structure that is populated if an error occurs.
* @param txn Multi-record transaction.
* @param txn Transaction.
* @param listener User function to be called with command results.
* @param udata User data that is forwarded from asynchronous command function.
* @param event_loop Event loop that this command was executed on. Use this event loop when
Expand Down
4 changes: 2 additions & 2 deletions src/include/aerospike/as_async.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2024 Aerospike, Inc.
* Copyright 2008-2025 Aerospike, Inc.
*
* Portions may be licensed to Aerospike, Inc. under one or more contributor
* license agreements.
Expand Down Expand Up @@ -41,7 +41,7 @@ extern "C" {
#define AS_ASYNC_TYPE_SCAN_PARTITION 7
#define AS_ASYNC_TYPE_QUERY_PARTITION 8
#define AS_ASYNC_TYPE_CONNECTOR 9
#define AS_ASYNC_TYPE_MRT_MONITOR 10
#define AS_ASYNC_TYPE_TXN_MONITOR 10

#define AS_AUTHENTICATION_MAX_SIZE 158

Expand Down
18 changes: 9 additions & 9 deletions src/include/aerospike/as_command.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ extern "C" {
#define AS_COMMAND_FLAGS_BATCH 2
#define AS_COMMAND_FLAGS_LINEARIZE 4
#define AS_COMMAND_FLAGS_SPLIT_RETRY 8
#define AS_COMMAND_FLAGS_MRT_MONITOR 16
#define AS_COMMAND_FLAGS_TXN_MONITOR 16

// Field IDs
#define AS_FIELD_NAMESPACE 0
#define AS_FIELD_SETNAME 1
#define AS_FIELD_KEY 2
#define AS_FIELD_RECORD_VERSION 3
#define AS_FIELD_DIGEST 4
#define AS_FIELD_MRT_ID 5
#define AS_FIELD_MRT_DEADLINE 6
#define AS_FIELD_TXN_ID 5
#define AS_FIELD_TXN_DEADLINE 6
#define AS_FIELD_TASK_ID 7
#define AS_FIELD_SOCKET_TIMEOUT 9
#define AS_FIELD_RPS 10
Expand Down Expand Up @@ -111,11 +111,11 @@ extern "C" {
// 1 0 allow prole
// 1 1 allow unavailable

// MRT
#define AS_MSG_INFO4_MRT_VERIFY_READ (1 << 0) // Send MRT version to the server to be verified.
#define AS_MSG_INFO4_MRT_ROLL_FORWARD (1 << 1) // Roll forward MRT.
#define AS_MSG_INFO4_MRT_ROLL_BACK (1 << 2) // Roll back MRT.
#define AS_MSG_INFO4_MRT_ON_LOCKING_ONLY (1 << 4) // Must be able to lock record in transaction.
// Transaction
#define AS_MSG_INFO4_TXN_VERIFY_READ (1 << 0) // Send transaction version to the server to be verified.
#define AS_MSG_INFO4_TXN_ROLL_FORWARD (1 << 1) // Roll forward transaction.
#define AS_MSG_INFO4_TXN_ROLL_BACK (1 << 2) // Roll back transaction.
#define AS_MSG_INFO4_TXN_ON_LOCKING_ONLY (1 << 4) // Must be able to lock record in transaction.

// Misc
#define AS_HEADER_SIZE 30
Expand Down Expand Up @@ -786,7 +786,7 @@ as_command_write_replica(as_policy_replica replica)

/**
* @private
* Parse response with deadline field when adding keys to the MRT monitor record.
* Parse response with deadline field when adding keys to the transaction monitor record.
*/
as_status
as_command_parse_deadline(as_error* err, as_command* cmd, as_node* node, uint8_t* buf, size_t size);
Expand Down
10 changes: 5 additions & 5 deletions src/include/aerospike/as_policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ typedef struct as_policy_base_s {
struct as_exp* filter_exp;

/**
* Multi-record command identifier. If set for an async command, the source txn instance must
* Transaction identifier. If set for an async command, the source txn instance must
* be allocated on the heap using as_txn_create() or as_txn_create_capacity().
*
* Default: NULL
Expand Down Expand Up @@ -1512,13 +1512,13 @@ typedef struct as_policy_admin_s {
} as_policy_admin;

/**
* Multi-record transaction (MRT) policy fields used to batch verify record versions on commit.
* Transaction policy fields used to batch verify record versions on commit.
* Used a placeholder for now as there are no additional fields beyond as_policy_batch.
*/
typedef as_policy_batch as_policy_txn_verify;

/**
* Multi-record transaction (MRT) policy fields used to batch roll forward/backward records on
* Transaction policy fields used to batch roll forward/backward records on
* commit or abort. Used a placeholder for now as there are no additional fields beyond as_policy_batch.
*/
typedef as_policy_batch as_policy_txn_roll;
Expand Down Expand Up @@ -1603,12 +1603,12 @@ typedef struct as_policies_s {
as_policy_admin admin;

/**
* Default multi-record transaction (MRT) policy when verifying record versions in a batch.
* Default transaction policy when verifying record versions in a batch.
*/
as_policy_txn_verify txn_verify;

/**
* Default multi-record transaction (MRT) policy when rolling the transaction records forward (commit)
* Default transaction policy when rolling the transaction records forward (commit)
* or back (abort) in a batch.
*/
as_policy_txn_roll txn_roll;
Expand Down
18 changes: 9 additions & 9 deletions src/include/aerospike/as_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ typedef enum as_status_e {
//---------------------------------

/**
* Multi-record transaction commit called, but the transaction was already aborted.
* Transaction commit called, but the transaction was already aborted.
*/
AEROSPIKE_TXN_ALREADY_ABORTED = -19,

/**
* Multi-record transaction abort called, but the transaction was already committed.
* Transaction abort called, but the transaction was already committed.
*/
AEROSPIKE_TXN_ALREADY_COMMITTED = -18,

/**
* Multi-record transaction failed.
* Transaction failed.
*/
AEROSPIKE_TXN_FAILED = -17,

Expand Down Expand Up @@ -426,33 +426,33 @@ typedef enum as_status_e {
AEROSPIKE_ERR_UDF = 100,

/**
* MRT record blocked by a different transaction.
* Transaction record blocked by a different transaction.
*/
AEROSPIKE_MRT_BLOCKED = 120,

/**
* MRT read version mismatch identified during commit.
* Transaction read version mismatch identified during commit.
* Some other command changed the record outside of the transaction.
*/
AEROSPIKE_MRT_VERSION_MISMATCH = 121,

/**
* MRT deadline reached without a successful commit or abort.
* Transaction deadline reached without a successful commit or abort.
*/
AEROSPIKE_MRT_EXPIRED = 122,

/**
* MRT write command limit (4096) exceeded.
* Transaction write command limit (4096) exceeded.
*/
AEROSPIKE_MRT_TOO_MANY_WRITES = 123,

/**
* MRT was already committed.
* Transaction was already committed.
*/
AEROSPIKE_MRT_COMMITTED = 124,

/**
* MRT was already aborted.
* Transaction was already aborted.
*/
AEROSPIKE_MRT_ABORTED = 125,

Expand Down
Loading

0 comments on commit eaab4eb

Please sign in to comment.