Fix the problem of concurrent modification of UDR in memory causing crash
This commit is contained in:
@ -37,6 +37,31 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct MatchSamePatternDigest
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MatchSamePatternDigest(const uint64_t pattern_digest) :
|
||||||
|
is_exists_(false), pattern_digest_(pattern_digest)
|
||||||
|
{}
|
||||||
|
int operator()(
|
||||||
|
const hash::HashMapPair<ObUDRItemMgr::UDRKey, ObUDRItemMgr::UDRKeyNodePair *> &entry)
|
||||||
|
{
|
||||||
|
int ret = OB_SUCCESS;
|
||||||
|
if (!is_exists_ && pattern_digest_ == entry.first.pattern_digest_) {
|
||||||
|
is_exists_ = true;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
bool has_same_pattern_digest() const
|
||||||
|
{
|
||||||
|
return is_exists_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool is_exists_;
|
||||||
|
uint64_t pattern_digest_;
|
||||||
|
};
|
||||||
|
|
||||||
int ObUDRItemMgr::UDRKey::deep_copy(common::ObIAllocator &allocator, const UDRKey &other)
|
int ObUDRItemMgr::UDRKey::deep_copy(common::ObIAllocator &allocator, const UDRKey &other)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
@ -423,11 +448,11 @@ int ObUDRItemMgr::fuzzy_check_by_pattern_digest(const uint64_t pattern_digest,
|
|||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
is_exists = false;
|
is_exists = false;
|
||||||
for (RuleKeyNodeMap::iterator iter = rule_key_node_map_.begin(); iter != rule_key_node_map_.end(); ++iter) {
|
MatchSamePatternDigest callback(pattern_digest);
|
||||||
if (pattern_digest == iter->first.pattern_digest_) {
|
if (OB_FAIL(rule_key_node_map_.foreach_refactored(callback))) {
|
||||||
is_exists = true;
|
LOG_WARN("traversal rule_key_node_map_ failed", K(ret));
|
||||||
break;
|
} else {
|
||||||
}
|
is_exists = callback.has_same_pattern_digest();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user