-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
CS-API /messages
requests fail on develop when using postgres due to NumericValueOutOfRange if some events have repeatedly failed to backfill
#13929
Comments
I don't like the look of this:
I think that first row is the smallest 32 bit signed int? |
Right. In the query SELECT count(*)
FROM event_failed_pull_attempts
WHERE 1664364716150 >= last_attempt_ts + LEAST((1 << num_attempts) * 3600000, 604800000); (which causes 1664364716150 >= last_attempt_ts + LEAST((1 << num_attempts) * 3600000, 604800000) The types of "leaf" expressions involved here are
|
The left-shift expression is
our expression is now It looks like multiplication of integers (32 bit signed ints) simply errors on overflow, but I couldn't see anything in the docs which explains this.
Similarly for bigints (64 bit signed ints):
In contrast the left shift operation will happily overflow, wrapping around to negative ints.
|
TL;DR: As for why we sometimes
I think we need to clamp |
Assuming a regression in #13635. |
or cast the left hand side to a bigint?
|
Even if we do this,
(Maybe there's some setting to control overflow behaviour?) |
Ah yes you're right. I missed that |
/messages
requests fail on develop when using postgres due to NumericValueOutOfRange if some events have repeatedly failed to backfill
https://sentry.tools.element.io/organizations/element/issues/33447/?project=2&query=is%3Aunresolved
Running this query:
synapse/synapse/storage/databases/main/event_federation.py
Lines 753 to 805 in ac1a317
with args
from
synapse/synapse/storage/databases/main/event_federation.py
Lines 815 to 824 in ac1a317
Running on
1.68.0 (b=matrix-org-hotfixes,3f30bdca19)
The text was updated successfully, but these errors were encountered: