You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mysql -h 127.0.0.1 -P 4002 -e "create database benchmark with (ttl='1d');"
Create a table in that database
mysql -h 127.0.0.1 -P 4002 benchmark -e "CREATE TABLE IF NOT EXISTS cpu ( hostname STRING NULL, region STRING NULL, datacenter STRING NULL, rack STRING NULL, os STRING NULL, arch STRING NULL, team STRING NULL, service STRING NULL, service_version STRING NULL, service_environment STRING NULL, usage_user BIGINT NULL, usage_system BIGINT NULL, usage_idle BIGINT NULL, usage_nice BIGINT NULL, usage_iowait BIGINT NULL, usage_irq BIGINT NULL, usage_softirq BIGINT NULL, usage_steal BIGINT NULL, usage_guest BIGINT NULL, usage_guest_nice BIGINT NULL, ts TIMESTAMP(9) NOT NULL, TIME INDEX (ts), PRIMARY KEY (hostname, region, datacenter, rack, os, arch, team, service, service_version, service_environment));"
What did you expect to see?
The table (and regions in that table) created should inherit the database ttl option
What did you see instead?
The ttl option does not take effect in region level.
What operating system did you use?
NA
What version of GreptimeDB did you use?
0.9.5
Relevant log output and stack trace
In #2341 we introduced procedure framework for fault-tolerant DDL tasks like creating tables. create table procedure are split into several steps, namely creating table metadata and invoking datanodes to create regions.
At the first step, table metadata inherits the database level options. However, the merge result is not reflected in CreateTableExpr itself. So at the second step, which is invoking datanodes to create regions, the CreateTableExpr does not carry any database-level options:
So the created regions do not contain schema-level options.
This bug is elusive in that you cannot find that schema options is not applied to regions since all table metadata are correct, so SHOW CREATE TABLE statement can give the correct result.
The text was updated successfully, but these errors were encountered:
What type of bug is this?
Incorrect result
What subsystems are affected?
Other
Minimal reproduce step
mysql -h 127.0.0.1 -P 4002 -e "create database benchmark with (ttl='1d');"
mysql -h 127.0.0.1 -P 4002 benchmark -e "CREATE TABLE IF NOT EXISTS cpu ( hostname STRING NULL, region STRING NULL, datacenter STRING NULL, rack STRING NULL, os STRING NULL, arch STRING NULL, team STRING NULL, service STRING NULL, service_version STRING NULL, service_environment STRING NULL, usage_user BIGINT NULL, usage_system BIGINT NULL, usage_idle BIGINT NULL, usage_nice BIGINT NULL, usage_iowait BIGINT NULL, usage_irq BIGINT NULL, usage_softirq BIGINT NULL, usage_steal BIGINT NULL, usage_guest BIGINT NULL, usage_guest_nice BIGINT NULL, ts TIMESTAMP(9) NOT NULL, TIME INDEX (ts), PRIMARY KEY (hostname, region, datacenter, rack, os, arch, team, service, service_version, service_environment));"
What did you expect to see?
The table (and regions in that table) created should inherit the database
ttl
optionWhat did you see instead?
The ttl option does not take effect in region level.
What operating system did you use?
NA
What version of GreptimeDB did you use?
0.9.5
Relevant log output and stack trace
In #2341 we introduced procedure framework for fault-tolerant DDL tasks like creating tables. create table procedure are split into several steps, namely creating table metadata and invoking datanodes to create regions.
At the first step, table metadata inherits the database level options. However, the merge result is not reflected in
CreateTableExpr
itself. So at the second step, which is invoking datanodes to create regions, theCreateTableExpr
does not carry any database-level options:greptimedb/src/common/meta/src/ddl/create_table.rs
Line 170 in 6a634f8
So the created regions do not contain schema-level options.
This bug is elusive in that you cannot find that schema options is not applied to regions since all table metadata are correct, so
SHOW CREATE TABLE
statement can give the correct result.The text was updated successfully, but these errors were encountered: