MySQL 9.1.0
Source Code Documentation
xcom_cache.cc File Reference
#include "xcom/xcom_cache.h"
#include <assert.h>
#include <rpc/rpc.h>
#include <stdlib.h>
#include "xcom/app_data.h"
#include "xcom/bitset.h"
#include "xcom/node_no.h"
#include "xcom/pax_msg.h"
#include "xcom/server_struct.h"
#include "xcom/simset.h"
#include "xcom/site_def.h"
#include "xcom/site_struct.h"
#include "xcom/synode_no.h"
#include "xcom/task.h"
#include "xcom/task_debug.h"
#include "xcom/xcom_base.h"
#include "xcom/xcom_cfg.h"
#include "xcom/xcom_common.h"
#include "xcom/xcom_detector.h"
#include "xcom/xcom_memory.h"
#include "xcom/xcom_profile.h"
#include "xcom/xcom_transport.h"
#include "xcom/xcom_vp_str.h"
#include "xdr_gen/xcom_vp.h"

Classes

struct  lru_machine
 
struct  stack_machine
 

Macros

#define DBG_CACHE_SIZE   0
 
#define MIN_CACHED   10
 
#define BUCKETS   length_increment
 

Functions

synode_no cache_get_last_removed ()
 
int was_removed_from_cache (synode_no x)
 
static void hash_init (stack_machine *hash_bucket)
 
void hexdump (void *p, long length)
 
static unsigned int synode_hash (synode_no synode)
 
static void do_increment_step ()
 
static pax_machinehash_in (pax_machine *pm)
 
static pax_machinehash_out (pax_machine *p)
 
pax_machinehash_get (synode_no synode)
 
static int was_machine_executed (pax_machine *p)
 
static lru_machinelru_get (bool_t force)
 
static lru_machinelru_touch_hit (pax_machine *p)
 
static void reset_cache ()
 
static void add_stack_machine (uint64_t start_msgno)
 
static void expand_lru ()
 
void init_cache ()
 
static void deinit_pax_machine (pax_machine *p, lru_machine *l)
 
static void free_lru_machine (lru_machine *link_iter)
 
void deinit_cache ()
 
pax_machineget_cache_no_touch (synode_no synode, bool_t force)
 
pax_machineforce_get_cache (synode_no synode)
 
pax_machineget_cache (synode_no synode)
 
static int can_deallocate (lru_machine *link_iter)
 
size_t shrink_cache ()
 
void xcom_cache_var_init ()
 
pax_machineinit_pax_machine (pax_machine *p, lru_machine *lru, synode_no synode)
 
int lock_pax_machine (pax_machine *p)
 
void unlock_pax_machine (pax_machine *p)
 
int is_busy_machine (pax_machine *p)
 
char * dbg_machine_nodeset (pax_machine *p, u_int nodes)
 
static size_t get_app_msg_size (pax_msg const *p)
 
size_t pax_machine_size (pax_machine const *p)
 
void init_cache_size ()
 
uint64_t add_cache_size (pax_machine *p)
 
uint64_t sub_cache_size (pax_machine *p)
 
int above_cache_limit ()
 
uint64_t set_max_cache_size (uint64_t x)
 
static void do_decrement_step ()
 
uint16_t check_decrease ()
 
void do_cache_maintenance ()
 
int cache_manager_task (task_arg arg)
 
uint64_t get_xcom_cache_occupation ()
 
uint64_t get_xcom_cache_length ()
 
uint64_t get_xcom_cache_size ()
 
void set_length_increment (size_t increment)
 
void set_size_decrement (size_t decrement)
 
void set_min_target_occupation (float threshold)
 
void set_dec_threshold_size (float t_hold)
 
void set_min_length_threshold (float threshold)
 
void paxos_timeout (pax_machine *p)
 

Variables

static synode_no last_removed_cache
 
static size_t length_increment = INCREMENT
 
static size_t size_decrement = INCREMENT / 10
 
static linkage hash_stack
 
static linkage protected_lru
 
static linkage probation_lru
 
static uint64_t highest_msgno = 0
 
static uint64_t cache_length = 0
 
static uint64_t occupation = 0
 
static uint64_t cache_size = 0
 
static uint64_t dec_threshold_length = DEC_THRESHOLD_LENGTH
 
static float min_target_occupation = MIN_TARGET_OCCUPATION
 
static float dec_threshold_size = DEC_THRESHOLD_SIZE
 
static float min_length_threshold = MIN_LENGTH_THRESHOLD
 
int xcom_shutdown
 

Macro Definition Documentation

◆ BUCKETS

#define BUCKETS   length_increment

◆ DBG_CACHE_SIZE

#define DBG_CACHE_SIZE   0

◆ MIN_CACHED

#define MIN_CACHED   10

Function Documentation

◆ above_cache_limit()

int above_cache_limit ( )

◆ add_cache_size()

uint64_t add_cache_size ( pax_machine p)

◆ add_stack_machine()

static void add_stack_machine ( uint64_t  start_msgno)
static

◆ cache_get_last_removed()

synode_no cache_get_last_removed ( )

◆ cache_manager_task()

int cache_manager_task ( task_arg  arg)

◆ can_deallocate()

static int can_deallocate ( lru_machine link_iter)
inlinestatic

◆ check_decrease()

uint16_t check_decrease ( )

◆ dbg_machine_nodeset()

char * dbg_machine_nodeset ( pax_machine p,
u_int  nodes 
)

◆ deinit_cache()

void deinit_cache ( )

◆ deinit_pax_machine()

static void deinit_pax_machine ( pax_machine p,
lru_machine l 
)
static

◆ do_cache_maintenance()

void do_cache_maintenance ( )

◆ do_decrement_step()

static void do_decrement_step ( )
static

◆ do_increment_step()

static void do_increment_step ( )
static

◆ expand_lru()

static void expand_lru ( )
static

◆ force_get_cache()

pax_machine * force_get_cache ( synode_no  synode)

◆ free_lru_machine()

static void free_lru_machine ( lru_machine link_iter)
static

◆ get_app_msg_size()

static size_t get_app_msg_size ( pax_msg const *  p)
inlinestatic

◆ get_cache()

pax_machine * get_cache ( synode_no  synode)

◆ get_cache_no_touch()

pax_machine * get_cache_no_touch ( synode_no  synode,
bool_t  force 
)

◆ get_xcom_cache_length()

uint64_t get_xcom_cache_length ( )

◆ get_xcom_cache_occupation()

uint64_t get_xcom_cache_occupation ( )

◆ get_xcom_cache_size()

uint64_t get_xcom_cache_size ( )

◆ hash_get()

pax_machine * hash_get ( synode_no  synode)

◆ hash_in()

static pax_machine * hash_in ( pax_machine pm)
static

◆ hash_init()

static void hash_init ( stack_machine hash_bucket)
static

◆ hash_out()

static pax_machine * hash_out ( pax_machine p)
static

◆ hexdump()

void hexdump ( void *  p,
long  length 
)

◆ init_cache()

void init_cache ( )

◆ init_cache_size()

void init_cache_size ( )

◆ init_pax_machine()

pax_machine * init_pax_machine ( pax_machine p,
lru_machine lru,
synode_no  synode 
)

◆ is_busy_machine()

int is_busy_machine ( pax_machine p)

◆ lock_pax_machine()

int lock_pax_machine ( pax_machine p)

◆ lru_get()

static lru_machine * lru_get ( bool_t  force)
static

◆ lru_touch_hit()

static lru_machine * lru_touch_hit ( pax_machine p)
static

◆ pax_machine_size()

size_t pax_machine_size ( pax_machine const *  p)

◆ paxos_timeout()

void paxos_timeout ( pax_machine p)

◆ reset_cache()

static void reset_cache ( )
static

◆ set_dec_threshold_size()

void set_dec_threshold_size ( float  t_hold)

◆ set_length_increment()

void set_length_increment ( size_t  increment)

◆ set_max_cache_size()

uint64_t set_max_cache_size ( uint64_t  x)

◆ set_min_length_threshold()

void set_min_length_threshold ( float  threshold)

◆ set_min_target_occupation()

void set_min_target_occupation ( float  threshold)

◆ set_size_decrement()

void set_size_decrement ( size_t  decrement)

◆ shrink_cache()

size_t shrink_cache ( )

◆ sub_cache_size()

uint64_t sub_cache_size ( pax_machine p)

◆ synode_hash()

static unsigned int synode_hash ( synode_no  synode)
static

◆ unlock_pax_machine()

void unlock_pax_machine ( pax_machine p)

◆ was_machine_executed()

static int was_machine_executed ( pax_machine p)
static

◆ was_removed_from_cache()

int was_removed_from_cache ( synode_no  x)

◆ xcom_cache_var_init()

void xcom_cache_var_init ( )

Variable Documentation

◆ cache_length

uint64_t cache_length = 0
static

◆ cache_size

uint64_t cache_size = 0
static

◆ dec_threshold_length

uint64_t dec_threshold_length = DEC_THRESHOLD_LENGTH
static

◆ dec_threshold_size

float dec_threshold_size = DEC_THRESHOLD_SIZE
static

◆ hash_stack

linkage hash_stack
static
Initial value:
= {0, &hash_stack,
static linkage hash_stack
Definition: xcom_cache.cc:97

◆ highest_msgno

uint64_t highest_msgno = 0
static

◆ last_removed_cache

synode_no last_removed_cache
static

◆ length_increment

size_t length_increment = INCREMENT
static

◆ min_length_threshold

float min_length_threshold = MIN_LENGTH_THRESHOLD
static

◆ min_target_occupation

float min_target_occupation = MIN_TARGET_OCCUPATION
static

◆ occupation

uint64_t occupation = 0
static

◆ probation_lru

linkage probation_lru
static
Initial value:
= {
static linkage probation_lru
Definition: xcom_cache.cc:101

◆ protected_lru

linkage protected_lru
static
Initial value:
= {
static linkage protected_lru
Definition: xcom_cache.cc:99

◆ size_decrement

size_t size_decrement = INCREMENT / 10
static

◆ xcom_shutdown

int xcom_shutdown
extern