CUBRID Engine  latest
log_2pc.c File Reference
#include "log_2pc.h"
#include "config.h"
#include "error_manager.h"
#include "lock_manager.h"
#include "log_append.hpp"
#include "log_comm.h"
#include "log_impl.h"
#include "log_lsa.hpp"
#include "log_manager.h"
#include "memory_alloc.h"
#include "page_buffer.h"
#include "storage_common.h"
#include "system_parameter.h"
#include "tcp.h"
#include <stddef.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
#include <sys/types.h>
Include dependency graph for log_2pc.c:

Go to the source code of this file.

Classes

struct  log_2pc_global_data
 

Macros

#define CSS_ENABLE_INTERRUPTS
 

Functions

static int log_2pc_get_num_participants (int *partid_len, void **block_particps_ids)
 
static int log_2pc_make_global_tran_id (TRANID tranid)
 
static bool log_2pc_check_duplicate_global_tran_id (int gtrid)
 
static int log_2pc_commit_first_phase (THREAD_ENTRY *thread_p, LOG_TDES *tdes, LOG_2PC_EXECUTE execute_2pc_type, bool *decision)
 
static TRAN_STATE log_2pc_commit_second_phase (THREAD_ENTRY *thread_p, LOG_TDES *tdes, bool *decision)
 
static void log_2pc_append_start (THREAD_ENTRY *thread_p, LOG_TDES *tdes)
 
static void log_2pc_append_decision (THREAD_ENTRY *thread_p, LOG_TDES *tdes, LOG_RECTYPE decsion)
 
static LOG_TDESlog_2pc_find_tran_descriptor (int gtrid)
 
static int log_2pc_attach_client (THREAD_ENTRY *thread_p, LOG_TDES *tdes, LOG_TDES *client_tdes)
 
static void log_2pc_recovery_prepare (THREAD_ENTRY *thread_p, LOG_TDES *tdes, LOG_LSA *log_lsa, LOG_PAGE *log_page_p)
 
static int log_2pc_recovery_start (THREAD_ENTRY *thread_p, LOG_TDES *tdes, LOG_LSA *log_lsa, LOG_PAGE *log_page_p, int *ack_list, int *ack_count)
 
static int * log_2pc_expand_ack_list (THREAD_ENTRY *thread_p, int *ack_list, int *ack_count, int *size_ack_list)
 
static void log_2pc_recovery_recv_ack (THREAD_ENTRY *thread_p, LOG_LSA *log_lsa, LOG_PAGE *log_page_p, int *ack_list, int *ack_count)
 
static int log_2pc_recovery_analysis_record (THREAD_ENTRY *thread_p, LOG_RECTYPE record_type, LOG_TDES *tdes, LOG_LSA *log_lsa, LOG_PAGE *log_page_p, int **ack_list, int *ack_count, int *size_ack_list, bool *search_2pc_prepare, bool *search_2pc_start)
 
static void log_2pc_recovery_collecting_participant_votes (THREAD_ENTRY *thread_p, LOG_TDES *tdes)
 
static void log_2pc_recovery_abort_decision (THREAD_ENTRY *thread_p, LOG_TDES *tdes)
 
static void log_2pc_recovery_commit_decision (THREAD_ENTRY *thread_p, LOG_TDES *tdes)
 
static void log_2pc_recovery_committed_informing_participants (THREAD_ENTRY *thread_p, LOG_TDES *tdes)
 
static void log_2pc_recovery_aborted_informing_participants (THREAD_ENTRY *thread_p, LOG_TDES *tdes)
 
char * log_2pc_sprintf_particp (void *particp_id)
 
void log_2pc_dump_participants (FILE *fp, int block_length, void *block_particps_ids)
 
bool log_2pc_send_prepare (int gtrid, int num_particps, void *block_particps_ids)
 
bool log_2pc_send_commit_decision (int gtrid, int num_particps, int *particps_indices, void *block_particps_ids)
 
bool log_2pc_send_abort_decision (int gtrid, int num_particps, int *particps_indices, void *block_particps_ids, bool collect)
 
TRAN_STATE log_2pc_commit (THREAD_ENTRY *thread_p, log_tdes *tdes, LOG_2PC_EXECUTE execute_2pc_type, bool *decision)
 
int log_2pc_set_global_tran_info (THREAD_ENTRY *thread_p, int gtrid, void *info, int size)
 
int log_2pc_get_global_tran_info (THREAD_ENTRY *thread_p, int gtrid, void *buffer, int size)
 
int log_2pc_start (THREAD_ENTRY *thread_p)
 
TRAN_STATE log_2pc_prepare (THREAD_ENTRY *thread_p)
 
int log_2pc_recovery_prepared (THREAD_ENTRY *thread_p, int gtrids[], int size)
 
int log_2pc_attach_global_tran (THREAD_ENTRY *thread_p, int gtrid)
 
TRAN_STATE log_2pc_prepare_global_tran (THREAD_ENTRY *thread_p, int gtrid)
 
void log_2pc_read_prepare (THREAD_ENTRY *thread_p, int acquire_locks, log_tdes *tdes, LOG_LSA *log_lsa, LOG_PAGE *log_page_p)
 
void log_2pc_dump_gtrinfo (FILE *fp, int length, void *data)
 
void log_2pc_dump_acqobj_locks (FILE *fp, int length, void *data)
 
log_tdeslog_2pc_alloc_coord_info (log_tdes *tdes, int num_particps, int particp_id_length, void *block_particps_ids)
 
void log_2pc_free_coord_info (log_tdes *tdes)
 
void log_2pc_recovery_analysis_info (THREAD_ENTRY *thread_p, log_tdes *tdes, LOG_LSA *upto_chain_lsa)
 
void log_2pc_recovery (THREAD_ENTRY *thread_p)
 
bool log_2pc_is_tran_distributed (log_tdes *tdes)
 
bool log_2pc_clear_and_is_tran_distributed (log_tdes *tdes)
 

Variables

struct log_2pc_global_data log_2pc_Userfun = { NULL, NULL, NULL, NULL, NULL, NULL, NULL }
 

Macro Definition Documentation

#define CSS_ENABLE_INTERRUPTS

Definition at line 59 of file log_2pc.c.

Function Documentation

log_tdes* log_2pc_alloc_coord_info ( log_tdes tdes,
int  num_particps,
int  particp_id_length,
void *  block_particps_ids 
)
static void log_2pc_append_decision ( THREAD_ENTRY thread_p,
LOG_TDES tdes,
LOG_RECTYPE  decsion 
)
static
static int log_2pc_attach_client ( THREAD_ENTRY thread_p,
LOG_TDES tdes,
LOG_TDES client_tdes 
)
static
static bool log_2pc_check_duplicate_global_tran_id ( int  gtrid)
static
bool log_2pc_clear_and_is_tran_distributed ( log_tdes tdes)

Definition at line 2412 of file log_2pc.c.

References log_2pc_free_coord_info(), and log_2pc_is_tran_distributed().

Referenced by log_abort(), and log_commit().

Here is the caller graph for this function:

void log_2pc_dump_acqobj_locks ( FILE *  fp,
int  length,
void *  data 
)

Definition at line 1450 of file log_2pc.c.

References lock_dump_acquired(), lk_acquired_locks::nobj_locks, and lk_acquired_locks::obj.

Referenced by log_dump_record_2pc_prepare_commit().

Here is the caller graph for this function:

void log_2pc_dump_gtrinfo ( FILE *  fp,
int  length,
void *  data 
)

Definition at line 1435 of file log_2pc.c.

Referenced by log_dump_record_2pc_prepare_commit().

Here is the caller graph for this function:

void log_2pc_dump_participants ( FILE *  fp,
int  block_length,
void *  block_particps_ids 
)

Definition at line 184 of file log_2pc.c.

References log_2pc_global_data::dump_participants, and NULL.

Referenced by log_dump_record_2pc_start().

Here is the caller graph for this function:

static int * log_2pc_expand_ack_list ( THREAD_ENTRY thread_p,
int *  ack_list,
int *  ack_count,
int *  size_ack_list 
)
static

Definition at line 1776 of file log_2pc.c.

References ARG_FILE_LINE, logpb_fatal_error(), and NULL.

Referenced by log_2pc_recovery_analysis_record().

Here is the caller graph for this function:

static LOG_TDES * log_2pc_find_tran_descriptor ( int  gtrid)
static
void log_2pc_free_coord_info ( log_tdes tdes)
static int log_2pc_get_num_participants ( int *  partid_len,
void **  block_particps_ids 
)
static

Definition at line 120 of file log_2pc.c.

References log_2pc_global_data::get_participants, and NULL.

Referenced by log_2pc_is_tran_distributed().

Here is the caller graph for this function:

bool log_2pc_is_tran_distributed ( log_tdes tdes)
static int log_2pc_make_global_tran_id ( TRANID  tranid)
static

Definition at line 362 of file log_2pc.c.

References css_gethostid(), i, log_2pc_check_duplicate_global_tran_id(), and LOG_2PC_NULL_GTRID.

Referenced by log_2pc_commit(), log_2pc_send_abort_decision(), and log_2pc_start().

Here is the caller graph for this function:

static void log_2pc_recovery_aborted_informing_participants ( THREAD_ENTRY thread_p,
LOG_TDES tdes 
)
static
static void log_2pc_recovery_collecting_participant_votes ( THREAD_ENTRY thread_p,
LOG_TDES tdes 
)
static

Definition at line 2102 of file log_2pc.c.

References LOG_2PC_ABORT_DECISION, log_2pc_append_decision(), and log_2pc_recovery_abort_decision().

Referenced by log_2pc_recovery().

Here is the caller graph for this function:

static void log_2pc_recovery_commit_decision ( THREAD_ENTRY thread_p,
LOG_TDES tdes 
)
static
static void log_2pc_recovery_committed_informing_participants ( THREAD_ENTRY thread_p,
LOG_TDES tdes 
)
static
static void log_2pc_recovery_prepare ( THREAD_ENTRY thread_p,
LOG_TDES tdes,
LOG_LSA log_lsa,
LOG_PAGE log_page_p 
)
static

Definition at line 1641 of file log_2pc.c.

References LOG_2PC_DONT_OBTAIN_LOCKS, LOG_2PC_OBTAIN_LOCKS, log_2pc_read_prepare(), LOG_READ_ADD_ALIGN, log_tdes::state, and TRAN_UNACTIVE_2PC_PREPARE.

Referenced by log_2pc_recovery_analysis_record().

Here is the caller graph for this function:

int log_2pc_recovery_prepared ( THREAD_ENTRY thread_p,
int  gtrids[],
int  size 
)
static void log_2pc_recovery_recv_ack ( THREAD_ENTRY thread_p,
LOG_LSA log_lsa,
LOG_PAGE log_page_p,
int *  ack_list,
int *  ack_count 
)
static

Definition at line 1832 of file log_2pc.c.

References log_page::area, LOG_READ_ADD_ALIGN, LOG_READ_ADVANCE_WHEN_DOESNT_FIT, log_lsa::offset, and log_rec_2pc_particp_ack::particp_index.

Referenced by log_2pc_recovery_analysis_record().

Here is the caller graph for this function:

bool log_2pc_send_abort_decision ( int  gtrid,
int  num_particps,
int *  particps_indices,
void *  block_particps_ids,
bool  collect 
)
bool log_2pc_send_commit_decision ( int  gtrid,
int  num_particps,
int *  particps_indices,
void *  block_particps_ids 
)

Definition at line 251 of file log_2pc.c.

References NULL, and log_2pc_global_data::send_commit.

Referenced by log_2pc_commit_second_phase(), log_2pc_recovery_commit_decision(), and log_2pc_recovery_committed_informing_participants().

Here is the caller graph for this function:

bool log_2pc_send_prepare ( int  gtrid,
int  num_particps,
void *  block_particps_ids 
)

Definition at line 214 of file log_2pc.c.

References NULL, and log_2pc_global_data::send_prepare.

Referenced by log_2pc_commit_first_phase().

Here is the caller graph for this function:

char* log_2pc_sprintf_particp ( void *  particp_id)

Definition at line 162 of file log_2pc.c.

References NULL, and log_2pc_global_data::sprintf_participant.

Referenced by logtb_dump_tdes_distribute_transaction().

Here is the caller graph for this function:

Variable Documentation

struct log_2pc_global_data log_2pc_Userfun = { NULL, NULL, NULL, NULL, NULL, NULL, NULL }

Definition at line 73 of file log_2pc.c.