Skip to content
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

Failed to create the table because of creation of the snapshot #1075

Closed
chunshao90 opened this issue Jul 14, 2023 · 0 comments
Closed

Failed to create the table because of creation of the snapshot #1075

chunshao90 opened this issue Jul 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@chunshao90
Copy link
Contributor

Describe this problem

Failed to create the table because of creation of the snapshot.

{
    "code": 400,
    "message": "Internal err:Rpc error, code:500, message:Failed to execute plan, sql:CREATE TABLE `demo8`(\n    `name`string TAG,\n    `id` int TAG,\n    `value` double NOT NULL,\n    `t` timestamp NOT NULL,\n    TIMESTAMP KEY(t)\n    )  ENGINE = Analytic with (compaction_strategy=\"size_tiered\"), err:Internal error, msg:Failed to execute interpreter, err:Failed to execute create table, err:Failed to create table by table manipulator, err:Failed to operate table, err:Failed to operate table, msg:Some(\"failed to create table on shard, request:CreateTableRequest { catalog_name: \\\"ceresdb\\\", schema_name: \\\"public\\\", table_name: \\\"demo8\\\", table_id: None, table_schema: Schema { timestamp_index: 1, tsid_index: Some(0), column_schemas: ColumnSchemas { columns: [ColumnSchema { id: 1, name: \\\"tsid\\\", data_type: UInt64, is_nullable: false, is_tag: false, is_dictionary: false, comment: \\\"\\\", escaped_name: \\\"tsid\\\", default_value: None }, ColumnSchema { id: 2, name: \\\"t\\\", data_type: Timestamp, is_nullable: false, is_tag: false, is_dictionary: false, comment: \\\"\\\", escaped_name: \\\"t\\\", default_value: None }, ColumnSchema { id: 3, name: \\\"name\\\", data_type: String, is_nullable: true, is_tag: true, is_dictionary: false, comment: \\\"\\\", escaped_name: \\\"name\\\", default_value: None }, ColumnSchema { id: 4, name: \\\"id\\\", data_type: Int32, is_nullable: true, is_tag: true, is_dictionary: false, comment: \\\"\\\", escaped_name: \\\"id\\\", default_value: None }, ColumnSchema { id: 5, name: \\\"value\\\", data_type: Double, is_nullable: false, is_tag: false, is_dictionary: false, comment: \\\"\\\", escaped_name: \\\"value\\\", default_value: None }] }, version: 1, primary_key_indexes: [0, 1] }, engine: \\\"Analytic\\\", options: {\\\"compaction_strategy\\\": \\\"size_tiered\\\"}, state: Stable, shard_id: 0, partition_info: None }\"), err:Failed to create table, err:Failed to write meta data, err:Failed to persist meta update to manifest, space_id:2, table:demo8, table_id:2199023255561, err:Failed to build snapshot, msg:table data not exist, space_id:2, table_id:2199023255561."
}

Server version

commit:cc290f206fae75f07bbe4f876eb79f42cc1769bc

Steps to reproduce

Set snapshot_every_n_updates = 4

There will be a failure when creating the fifth table.

CREATE TABLE `demo`(
    `name`string TAG,
    `id` int TAG,
    `value` double NOT NULL,
    `t` timestamp NOT NULL,
    TIMESTAMP KEY(t)
    )  ENGINE = Analytic

Expected behavior

No response

Additional Information

No response

@chunshao90 chunshao90 added the bug Something isn't working label Jul 14, 2023
jiacai2050 pushed a commit that referenced this issue Jul 17, 2023
…1076)

## Rationale
Now we stats manifest updates of all tables in `Manifest` to trigger
snapshot.
However when snapshot is triggered, it will just do snapshot of latest
table storing update.
It is obvious unreasonable...

Worse, this mechanism lead to bug #1075 ...

So In this pr, I place the manifest updates stats into `TableData` , and
each table can only trigger snapshot of itself rather than others.

## Detailed Changes
+ Place the manifest updates stats into `TableData`.
+ Use it to trigger manifest snapshot.

## Test Plan
Test by new ut.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants