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

"show table ** regions;" ERROR 1105 (HY000): json: cannot unmarshal number 18446744073709354954 into Go struct field RegionInfo.written_bytes of type int64 #22794

Closed
alex-quan-001 opened this issue Feb 18, 2021 · 4 comments
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.

Comments

@alex-quan-001
Copy link

alex-quan-001 commented Feb 18, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

During the data import process, i used "show table ** regions;" comand.

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

Return normal value

3. What did you see instead (Required)

It return "ERROR 1105 (HY000): json: cannot unmarshal number 18446744073709354954 into Go struct field RegionInfo.written_bytes of type int64"

here is the tidb logs:
[2021/02/18 15:58:22.356 +08:00] [INFO] [conn.go:809] ["command dispatched failed"] [conn=59] [connInfo="id:59, addr:192.168.190.9:50610 status:10, collation:utf8mb4_0900_ai_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="show table lineitem regions"] [txn_mode=PESSIMISTIC] [err="json: cannot unmarshal number 18446744073709354954 into Go struct field RegionInfo.written_bytes of type int64
github.com/pingcap/errors.AddStack
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20201126102027-b0a155152ca3/errors.go:174
github.com/pingcap/errors.Trace
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20201126102027-b0a155152ca3/juju_adaptor.go:15
github.com/pingcap/tidb/store/helper.(*Helper).requestPD
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/store/helper/helper.go:672
github.com/pingcap/tidb/store/helper.(*Helper).GetRegionInfoByID
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/store/helper/helper.go:636
github.com/pingcap/tidb/executor.getRegionInfo
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/split.go:820
github.com/pingcap/tidb/executor.getRegionMeta
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/split.go:794
github.com/pingcap/tidb/executor.getPhysicalTableRegions
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/split.go:644
github.com/pingcap/tidb/executor.getTableRegions
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/show.go:1591
github.com/pingcap/tidb/executor.(*ShowExec).fetchShowTableRegions
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/show.go:1577
github.com/pingcap/tidb/executor.(*ShowExec).fetchAll
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/show.go:205
github.com/pingcap/tidb/executor.(*ShowExec).Next
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/show.go:100
github.com/pingcap/tidb/executor.Next
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/executor.go:278
github.com/pingcap/tidb/executor.(*recordSet).Next
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/adapter.go:129
github.com/pingcap/tidb/server.(*tidbResultSet).Next
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/driver_tidb.go:298
github.com/pingcap/tidb/server.(*clientConn).writeChunks
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1732
github.com/pingcap/tidb/server.(*clientConn).writeResultset
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1692
github.com/pingcap/tidb/server.(*clientConn).handleStmt
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1589
github.com/pingcap/tidb/server.(*clientConn).handleQuery
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1455
github.com/pingcap/tidb/server.(*clientConn).dispatch
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:1029
github.com/pingcap/tidb/server.(*clientConn).Run
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:792
github.com/pingcap/tidb/server.(*Server).onConn
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/server.go:461
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1357"]

4. What is your TiDB version? (Required)

Release Version: v5.0.0-rc
Edition: Community
Git Commit Hash: fd4437d
Git Branch: heads/refs/tags/v5.0.0-rc
UTC Build Time: 2021-01-12 06:00:03
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

@alex-quan-001 alex-quan-001 added the type/bug This issue is a bug. label Feb 18, 2021
@HunDunDM
Copy link
Contributor

@bb7133
Copy link
Member

bb7133 commented Feb 19, 2021

The RegionInfo in PD uses uint64 for WrittenKeys: https://github.com/tikv/pd/blob/master/server/api/region.go#L53

However the RegionInfo in TiDB uses int64: https://github.com/pingcap/tidb/blob/master/store/helper/helper.go#L454

Which caused the 'overflow' error.

@jebter jebter added the sig/sql-infra SIG: SQL Infra label Feb 20, 2021
@github-actions github-actions bot added this to Issue Backlog: Need Triage in SIG Infra Kanban Feb 20, 2021
@xiongjiwei
Copy link
Contributor

seems it has been fixed

SIG Infra Kanban automation moved this from Issue Backlog: Need Triage to Done Aug 12, 2021
@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.
Projects
No open projects
Development

No branches or pull requests

7 participants