-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: creating new system tables with sqlmigrations is not possible #59850
Description
Describe the problem
I think we may have very badly shot ourselves in the foot in a way I would not have anticipated. I'm feeling sad about it. We added validation all over the place in 20.2, as we well know. One of the key places where we added this validation was in virtual tables. One interesting thing that happens in validation is here. We check that the system tables have some privileges in some map. Unfortunately, that means that when adding new system tables, in the mixed version state, they will fail validation. This is a tough nut to crack. It means that, at least for 21.1, we can't add new system tables during sqlmigrations. I can work around this for my current use case but this is really unfortunate in general. I'm not sure how best to test this sort of thing.
To Reproduce
Attempt to add a new system table and then in the mixed version state, run SHOW TABLES or something like it.
Expected behavior
We can create new system tables and the mixed-version state will work.
Additional Context
Maybe this isn't actually too terrible. In 21.1 we have long-running migrations which only run after all nodes are on the new version. That means we can safely add tables there. The only really awkward part is the migration to bootstrap the infrastructure for long-running migrations.