减少增量更新时hier重建的写锁临界区,减少扫描线程的所冲突。 修复 TSG-7211

This commit is contained in:
zhengchao
2021-07-27 11:54:24 +08:00
parent 479eb77369
commit dc057b2562
2 changed files with 8 additions and 9 deletions

View File

@@ -1198,18 +1198,17 @@ int Maat_hierarchy_rebuild(struct Maat_hierarchy* hier)
int ret=0;
struct bool_matcher* new_bm=NULL, *old_bm=NULL;
struct region2clause_value* new_region2clause_hash=NULL, *old_region2clause_hash=NULL;
//Read hier from update thread is OK.
ret=Maat_hierarchy_build_top_groups(hier);
new_bm=Maat_hierarchy_build_bool_matcher(hier);
new_region2clause_hash=Maat_hierarchy_build_region2clause_hash(hier);
pthread_rwlock_wrlock(&hier->rwlock);
ret=Maat_hierarchy_build_top_groups(hier);
new_bm=Maat_hierarchy_build_bool_matcher(hier);
old_bm=hier->bm;
new_region2clause_hash=Maat_hierarchy_build_region2clause_hash(hier);
old_bm=hier->bm;
old_region2clause_hash=hier->hash_region2clause;
hier->bm=new_bm;
hier->hash_region2clause=new_region2clause_hash;
pthread_rwlock_unlock(&hier->rwlock);

View File

@@ -57,7 +57,7 @@ extern "C"
}
#endif
int MAAT_FRAME_VERSION_3_4_1_20210719=1;
int MAAT_FRAME_VERSION_3_4_3_20210727=1;
int is_valid_table_name(const char* str)
{