[Phase 1][YSQL][Colocation] Alter table fails on colocated table
ndeodhar opened this issue · 3 comments
ndeodhar commented
Jira Link: [DB-391](https://yugabyte.atlassian.net/browse/DB-391)
Alter table fails on colocated DB:
yugabyte=# create database codb with colocated=true;
CREATE DATABASE
yugabyte=# \c codb
You are now connected to database "codb" as user "yugabyte".
codb=# create table test(a int primary key);
CREATE TABLE
codb=# insert into test select generate_series(1,100);
INSERT 0 100
codb=# alter table test add column b int;
ERROR: Timed out: Timed out waiting for AlterTable
jaki commented
The overall issue is that alter table doesn't handle non-primary tables of tablets well. Here are some details to fix it, going in time order:
- master
AsyncAlterTable
should take table param (otherwise, it always uses tablet's primary table) ChangeMetadataRequestPB
probably needs somealter_table_id
field- Some modifications to
TabletService
- Some modifications to
Tablet
- Some modifications to
RaftGroupMetadata
- master
HandleTabletSchemaVersionReport
should take table param (otherwise, it always uses tablet's primary table)
See https://github.com/jaki/yugabyte-db/tree/colo-alter-table for partial work.
tverona1 commented
Validate this for tablegroups as well
frozenspider commented
Verified - this has been fixed, ALTER works for both means of colocation