fix Full config update bug https://jira.geedge.net/browse/TSG-14591
This commit is contained in:
@@ -97,7 +97,7 @@ struct maat_runtime {
|
||||
struct table_manager *ref_tbl_mgr; //share with maat instance
|
||||
size_t max_table_num;
|
||||
|
||||
uint32_t rule_num;
|
||||
long long rule_num;
|
||||
struct maat_kv_store *sequence_map;
|
||||
|
||||
struct maat_garbage_bin *ref_garbage_bin;
|
||||
|
||||
@@ -1507,7 +1507,7 @@ int maat_stream_scan(struct maat_stream *maat_stream, const char *data, int data
|
||||
|
||||
void *expr_rt = table_manager_get_runtime(maat_instance->tbl_mgr, maat_stream->physical_table_id);
|
||||
assert(expr_rt != NULL);
|
||||
|
||||
|
||||
long long cur_expr_rt_version = expr_runtime_get_version(expr_rt);
|
||||
if (maat_stream->expr_rt_version != cur_expr_rt_version) {
|
||||
return MAAT_SCAN_OK;
|
||||
|
||||
@@ -31,10 +31,10 @@ struct compile_schema {
|
||||
int compile_id_column;
|
||||
int rule_tag_column;
|
||||
int declared_clause_num_column;
|
||||
struct ex_data_schema ex_schema;
|
||||
int set_flag;
|
||||
int table_id; //ugly
|
||||
char table_name[NAME_MAX];
|
||||
int set_flag;
|
||||
struct ex_data_schema ex_schema;
|
||||
struct table_manager *ref_tbl_mgr;
|
||||
struct log_handle *logger;
|
||||
|
||||
|
||||
@@ -292,12 +292,7 @@ void maat_runtime_destroy(struct maat_runtime *maat_rt)
|
||||
if (NULL == maat_rt) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (maat_rt->ref_tbl_mgr != NULL) {
|
||||
table_manager_runtime_destroy(maat_rt->ref_tbl_mgr);
|
||||
maat_rt->ref_tbl_mgr = NULL;
|
||||
}
|
||||
|
||||
|
||||
if (maat_rt->sequence_map != NULL) {
|
||||
maat_kv_store_free(maat_rt->sequence_map);
|
||||
maat_rt->sequence_map = NULL;
|
||||
|
||||
@@ -441,6 +441,11 @@ void maat_table_free(struct maat_table *maat_tbl)
|
||||
maat_tbl->runtime = NULL;
|
||||
}
|
||||
|
||||
if (maat_tbl->updating_runtime != NULL) {
|
||||
maat_table_runtime_free(maat_tbl->updating_runtime, maat_tbl->table_type);
|
||||
maat_tbl->updating_runtime = NULL;
|
||||
}
|
||||
|
||||
FREE(maat_tbl);
|
||||
}
|
||||
|
||||
@@ -877,6 +882,7 @@ void table_commit_updating_runtime(struct table_manager *tbl_mgr, int table_id,
|
||||
|
||||
void *runtime = table_manager_get_runtime(tbl_mgr, table_id);
|
||||
tbl_mgr->tbl[table_id]->runtime = updating_rt;
|
||||
|
||||
if (runtime != NULL) {
|
||||
enum table_type *arg = ALLOC(enum table_type, 1);
|
||||
*arg = table_type;
|
||||
@@ -902,7 +908,7 @@ void table_commit_runtime(struct table_manager *tbl_mgr, int table_id,
|
||||
__FUNCTION__, __LINE__, table_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
struct maat_table *ptable = tbl_mgr->tbl[table_id];
|
||||
if (table_ops[table_type].commit_runtime != NULL) {
|
||||
table_ops[table_type].commit_runtime(runtime, ptable->table_name, maat_rt_version);
|
||||
|
||||
@@ -337,7 +337,6 @@ static void random_keyword_generate(char *keyword_buf, size_t sz)
|
||||
return;
|
||||
}
|
||||
|
||||
#if 1
|
||||
class MaatFlagScan : public testing::Test
|
||||
{
|
||||
protected:
|
||||
@@ -5555,7 +5554,7 @@ TEST_F(MaatRollbackTest, FullConfigRollback) {
|
||||
maat_state_free(state);
|
||||
state = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
int ret=0;
|
||||
|
||||
Reference in New Issue
Block a user