mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-06 21:32:58 +00:00
feat(drop_table): support to rollback table metadata (#3692)
* feat: support to rollback table metadata * refactor: store table route value instead of physical table route * feat(drop_table): support to rollback table metadata * test: add rollback tests for drop table * fix: do not set region to readonly * test: add sqlness tests * feat: implement TombstoneManager * test: add tests for TombstoneManager * refactor: using TombstoneManager * chore: remove unused code * fix: fix typo * refactor: using `on_restore_metadata` * refactor: add `executor` to `DropTableProcedure` * refactor: simplify the `TombstoneManager` * refactor: refactor `Key` * refactor: carry more info * feat: add `destroy_table_metadata` * refactor: remove redundant table_route_value * feat: ensure the key is empty * feat: introcude `table_metadata_keys` * chore: carry more info * chore: remove clone * chore: apply suggestions from CR * feat: delete metadata tombstone
This commit is contained in:
@@ -71,7 +71,26 @@ DESC TABLE t2;
|
||||
| val | Float64 | | YES | | FIELD |
|
||||
+--------+----------------------+-----+------+---------+---------------+
|
||||
|
||||
-- TODO(ruihang): add a case that drops phy before t1
|
||||
-- should be failed
|
||||
-- SQLNESS REPLACE (region\s\d+\(\d+\,\s\d+\)) region
|
||||
DROP TABLE phy;
|
||||
|
||||
Error: 1004(InvalidArguments), Physical region is busy, there are still some logical regions using it
|
||||
|
||||
-- metadata should be restored
|
||||
DESC TABLE phy;
|
||||
|
||||
+------------+----------------------+-----+------+---------+---------------+
|
||||
| Column | Type | Key | Null | Default | Semantic Type |
|
||||
+------------+----------------------+-----+------+---------+---------------+
|
||||
| ts | TimestampMillisecond | | NO | | FIELD |
|
||||
| val | Float64 | | YES | | FIELD |
|
||||
| __table_id | UInt32 | PRI | NO | | TAG |
|
||||
| __tsid | UInt64 | PRI | NO | | TAG |
|
||||
| host | String | PRI | YES | | TAG |
|
||||
| job | String | PRI | YES | | TAG |
|
||||
+------------+----------------------+-----+------+---------+---------------+
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
@@ -16,7 +16,11 @@ DESC TABLE t1;
|
||||
|
||||
DESC TABLE t2;
|
||||
|
||||
-- TODO(ruihang): add a case that drops phy before t1
|
||||
-- should be failed
|
||||
-- SQLNESS REPLACE (region\s\d+\(\d+\,\s\d+\)) region
|
||||
DROP TABLE phy;
|
||||
-- metadata should be restored
|
||||
DESC TABLE phy;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user