Skip to content

[Bug] Restore with partition cause some query fail "table status is not NORMAL: RESTORE" #8244

@GoGoWen

Description

@GoGoWen

Search before asking

  • I had searched in the issues and found no similar issues.

Version

master

What's Wrong?

1, create table like:
CREATE TABLE daily_jtk_ad_cps_user_detial (
date_time date NOT NULL COMMENT "",
adowner varchar(256) NULL DEFAULT """" COMMENT "",
sku_id bigint(20) NULL DEFAULT "0" COMMENT "",
union_id bigint(20) NULL DEFAULT "0" COMMENT "",
plan_id bigint(20) NULL COMMENT "",
plan_type int(11) NULL COMMENT "",
cp_act_id bigint(20) NULL COMMENT "",
cp_union_id bigint(20) NULL COMMENT "",
ware_id bigint(20) NULL COMMENT "",
jtk_uv_cnt hll HLL_UNION NULL COMMENT "",
jtk_click_cnt hll HLL_UNION NULL COMMENT "",
jtk_order_cnt hll HLL_UNION NULL COMMENT "",
jtk_payed_cnt hll HLL_UNION NULL COMMENT "",
jtk_finish_cnt hll HLL_UNION NULL COMMENT ""
) ENGINE=OLAP
AGGREGATE KEY(date_time, adowner, sku_id, union_id, plan_id, plan_type, cp_act_id, cp_union_id, ware_id)
COMMENT "OLAP"
PARTITION BY RANGE(date_time)
(PARTITION p202103 VALUES [('0000-01-01'), ('2021-04-01')),
PARTITION p202104 VALUES [('2021-04-01'), ('2021-05-01')))
DISTRIBUTED BY HASH(adowner) BUCKETS 16
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"in_memory" = "false",
"storage_format" = "V2"
)

2, restore partition: p202103 succeed.
3, restore partition: p202104, while query with:
select * from daily_jtk_ad_cps_user_detial where date_time>"2021-03-01" and date_time<"2021-03-30" limit 1;

RESULT:
ERROR 5014 (HY000): errCode = 2, detailMessage = Table state is not NORMAL: 'RESTORING'

What You Expected?

query succeed without error message.

How to Reproduce?

1, create table like:
CREATE TABLE daily_jtk_ad_cps_user_detial (
date_time date NOT NULL COMMENT "",
adowner varchar(256) NULL DEFAULT """" COMMENT "",
sku_id bigint(20) NULL DEFAULT "0" COMMENT "",
union_id bigint(20) NULL DEFAULT "0" COMMENT "",
plan_id bigint(20) NULL COMMENT "",
plan_type int(11) NULL COMMENT "",
cp_act_id bigint(20) NULL COMMENT "",
cp_union_id bigint(20) NULL COMMENT "",
ware_id bigint(20) NULL COMMENT "",
jtk_uv_cnt hll HLL_UNION NULL COMMENT "",
jtk_click_cnt hll HLL_UNION NULL COMMENT "",
jtk_order_cnt hll HLL_UNION NULL COMMENT "",
jtk_payed_cnt hll HLL_UNION NULL COMMENT "",
jtk_finish_cnt hll HLL_UNION NULL COMMENT ""
) ENGINE=OLAP
AGGREGATE KEY(date_time, adowner, sku_id, union_id, plan_id, plan_type, cp_act_id, cp_union_id, ware_id)
COMMENT "OLAP"
PARTITION BY RANGE(date_time)
(PARTITION p202103 VALUES [('0000-01-01'), ('2021-04-01')),
PARTITION p202104 VALUES [('2021-04-01'), ('2021-05-01')))
DISTRIBUTED BY HASH(adowner) BUCKETS 16
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"in_memory" = "false",
"storage_format" = "V2"
)

2, restore partition: p202104 succeed.
3, restore partition: p202103, while query with:
select * from daily_jtk_ad_cps_user_detial where date_time>"2021-03-01" and date_time<"2021-03-30" limit 1;

RESULT:
ERROR 5014 (HY000): errCode = 2, detailMessage = Table state is not NORMAL: 'RESTORING'

Anything Else?

NO

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions