-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
events table uses a 32-bit integer for stream_ordering #8255
Comments
ETA for event 2B is now 2021-07-04. |
The main difficulty with fixing is doing it in a way that doesn't involve synchronously rewriting the table (or at least the index). From https://www.postgresql.org/docs/10/sql-altertable.html:
Ideas for solving this:
|
I'm in favour of option 1. In addition to dropping unused columns, it allows for reordering columns: https://www.2ndquadrant.com/en/blog/on-rocks-and-sand/ The lack of rollback is indeed an issue. It can be scripted, but then that would have to be tested... |
Having experimented somewhat with this, I don't think option 1 is going to work. The two different types for
Being able to query efficiently for ranges of Rather, I am going to pursue option 2. We can follow up with option 1 later to clean up the table. |
Do we also need to worry about |
As I wrote over on #10264, yes! Here's a complete list of regular
|
These are all fixed in #10286:
And this one is fixed in #10289.
|
Somehow I seem to have missed one from the "ought to fix, but not urgent" category:
I've just been back through the list and double-checked: this is the only int4 not listed above. For the record, the incantation I used is: select relname||'.'||attname from pg_attribute att
left join pg_type t1 on t1.oid=att.atttypid
left join pg_class rel on rel.oid=attrelid
LEFT JOIN pg_namespace n ON n.oid = rel.relnamespace
WHERE nspname='public' AND typname='int4' and relkind IN ('r','p')
ORDER BY relname, attname; |
It was pointed out that I had better include sequences. Indeed, the only thing we want to exclude is indexes ( select relname||'.'||attname from pg_attribute att
left join pg_type t1 on t1.oid=att.atttypid
left join pg_class rel on rel.oid=attrelid
LEFT JOIN pg_namespace n ON n.oid = rel.relnamespace
WHERE nspname='public' AND typname='int4' and relkind <> 'i'
ORDER BY relname, attname; It doesn't find anything not already covered above. |
This is handled in #10349. |
2 billion events isn't actually that many; current estimate for exhaustion on matrix.org is Q3 2021, but that's an optimistic estimate as the rate of events is increasing.
nb there are other tables that use a standard int too.
The text was updated successfully, but these errors were encountered: