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

pre_split_regions doesn't work with partition table #14478

Closed
darkelf21cn opened this issue Jan 15, 2020 · 2 comments · Fixed by #18144
Closed

pre_split_regions doesn't work with partition table #14478

darkelf21cn opened this issue Jan 15, 2020 · 2 comments · Fixed by #18144
Assignees
Labels
severity/moderate type/bug The issue is confirmed as a bug.
Milestone

Comments

@darkelf21cn
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
    CREATE TABLE partition_table (
    task_id BIGINT NOT NULL,
    creation_dt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    result_data JSON
    )
    shard_row_id_bits = 4
    pre_split_regions = 3
    PARTITION BY RANGE (UNIX_TIMESTAMP(creation_dt) ) (
    PARTITION 20200101 VALUES LESS THAN (UNIX_TIMESTAMP('2020-01-01 00:00:00')),
    PARTITION 20200102 VALUES LESS THAN (UNIX_TIMESTAMP('2020-01-02 00:00:00')),
    PARTITION 20200103 VALUES LESS THAN (UNIX_TIMESTAMP('2020-01-03 00:00:00'))
    );
    SHOW TABLE partition_table REGIONS;

  2. What did you expect to see?
    I expect to see number_of_partitions * 2 ^ pre_split_regions regions are created with the table creation. So in my test case, I expect to see 3 * 8 = 24 regions are created.

  3. What did you see instead?
    Only 3 regions are created, one for each partition.

  4. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    Release Version: v3.0.8↵Git Commit Hash: 8f13cf1↵Git Branch: HEAD↵UTC Build Time: 2019-12-31 11:14:59↵GoVersion: go version go1.13 linux/amd64↵Race Enabled: false↵TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306↵Check Table Before Drop: false

@darkelf21cn darkelf21cn added the type/bug The issue is confirmed as a bug. label Jan 15, 2020
@crazycs520 crazycs520 self-assigned this Jan 15, 2020
@crazycs520
Copy link
Contributor

@darkelf21cn Thanks for your report, We will fix this soon.

Currently, you can use SPLIT TABLE syntax to solve this problem. such as:

split table partition_table between (0) and (9223372036854775807) regions 8;

@bb7133 bb7133 added this to the v3.0.10 milestone Jan 15, 2020
@bb7133
Copy link
Member

bb7133 commented Jan 15, 2020

Hi @crazycs520 , I put this bugfix in milestone 3.0.10, please check if this is OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants