This is an automated email from the ASF dual-hosted git repository. reshke pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit 4ea126dd0eab625d4c638f768b71e12c623b84c7 Author: Chris Hajas <[email protected]> AuthorDate: Mon Jul 31 14:03:49 2023 -0700 Disable some Orca histogram asserts (#16052) These assertions were added to ensure that statistical operations on histograms in Orca are as expected. While they're valid assertions, fixing them simply isn't a super high priority at this time. Keeping them included ends up hiding more potentially serious bugs and makes debugging issues more cumbersome. Instead, comment these assertions out for now until we have some time to properly dig into the issue. --- .../libnaucrates/src/statistics/CHistogram.cpp | 60 +++++++++++++--------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/src/backend/gporca/libnaucrates/src/statistics/CHistogram.cpp b/src/backend/gporca/libnaucrates/src/statistics/CHistogram.cpp index b0c1053a11..26601c6e74 100644 --- a/src/backend/gporca/libnaucrates/src/statistics/CHistogram.cpp +++ b/src/backend/gporca/libnaucrates/src/statistics/CHistogram.cpp @@ -100,14 +100,18 @@ CHistogram::CHistogram(CMemoryPool *mp, CBucketArray *histogram_buckets, m_is_col_stats_missing(is_col_stats_missing) { GPOS_ASSERT(m_histogram_buckets); - GPOS_ASSERT(CDouble(0.0) <= null_freq); - GPOS_ASSERT(CDouble(1.0) >= null_freq); - GPOS_ASSERT(CDouble(0.0) <= distinct_remaining); - GPOS_ASSERT(CDouble(0.0) <= freq_remaining); - GPOS_ASSERT(CDouble(1.0) >= freq_remaining); - // if distinct_remaining is 0, freq_remaining must be 0 too - GPOS_ASSERT_IMP(distinct_remaining < CStatistics::Epsilon, - freq_remaining < CStatistics::Epsilon); + // FIXME: These assertions are sometimes hit and is indicitive of a bug, but + // currently aren't a high prioritiy and hitting them hides more serious issues +#if 0 + GPOS_ASSERT(CDouble(0.0) <= null_freq); + GPOS_ASSERT(CDouble(1.0) >= null_freq); + GPOS_ASSERT(CDouble(0.0) <= distinct_remaining); + GPOS_ASSERT(CDouble(0.0) <= freq_remaining); + GPOS_ASSERT(CDouble(1.0) >= freq_remaining); + if distinct_remaining is 0, freq_remaining must be 0 too + GPOS_ASSERT_IMP(distinct_remaining < CStatistics::Epsilon, + freq_remaining < CStatistics::Epsilon); +#endif } // set histograms null frequency @@ -1626,15 +1630,18 @@ CHistogram::CombineBuckets(CMemoryPool *mp, CBucketArray *buckets, buckets->AddRef(); return buckets; } - + // FIXME: This assertion is sometimes hit and is indicitive of a bug, but + // currently isn't a high prioritiy and hitting it hides more serious issues +#if 0 #ifdef GPOS_DEBUG - CDouble start_frequency(0.0); - for (ULONG ul = 0; ul < buckets->Size(); ++ul) - { - CBucket *bucket = (*buckets)[ul]; - start_frequency = start_frequency + bucket->GetFrequency(); - } - GPOS_ASSERT(start_frequency <= CDouble(1.0) + CStatistics::Epsilon); + CDouble start_frequency(0.0); + for (ULONG ul = 0; ul < buckets->Size(); ++ul) + { + CBucket *bucket = (*buckets)[ul]; + start_frequency = start_frequency + bucket->GetFrequency(); + } + GPOS_ASSERT(start_frequency <= CDouble(1.0) + CStatistics::Epsilon); +#endif #endif CBucketArray *result_buckets = GPOS_NEW(mp) CBucketArray(mp); @@ -1737,17 +1744,20 @@ CHistogram::CombineBuckets(CMemoryPool *mp, CBucketArray *buckets, result_buckets->Append(bucket->MakeBucketCopy(mp)); } } - + // FIXME: This assertion is sometimes hit and is indicitive of a bug, but + // currently isn't a high prioritiy and hitting it hides more serious issues +#if 0 #ifdef GPOS_DEBUG - CDouble end_frequency(0.0); - for (ULONG ul = 0; ul < result_buckets->Size(); ++ul) - { - CBucket *bucket = (*result_buckets)[ul]; - end_frequency = end_frequency + bucket->GetFrequency(); - } + CDouble end_frequency(0.0); + for (ULONG ul = 0; ul < result_buckets->Size(); ++ul) + { + CBucket *bucket = (*result_buckets)[ul]; + end_frequency = end_frequency + bucket->GetFrequency(); + } - GPOS_ASSERT(start_frequency - end_frequency <= - CDouble(0.0) + CStatistics::Epsilon); + GPOS_ASSERT(start_frequency - end_frequency <= + CDouble(0.0) + CStatistics::Epsilon); +#endif #endif // FIXME: the desired_num_buckets handling is broken for singleton buckets --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
