1、当运行态配置全部清空时,回收之前rulescan所遗留的rs_stream;
2、只在rulescan全量更新后,才通过rulescan_endstream_simple进行zombie stream回收。
This commit is contained in:
@@ -452,6 +452,8 @@ Maat_feather_t Maat_feather(int max_thread_num,const char* table_info_path,void*
|
|||||||
feather->outer_mid_cnt=aligment_int64_array_alloc(max_thread_num);
|
feather->outer_mid_cnt=aligment_int64_array_alloc(max_thread_num);
|
||||||
feather->inner_mid_cnt=aligment_int64_array_alloc(max_thread_num);
|
feather->inner_mid_cnt=aligment_int64_array_alloc(max_thread_num);
|
||||||
feather->hit_cnt=aligment_int64_array_alloc(max_thread_num);
|
feather->hit_cnt=aligment_int64_array_alloc(max_thread_num);
|
||||||
|
feather->maat_version=0;
|
||||||
|
feather->last_full_version=0;
|
||||||
return feather;
|
return feather;
|
||||||
}
|
}
|
||||||
int Maat_set_feather_opt(Maat_feather_t feather,enum MAAT_INIT_OPT type,const void* value,int size)
|
int Maat_set_feather_opt(Maat_feather_t feather,enum MAAT_INIT_OPT type,const void* value,int size)
|
||||||
@@ -561,6 +563,7 @@ int Maat_initiate_feather(Maat_feather_t feather)
|
|||||||
if(_feather->scanner!=NULL)
|
if(_feather->scanner!=NULL)
|
||||||
{
|
{
|
||||||
_feather->maat_version=_feather->scanner->version;
|
_feather->maat_version=_feather->scanner->version;
|
||||||
|
_feather->last_full_version=_feather->scanner->version;
|
||||||
}
|
}
|
||||||
if(strlen(_feather->stat_file)==0)
|
if(strlen(_feather->stat_file)==0)
|
||||||
{
|
{
|
||||||
@@ -1075,6 +1078,7 @@ stream_para_t Maat_stream_scan_string_start(Maat_feather_t feather,int table_id,
|
|||||||
sp->feather=_feather;
|
sp->feather=_feather;
|
||||||
sp->version=_feather->maat_version;
|
sp->version=_feather->maat_version;
|
||||||
sp->acc_scan_len=0;
|
sp->acc_scan_len=0;
|
||||||
|
sp->rs_stream_para=NULL;
|
||||||
if(scanner==NULL)
|
if(scanner==NULL)
|
||||||
{
|
{
|
||||||
return sp;
|
return sp;
|
||||||
@@ -1294,7 +1298,7 @@ void Maat_stream_scan_string_end(stream_para_t* stream_para)
|
|||||||
aligment_int64_array_add(p_table->stream_num,sp->thread_num,-1);
|
aligment_int64_array_add(p_table->stream_num,sp->thread_num,-1);
|
||||||
if(scanner!=NULL)
|
if(scanner!=NULL)
|
||||||
{
|
{
|
||||||
if(sp->version==sp->feather->maat_version)
|
if(sp->version>=sp->feather->last_full_version)
|
||||||
{
|
{
|
||||||
DEC_SCANNER_REF(scanner, sp->thread_num);
|
DEC_SCANNER_REF(scanner, sp->thread_num);
|
||||||
rulescan_endstream(sp->rs_stream_para);
|
rulescan_endstream(sp->rs_stream_para);
|
||||||
@@ -1305,7 +1309,16 @@ void Maat_stream_scan_string_end(stream_para_t* stream_para)
|
|||||||
rulescan_endstream_simple(sp->rs_stream_para);
|
rulescan_endstream_simple(sp->rs_stream_para);
|
||||||
sp->feather->zombie_rs_stream--;
|
sp->feather->zombie_rs_stream--;
|
||||||
}
|
}
|
||||||
|
sp->rs_stream_para=NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(sp->rs_stream_para!=NULL)
|
||||||
|
{
|
||||||
|
rulescan_endstream_simple(sp->rs_stream_para);
|
||||||
|
sp->feather->zombie_rs_stream--;
|
||||||
|
sp->rs_stream_para=NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(sp->last_cache!=NULL)
|
if(sp->last_cache!=NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include "mesa_fuzzy.h"
|
#include "mesa_fuzzy.h"
|
||||||
#include "great_index_engine.h"
|
#include "great_index_engine.h"
|
||||||
|
|
||||||
int MAAT_FRAME_VERSION_1_8_20161021_zombie_stream=1;
|
int MAAT_FRAME_VERSION_1_8_20161025_zombie_stream=1;
|
||||||
const char *maat_module="MAAT Frame";
|
const char *maat_module="MAAT Frame";
|
||||||
|
|
||||||
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",
|
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",
|
||||||
@@ -2799,6 +2799,7 @@ void *thread_rule_monitor(void *arg)
|
|||||||
}
|
}
|
||||||
feather->update_tmp_scanner=NULL;
|
feather->update_tmp_scanner=NULL;
|
||||||
feather->maat_version=feather->scanner->version;
|
feather->maat_version=feather->scanner->version;
|
||||||
|
feather->last_full_version=feather->scanner->version;
|
||||||
}
|
}
|
||||||
if(feather->scanner!=NULL)
|
if(feather->scanner!=NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -346,6 +346,7 @@ struct _Maat_feather_t
|
|||||||
MESA_htable_handle map_tablename2id;
|
MESA_htable_handle map_tablename2id;
|
||||||
void* logger;
|
void* logger;
|
||||||
int maat_version;
|
int maat_version;
|
||||||
|
int last_full_version;
|
||||||
int scan_thread_num;
|
int scan_thread_num;
|
||||||
int rule_scan_type;
|
int rule_scan_type;
|
||||||
char inc_dir[MAX_TABLE_NAME_LEN];
|
char inc_dir[MAX_TABLE_NAME_LEN];
|
||||||
|
|||||||
Reference in New Issue
Block a user