1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

a new tunable DatabaseMaxDead that enables the tdb max dead cache logic

(This used to be ctdb commit 01c519c3658a8fcb9545b507b597e723658e4c4e)
This commit is contained in:
Andrew Tridgell 2008-01-05 09:36:53 +11:00
parent 023a230d9c
commit e4aefbc66d
4 changed files with 52 additions and 1 deletions

View File

@ -297,7 +297,36 @@ struct ctdb_key_list {
struct ctdb_ltdb_header *headers;
TDB_DATA *data;
};
int ctdb_ctrl_pulldb(struct ctdb_context *ctdb, uint32_t destnode, uint32_t dbid, uint32_t lmaster, TALLOC_CTX *mem_ctx, struct ctdb_key_list *keys);
int ctdb_ctrl_pulldb(
struct ctdb_context *ctdb, uint32_t destnode, uint32_t dbid,
uint32_t lmaster, TALLOC_CTX *mem_ctx,
struct timeval timeout, TDB_DATA *outdata);
struct ctdb_client_control_state *ctdb_ctrl_pulldb_send(
struct ctdb_context *ctdb, uint32_t destnode, uint32_t dbid,
uint32_t lmaster, TALLOC_CTX *mem_ctx, struct timeval timeout);
int ctdb_ctrl_pulldb_recv(
struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx, struct ctdb_client_control_state *state,
TDB_DATA *outdata);
int ctdb_ctrl_pushdb(
struct ctdb_context *ctdb, uint32_t destnode, uint32_t dbid,
TALLOC_CTX *mem_ctx,
struct timeval timeout, TDB_DATA indata);
struct ctdb_client_control_state *ctdb_ctrl_pushdb_send(
struct ctdb_context *ctdb, uint32_t destnode, uint32_t dbid,
TALLOC_CTX *mem_ctx, struct timeval timeout,
TDB_DATA indata);
int ctdb_ctrl_pushdb_recv(
struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx,
struct ctdb_client_control_state *state);
int ctdb_ctrl_copydb(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t sourcenode,
uint32_t destnode, uint32_t dbid, uint32_t lmaster,

View File

@ -86,6 +86,7 @@ struct ctdb_tunable {
uint32_t recovery_grace_period;
uint32_t recovery_ban_period;
uint32_t database_hash_size;
uint32_t database_max_dead;
uint32_t rerecovery_timeout;
uint32_t enable_bans;
uint32_t deterministic_public_ips;
@ -1058,8 +1059,25 @@ void ctdb_node_dead(struct ctdb_node *node);
void ctdb_node_connected(struct ctdb_node *node);
bool ctdb_blocking_freeze(struct ctdb_context *ctdb);
int32_t ctdb_control_max_rsn(struct ctdb_context *ctdb, TDB_DATA indata, TDB_DATA *outdata);
struct ctdb_client_control_state *ctdb_ctrl_set_rsn_nonempty_send(
struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct timeval timeout,
uint32_t destnode, uint32_t db_id, uint64_t rsn);
int ctdb_ctrl_set_rsn_nonempty_recv(struct ctdb_context *ctdb,
struct ctdb_client_control_state *state);
int ctdb_ctrl_set_rsn_nonempty(struct ctdb_context *ctdb, struct timeval timeout,
uint32_t destnode, uint32_t db_id, uint64_t rsn);
struct ctdb_client_control_state *ctdb_ctrl_delete_low_rsn_send(
struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct timeval timeout,
uint32_t destnode, uint32_t db_id, uint64_t rsn);
int ctdb_ctrl_delete_low_rsn_recv(struct ctdb_context *ctdb,
struct ctdb_client_control_state *state);
int ctdb_ctrl_delete_low_rsn(struct ctdb_context *ctdb, struct timeval timeout,
uint32_t destnode, uint32_t db_id, uint64_t rsn);
int32_t ctdb_control_set_rsn_nonempty(struct ctdb_context *ctdb, TDB_DATA indata, TDB_DATA *outdata);
int32_t ctdb_control_delete_low_rsn(struct ctdb_context *ctdb, TDB_DATA indata, TDB_DATA *outdata);
int ctdb_ctrl_get_max_rsn(struct ctdb_context *ctdb, struct timeval timeout,
uint32_t destnode, uint32_t db_id, uint64_t *max_rsn);
int ctdb_ctrl_set_rsn_nonempty(struct ctdb_context *ctdb, struct timeval timeout,

View File

@ -260,6 +260,9 @@ static int ctdb_local_attach(struct ctdb_context *ctdb, const char *db_name, boo
DLIST_ADD(ctdb->db_list, ctdb_db);
/* setting this can help some high churn databases */
tdb_set_max_dead(ctdb_db->ltdb->tdb, ctdb->tunable.database_max_dead);
/*
all databases support the "null" function. we need this in
order to do forced migration of records

View File

@ -42,6 +42,7 @@ static const struct {
{ "RecoveryGracePeriod", 60, offsetof(struct ctdb_tunable, recovery_grace_period) },
{ "RecoveryBanPeriod", 300, offsetof(struct ctdb_tunable, recovery_ban_period) },
{ "DatabaseHashSize", 10000, offsetof(struct ctdb_tunable, database_hash_size) },
{ "DatabaseMaxDead", 5, offsetof(struct ctdb_tunable, database_max_dead) },
{ "RerecoveryTimeout", 10, offsetof(struct ctdb_tunable, rerecovery_timeout) },
{ "EnableBans", 1, offsetof(struct ctdb_tunable, enable_bans) },
{ "DeterministicIPs", 1, offsetof(struct ctdb_tunable, deterministic_public_ips) },