Skip to content

Catalog get table API return null sometimes #656

@humengyu2012

Description

@humengyu2012

Bug Report

1. Describe the bug

When I use method catalog.getTable(db,table), I may get a null object of TiTableInfo.
I use client-java in mapreduce, and there are more than 2000 calls of the method catalog.getTable(db,table), each mapper will call one or more times.
I found that a very small proportion(1%) of mappers will get null TiTableInfo object.

Caused by: org.apache.hadoop.hive.serde2.SerDeException: java.lang.IllegalStateException: Table `tag_core`.`content_tag_object_relation` no longer exists in TiDB
        at io.tidb.bigdata.hive.TiDBSerde.initialize(TiDBSerde.java:62)
        at org.apache.hadoop.hive.serde2.AbstractSerDe.initialize(AbstractSerDe.java:54)
        at org.apache.hadoop.hive.serde2.SerDeUtils.initializeSerDe(SerDeUtils.java:531)
        at org.apache.hadoop.hive.ql.plan.PartitionDesc.getDeserializer(PartitionDesc.java:177)
        at org.apache.hadoop.hive.ql.exec.MapOperator.initObjectInspector(MapOperator.java:186)
        at org.apache.hadoop.hive.ql.exec.MapOperator.setChildren(MapOperator.java:386)
        at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:106)
        ... 22 more
Caused by: java.lang.IllegalStateException: Table `tag_core`.`content_tag_object_relation` no longer exists in TiDB
        at io.tidb.bigdata.tidb.ClientSession.lambda$getTableMust$0(ClientSession.java:173)
        at java.util.Optional.orElseThrow(Optional.java:290)
        at io.tidb.bigdata.tidb.ClientSession.getTableMust(ClientSession.java:171)
        at io.tidb.bigdata.tidb.ClientSession.getTableColumnsMust(ClientSession.java:227)
        at io.tidb.bigdata.hive.TiDBSerde.initialize(TiDBSerde.java:60)
        ... 28 more

The implements of ClientSession.lambda$getTableMust$0(ClientSession.java:173) is:
image

2. Minimal reproduce step (Required)

I can't reproduce it because it happens by accident.

3. What did you see instead (Required)

4. What did you expect to see? (Required)

5. What are your Java Client and TiKV versions? (Required)

  • Client Java: 3.2.0
  • TiKV: 5.0.2

Metadata

Metadata

Assignees

Labels

type/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions