-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: remove experimental_unique_bytes (requires system table migration) #5887
Comments
As noted on #11722, this will involve changing the type of However:
It was proposed in #11722 that this would be a good first use for the migration code (in #11658) since we don't have code ready to use a |
I thought there was a proposal to replace the default with |
Ah ok, I should have checked whether a conversion like that was possible. However, it will still leave the field pretty awkwardly inconsistent with all our other system tables that use ints for IDs. It may be worth changing now to get that inconsistency out of the way before we're definitely stuck with it after we start getting real users. |
When do the migrations run? It seems wrong that you can end up in a situation where there are servers running the old version, but the migration has already been run. Another alternative would be to simply create a new table and migrate the old data to the new table. That wouldn't be appropriate if this was the only change, but while we're taking a look at it i'd like to give these tables a bit of an overhaul if possible: specifically, i'd like to separate DDL events from node events, storing them in two different tables. That's a larger scope than this change, and if this is a priority for Q4 then I'm okay with the drawbacks listed by Alex (although I think our migration process should strive avoid situations like that in the future). |
Right now, they just run when a node starts up with a new version and sees that one of the migrations it knows about hasn't been run. Of course, that only works for migrations that are backwards compatible, so when we need to run a migration that isn't backward compatible, we'll have to get smarter and only run them once all nodes are at some minimum version. In that case, relevant code that relies on the thing being changed will have to support both the before and after states. Most meaningful migrations will probably end up in the second bucket, but we didn't have any Q4 goals that needed it. |
I don't mind a stop-the-world upgrade during the beta period to remove this wart. |
I may have been a bit overzealous in wanting to get rid of said wart. How much do other people care about it? The commit to do so (b310788) is admittedly quite a bit messier than if we were just swapping out |
swapping it out sounds fine to me. Can you really do it via ALTER TABLE. I thought you would need some hack to implement the swap. |
Yeah, an ALTER TABLE can trivially change the default value of a primary key column, just not its data type:
|
I'm not bothered by the existence of |
Fixed by #12228 |
We should remove the
experimental_unique_bytes
builtin and replace usage of it withunique_rowid
. Unfortunately, this is a bit involved assystem.eventlog
usesexperimental_unique_bytes
. We currently do not have a facility for performing schema changes onsystem
tables. And because theuniqueID
field is stored in the primary key (which we can't modify via a schema change), we'd have to do something like:The text was updated successfully, but these errors were encountered: