删除unique_sql_clean_ratio参数
This commit is contained in:
@ -643,7 +643,6 @@ disable_memory_protect|bool|0,0|NULL|NULL|
|
|||||||
segment_buffers|int|16,1073741823|kB|NULL|
|
segment_buffers|int|16,1073741823|kB|NULL|
|
||||||
default_index_kind|int|0,2|NULL|NULL|
|
default_index_kind|int|0,2|NULL|NULL|
|
||||||
undo_zone_count|int|0,1048576|NULL|NULL|
|
undo_zone_count|int|0,1048576|NULL|NULL|
|
||||||
unique_sql_clean_ratio|real|0,0.2|NULL|NULL|
|
|
||||||
enable_auto_clean_unique_sql|bool|0,0|NULL|NULL|
|
enable_auto_clean_unique_sql|bool|0,0|NULL|NULL|
|
||||||
[cmserver]
|
[cmserver]
|
||||||
log_dir|string|0,0|NULL|NULL|
|
log_dir|string|0,0|NULL|NULL|
|
||||||
|
@ -145,7 +145,6 @@
|
|||||||
#include "utils/guc_resource.h"
|
#include "utils/guc_resource.h"
|
||||||
|
|
||||||
const int NO_LIMIT_SIZE = -1;
|
const int NO_LIMIT_SIZE = -1;
|
||||||
#define UNIQUE_SQL_DEFAULT_CLEAN_RATIO 0.1
|
|
||||||
|
|
||||||
static void assign_statistics_memory(int newval, void* extra);
|
static void assign_statistics_memory(int newval, void* extra);
|
||||||
static bool check_cgroup_name(char** newval, void** extra, GucSource source);
|
static bool check_cgroup_name(char** newval, void** extra, GucSource source);
|
||||||
@ -167,9 +166,6 @@ static const char* show_enable_dynamic_workload(void);
|
|||||||
static void assign_control_group(const bool newval, void* extra);
|
static void assign_control_group(const bool newval, void* extra);
|
||||||
static void assign_enable_cgroup_switch(bool newval, void* extra);
|
static void assign_enable_cgroup_switch(bool newval, void* extra);
|
||||||
static void assign_memory_quota(int newval, void* extra);
|
static void assign_memory_quota(int newval, void* extra);
|
||||||
#ifndef ENABLE_MULTIPLE_NODES
|
|
||||||
static bool CheckUniqueSqlCleanRatio(double* newval, void** extra, GucSource source);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void InitResourceConfigureNamesBool();
|
static void InitResourceConfigureNamesBool();
|
||||||
static void InitResourceConfigureNamesInt();
|
static void InitResourceConfigureNamesInt();
|
||||||
@ -823,24 +819,7 @@ static void InitResourceConfigureNamesInt()
|
|||||||
static void InitResourceConfigureNamesReal()
|
static void InitResourceConfigureNamesReal()
|
||||||
{
|
{
|
||||||
struct config_real localConfigureNamesReal[] = {
|
struct config_real localConfigureNamesReal[] = {
|
||||||
#ifndef ENABLE_MULTIPLE_NODES
|
|
||||||
{{"unique_sql_clean_ratio",
|
|
||||||
PGC_POSTMASTER,
|
|
||||||
NODE_ALL,
|
|
||||||
RESOURCES_WORKLOAD,
|
|
||||||
gettext_noop("The percentage of the UniquesQl hash table"),
|
|
||||||
gettext_noop("The percentage of the UniquesQl hash table that will be "
|
|
||||||
"automatically eliminated when the UniquesQl hash table "
|
|
||||||
"is full. 0 means that auto-eliminate is not enabled."),
|
|
||||||
},
|
|
||||||
&u_sess->attr.attr_common.unique_sql_clean_ratio,
|
|
||||||
UNIQUE_SQL_DEFAULT_CLEAN_RATIO,
|
|
||||||
0,
|
|
||||||
0.2,
|
|
||||||
CheckUniqueSqlCleanRatio,
|
|
||||||
NULL,
|
|
||||||
NULL},
|
|
||||||
#endif
|
|
||||||
/* End-of-list marker */
|
/* End-of-list marker */
|
||||||
{{NULL,
|
{{NULL,
|
||||||
(GucContext)0,
|
(GucContext)0,
|
||||||
@ -1323,18 +1302,3 @@ static void assign_memory_quota(int newval, void* extra)
|
|||||||
gs_compare_and_swap_32(&srvmgr->freesize, old_freesize_limit, srvmgr->freesize_limit);
|
gs_compare_and_swap_32(&srvmgr->freesize, old_freesize_limit, srvmgr->freesize_limit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ENABLE_MULTIPLE_NODES
|
|
||||||
static bool CheckUniqueSqlCleanRatio(double* newval, void** extra, GucSource source)
|
|
||||||
{
|
|
||||||
if (g_instance.attr.attr_common.enable_auto_clean_unique_sql && *newval == 0) {
|
|
||||||
ereport(WARNING,
|
|
||||||
(errmsg("Can't set unique_sql_clean_ratio to 0 when enable_auto_clean_unique_sql is true. "
|
|
||||||
"Reset it's value to default(%lf). If you want to disable auto clean unique sql, "
|
|
||||||
"please set enable_auto_clean_unique_sql to false.",
|
|
||||||
UNIQUE_SQL_DEFAULT_CLEAN_RATIO)));
|
|
||||||
*newval = UNIQUE_SQL_DEFAULT_CLEAN_RATIO;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
@ -2502,8 +2502,8 @@ static bool AutoRecycleUniqueSQLEntry()
|
|||||||
(errmodule(MOD_INSTR), errcode(ERRCODE_LOG), errmsg("[UniqueSQL] instr_unique_sql_count is too large, uniquesql auto-clean will not happen.")));
|
(errmodule(MOD_INSTR), errcode(ERRCODE_LOG), errmsg("[UniqueSQL] instr_unique_sql_count is too large, uniquesql auto-clean will not happen.")));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
double ratio = u_sess->attr.attr_common.unique_sql_clean_ratio;
|
const double cleanRatio = 0.1;
|
||||||
int cleanCount = Max(int(ratio * instr_unique_sql_count + totalCount - instr_unique_sql_count), 1);
|
int cleanCount = Max(int(cleanRatio * instr_unique_sql_count + totalCount - instr_unique_sql_count), 1);
|
||||||
/* get remove entry list */
|
/* get remove entry list */
|
||||||
KeyUpdatedtime* removeList = GetSortedEntryList();
|
KeyUpdatedtime* removeList = GetSortedEntryList();
|
||||||
if (removeList == NULL) {
|
if (removeList == NULL) {
|
||||||
|
@ -12,3 +12,4 @@ comm_tcp_mode datanode
|
|||||||
comm_usable_memory datanode
|
comm_usable_memory datanode
|
||||||
minimum_pool_size datanode
|
minimum_pool_size datanode
|
||||||
pooler_maximum_idle_time datanode
|
pooler_maximum_idle_time datanode
|
||||||
|
unique_sql_clean_ratio datanode
|
||||||
|
@ -178,9 +178,6 @@ typedef struct knl_session_attr_common {
|
|||||||
|
|
||||||
/* instrumentation guc parameters */
|
/* instrumentation guc parameters */
|
||||||
int instr_unique_sql_count;
|
int instr_unique_sql_count;
|
||||||
#ifndef ENABLE_MULTIPLE_NODES
|
|
||||||
double unique_sql_clean_ratio;
|
|
||||||
#endif
|
|
||||||
bool enable_instr_cpu_timer;
|
bool enable_instr_cpu_timer;
|
||||||
int unique_sql_track_type;
|
int unique_sql_track_type;
|
||||||
bool enable_instr_track_wait;
|
bool enable_instr_track_wait;
|
||||||
|
Reference in New Issue
Block a user