mirror of https://gitee.com/bigwinds/arangodb
duplicate attributes or shapes detection in shaper
when detecting duplicate attributes or shapes in Shaper, warn if their binary representation is distinct and ignore them if their binary representation is the same as one of a previous shape/attribute with the same id
This commit is contained in:
parent
3a4e9bf3a8
commit
9df8128b94
11
CHANGELOG
11
CHANGELOG
|
|
@ -84,7 +84,16 @@ v2.8.0 (XXXX-XX-XX)
|
|||
v2.7.1 (XXXX-XX-XX)
|
||||
-------------------
|
||||
|
||||
* fixed potential segfault in AQL `NEIGHBOURS` function implementation when C++ function
|
||||
* fixed "no start tick" issue in replication applier
|
||||
|
||||
This error could occur after restarting a slave server after a shutdown
|
||||
when no data was ever transferred from the master to the slave via the
|
||||
continuous replication
|
||||
|
||||
* fixed problem during SSL client connection abort that led to scheduler thread
|
||||
staying at 100% CPU saturation
|
||||
|
||||
* fixed potential segfault in AQL `NEIGHBORS` function implementation when C++ function
|
||||
variant was used and collection names were passed as strings
|
||||
|
||||
* removed duplicate target for some frontend JavaScript files from the Makefile
|
||||
|
|
|
|||
|
|
@ -828,12 +828,17 @@ int VocShaper::insertShape (TRI_df_marker_t const* marker,
|
|||
|
||||
if (warnIfDuplicate && f != nullptr) {
|
||||
char const* name = _collection->_info._name;
|
||||
bool const isIdentical = EqualElementShape(nullptr, f, l);
|
||||
if (isIdentical) {
|
||||
// duplicate shape, but with identical content. simply ignore it
|
||||
LOG_TRACE("found duplicate shape markers for id %llu in collection '%s' in shape dictionary", (unsigned long long) l->_sid, name);
|
||||
}
|
||||
else {
|
||||
LOG_ERROR("found heterogenous shape markers for id %llu in collection '%s' in shape dictionary", (unsigned long long) l->_sid, name);
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
LOG_ERROR("found duplicate shape in collection '%s'", name);
|
||||
TRI_ASSERT(false);
|
||||
#else
|
||||
LOG_TRACE("found duplicate shape in collection '%s'", name);
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -843,13 +848,18 @@ int VocShaper::insertShape (TRI_df_marker_t const* marker,
|
|||
|
||||
if (warnIfDuplicate && f != nullptr) {
|
||||
char const* name = _collection->_info._name;
|
||||
bool const isIdentical = EqualElementShape(nullptr, f, l);
|
||||
|
||||
if (isIdentical) {
|
||||
// duplicate shape, but with identical content. simply ignore it
|
||||
LOG_TRACE("found duplicate shape markers for id %llu in collection '%s' in shape ids table", (unsigned long long) l->_sid, name);
|
||||
}
|
||||
else {
|
||||
LOG_ERROR("found heterogenous shape markers for id %llu in collection '%s' in shape ids table", (unsigned long long) l->_sid, name);
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
LOG_ERROR("found duplicate shape in collection '%s'", name);
|
||||
TRI_ASSERT(false);
|
||||
#else
|
||||
LOG_TRACE("found duplicate shape in collection '%s'", name);
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (_nextSid <= l->_sid) {
|
||||
|
|
@ -894,12 +904,15 @@ int VocShaper::insertAttribute (TRI_df_marker_t const* marker,
|
|||
|
||||
if (warnIfDuplicate && found != nullptr) {
|
||||
char const* cname = _collection->_info._name;
|
||||
bool const isIdentical = (TRI_EqualString(name, GetAttributeName(found)) && aid == GetAttributeId(found));
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
LOG_ERROR("found duplicate attribute name '%s' in collection '%s'", name, cname);
|
||||
#else
|
||||
LOG_TRACE("found duplicate attribute name '%s' in collection '%s'", name, cname);
|
||||
#endif
|
||||
if (isIdentical) {
|
||||
// duplicate attribute, but with identical content. simply ignore it
|
||||
LOG_TRACE("found duplicate attribute name '%s' in collection '%s'", name, cname);
|
||||
}
|
||||
else {
|
||||
LOG_ERROR("found heterogenous attribute name '%s' in collection '%s'", name, cname);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -909,12 +922,15 @@ int VocShaper::insertAttribute (TRI_df_marker_t const* marker,
|
|||
|
||||
if (warnIfDuplicate && found != nullptr) {
|
||||
char const* cname = _collection->_info._name;
|
||||
bool const isIdentical = TRI_EqualString(name, GetAttributeName(found));
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
LOG_ERROR("found duplicate attribute id '%llu' in collection '%s'", (unsigned long long) aid, cname);
|
||||
#else
|
||||
LOG_TRACE("found duplicate attribute id '%llu' in collection '%s'", (unsigned long long) aid, cname);
|
||||
#endif
|
||||
if (isIdentical) {
|
||||
// duplicate attribute, but with identical content. simply ignore it
|
||||
LOG_TRACE("found duplicate attribute id '%llu' in collection '%s'", (unsigned long long) aid, cname);
|
||||
}
|
||||
else {
|
||||
LOG_ERROR("found heterogenous attribute id '%llu' in collection '%s'", (unsigned long long) aid, cname);
|
||||
}
|
||||
}
|
||||
|
||||
// no lock is necessary here as we are the only users of the shaper at this time
|
||||
|
|
|
|||
Loading…
Reference in New Issue