32#include "xdr_gen/xcom_vp.h"
46#define MIN_LENGTH MIN_CACHE_SIZE
47#define INCREMENT MIN_LENGTH
49#define is_cached(x) (hash_get(x) != NULL)
61 X(paxos_prepare), X(paxos_ack_prepare), X(paxos_accept), \
62 X(paxos_ack_accept), X(paxos_learn), X(paxos_start), X(paxos_tout), \
88#define SET_PAXOS_FSM_STATE(obj, s) \
90 (obj)->state.state_fp = s; \
91 (obj)->state.state_name = #s; \
126#ifndef XCOM_STANDALONE
160#define DEC_THRESHOLD_LENGTH 500000
161#define MIN_TARGET_OCCUPATION 0.7F
162#define DEC_THRESHOLD_SIZE 0.95F
163#define MIN_LENGTH_THRESHOLD 0.9F
176#ifndef XCOM_STANDALONE
182#define psi_set_cache_resetting(x) \
185#define psi_report_cache_shutdown() \
188#define psi_report_mem_free(x) \
191#define psi_report_mem_alloc(x) \
const char * p
Definition: ctype-mb.cc:1225
size_t size(const char *const c)
Definition: base64.h:46
required string event
Definition: replication_group_member_actions.proto:32
struct pax_msg pax_msg
Definition: site_struct.h:37
Definition: xcom_cache.cc:62
Definition: xcom_cache.h:95
lru_machine * lru
Definition: xcom_cache.h:98
linkage rv
Definition: xcom_cache.h:101
bit_set * prep_nodeset
Definition: xcom_cache.h:106
paxos_fsm_state state
Definition: xcom_cache.h:129
int lock
Definition: xcom_cache.h:121
stack_machine * stack_link
Definition: xcom_cache.h:97
ballot bal
Definition: xcom_cache.h:105
synode_no synode
Definition: xcom_cache.h:99
struct pax_machine::@27 learner
linkage hash_link
Definition: xcom_cache.h:96
ballot sent_learn
Definition: xcom_cache.h:110
struct pax_machine::@26 acceptor
bit_set * prop_nodeset
Definition: xcom_cache.h:108
char is_instrumented
Definition: xcom_cache.h:127
linkage watchdog
Definition: xcom_cache.h:102
ballot promise
Definition: xcom_cache.h:114
pax_op op
Definition: xcom_cache.h:122
struct pax_machine::@25 proposer
ballot sent_prop
Definition: xcom_cache.h:107
int force_delivery
Definition: xcom_cache.h:123
double last_modified
Definition: xcom_cache.h:100
pax_msg * msg
Definition: xcom_cache.h:109
int enforcer
Definition: xcom_cache.h:124
Definition: xcom_cache.h:79
paxos_fsm_fp state_fp
Definition: xcom_cache.h:80
char const * state_name
Definition: xcom_cache.h:81
Definition: site_struct.h:43
Definition: xcom_cache.cc:90
__u_int u_int
Definition: types.h:73
int bool_t
Definition: types.h:35
uint64_t get_xcom_cache_occupation()
Definition: xcom_cache.cc:654
pax_machine * init_pax_machine(pax_machine *p, lru_machine *lru, synode_no synode)
Definition: xcom_cache.cc:394
void psi_report_cache_shutdown()
After the cache is de-initialized 'current_count' must be zero; otherwise we have allocated data that...
Definition: gcs_psi.cc:222
int was_removed_from_cache(synode_no x)
Definition: xcom_cache.cc:71
paxos_event
Definition: xcom_cache.h:66
void set_dec_threshold_length(uint64_t threshold)
int paxos_fsm_idle(pax_machine *paxos, site_def const *site, paxos_event event, pax_msg *mess)
Definition: xcom_base.cc:9058
void paxos_timeout(pax_machine *p)
Definition: xcom_cache.cc:679
pax_machine * get_cache_no_touch(synode_no synode, bool_t force)
Definition: xcom_cache.cc:297
int psi_report_mem_alloc(size_t size)
Reports to PSI the allocation of 'size' bytes of data.
Definition: gcs_psi.cc:190
void psi_set_cache_resetting(int is_resetting)
void set_size_decrement(size_t decrement)
Definition: xcom_cache.cc:660
uint64_t sub_cache_size(pax_machine *p)
Definition: xcom_cache.cc:524
void set_min_target_occupation(float threshold)
Definition: xcom_cache.cc:668
void unlock_pax_machine(pax_machine *p)
Definition: xcom_cache.cc:431
void init_cache()
Definition: xcom_cache.cc:250
void set_dec_threshold_size(float threshold)
Definition: xcom_cache.cc:672
pax_machine * force_get_cache(synode_no synode)
Definition: xcom_cache.cc:316
void set_length_increment(size_t increment)
Definition: xcom_cache.cc:658
synode_no cache_get_last_removed()
Definition: xcom_cache.cc:69
uint64_t add_cache_size(pax_machine *p)
Definition: xcom_cache.cc:510
void xcom_cache_var_init()
Definition: xcom_cache.cc:389
int(* paxos_fsm_fp)(pax_machine *paxos, site_def const *site, paxos_event event, pax_msg *mess)
Definition: xcom_cache.h:75
void psi_report_mem_free(size_t size, int is_instrumented)
Reports to PSI the deallocation of 'size' bytes of data.
Definition: gcs_psi.cc:206
@ CACHE_TOO_SMALL
Definition: xcom_cache.h:198
@ CACHE_RESULT_LOW
Definition: xcom_cache.h:201
@ CACHE_SHRINK_OK
Definition: xcom_cache.h:197
@ CACHE_INCREASING
Definition: xcom_cache.h:202
@ CACHE_HASH_NOTEMPTY
Definition: xcom_cache.h:199
@ CACHE_HIGH_OCCUPATION
Definition: xcom_cache.h:200
pax_machine * get_cache(synode_no synode)
Definition: xcom_cache.cc:323
int lock_pax_machine(pax_machine *p)
Definition: xcom_cache.cc:425
pax_machine * hash_get(synode_no synode)
Definition: xcom_cache.cc:159
void deinit_cache()
Definition: xcom_cache.cc:278
uint16_t check_decrease()
Definition: xcom_cache.cc:603
uint64_t get_xcom_cache_size()
Definition: xcom_cache.cc:656
size_t shrink_cache()
Definition: xcom_cache.cc:370
uint64_t set_max_cache_size(uint64_t x)
Definition: xcom_cache.cc:544
void set_min_length_threshold(float threshold)
Definition: xcom_cache.cc:674
uint64_t get_xcom_cache_length()
Definition: xcom_cache.cc:655
char * dbg_pax_machine(pax_machine *p)
char * dbg_machine_nodeset(pax_machine *p, u_int nodes)
Definition: xcom_cache.cc:437
size_t pax_machine_size(pax_machine const *p)
Definition: xcom_cache.cc:491
void do_cache_maintenance()
Definition: xcom_cache.cc:626
#define p_events
Definition: xcom_cache.h:60
void init_cache_size()
Definition: xcom_cache.cc:506
int is_busy_machine(pax_machine *p)
Definition: xcom_cache.cc:433
int above_cache_limit()
Definition: xcom_cache.cc:539