Closed agedemenli closed 3 years ago
Thanks for the report. Well, the assert is triggered because the table contains rows like this:
a | b | c
---+---+--------------------
0 | 4 | 0.5139344756720483
0 | 5 | 0.9749701220118325
0 | 4 | 0.2685794689591283
(3 rows)
And we simply don't allow adding values with 0 (or negative) counts - because what would that do?
But it certainly seems a bit bogus to handle that using an assert - it's a user-supplier value, not some internal parameter, so it needs to be checked even on production builds without assert. I'll change that to an elog(ERROR).
An alternative would be to just ignore those values, but that seems rather dangerous and might easily mask issues.
Should be fixed by a75271b943561418bb4ce9c06008601c56cb21e7 - instead of crashing it should report ERROR.
Thank you!
I was testing tdigest with Citus extension to prepare Citus for PG14 release. I hit an assertion fail and noticed that it isn't related to Citus. This assertion might have problems when this is run on a production environment. This should either
Postgres version: 14beta3 -- (then tried with 13.0, it fails as well) The failure is happening in
tdigest_add_double_count
Exaclty here: https://github.com/tvondra/tdigest/blob/d14642eb573ddd80623b1dc8392587cf3ee2bb43/tdigest.c#L1172Example:
Here is the backtrace: