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

resolve lock meets EpochNotMatch report newRegion's range key is not encoded #16961

Closed
lysu opened this issue Apr 30, 2020 · 2 comments · Fixed by #16962
Closed

resolve lock meets EpochNotMatch report newRegion's range key is not encoded #16961

lysu opened this issue Apr 30, 2020 · 2 comments · Fixed by #16962
Assignees
Labels
severity/major type/bug The issue is confirmed as a bug.
Milestone

Comments

@lysu
Copy link
Contributor

lysu commented Apr 30, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

run concurrent resolve lock and trigger tikv change region epoch at the same time.

2. What did you expect to see?

retry and execute success

3. What did you see instead?

err="newRegion's range key is not encoded: id:2 start_key:\"t\\200\\000\\000\\000\\000\\000\\001\\017\" region_epoch:<conf_ver:1 version:94 > peers:<id:3 store_id:1 > , invalid marker byte, group bytes \"t\\x80\\x00\\x00\\x00\\x00\\x00\\x01\\x0f\

github.com/pingcap/tidb/store/tikv.(*RegionCache).OnRegionEpochNotMatch
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/region_cache.go:1056
github.com/pingcap/tidb/store/tikv.(*RegionRequestSender).onRegionError
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/region_request.go:366
github.com/pingcap/tidb/store/tikv.(*RegionRequestSender).SendReqCtx
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/region_request.go:207
github.com/pingcap/tidb/store/tikv.(*RegionRequestSender).SendReq
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/region_request.go:106
github.com/pingcap/tidb/store/tikv.(*tikvStore).SendReq
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/kv.go:401
github.com/pingcap/tidb/store/tikv.(*LockResolver).resolveLock
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/lock_resolver.go:594
github.com/pingcap/tidb/store/tikv.(*LockResolver).resolveLocks
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/lock_resolver.go:330
github.com/pingcap/tidb/store/tikv.(*LockResolver).ResolveLocks
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/lock_resolver.go:285
github.com/pingcap/tidb/store/tikv.(*clientHelper).ResolveLocks
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/coprocessor.go:803
github.com/pingcap/tidb/store/tikv.(*copIteratorWorker).handleCopResponse
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/coprocessor.go:941
github.com/pingcap/tidb/store/tikv.(*copIteratorWorker).handleTaskOnce
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/coprocessor.go:757
github.com/pingcap/tidb/store/tikv.(*copIteratorWorker).handleTask
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/coprocessor.go:672
github.com/pingcap/tidb/store/tikv.(*copIteratorWorker).run
	/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/store/tikv/coprocessor.go:494
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1357

4. What version of TiDB are you using? (tidb-server -V or run select tidb_version(); on TiDB)

139cb3e

@lysu lysu added the type/bug The issue is confirmed as a bug. label Apr 30, 2020
@lysu lysu changed the title resolve lock meets EpochNotMatch report resolve lock meets EpochNotMatch report newRegion's range key is not encoded Apr 30, 2020
@lysu lysu modified the milestones: v4.0.0-ga, 4.0.0-rc.2 Apr 30, 2020
@lysu
Copy link
Contributor Author

lysu commented Apr 30, 2020

caused by #16838

deduplicate multi-requests into one response, but EpochNotMatch handle logic will modify the response

so two goroutines modify the same struct and decode key twice and last one will meet this error

@lysu
Copy link
Contributor Author

lysu commented Apr 30, 2020

this question does NOT affact on any released version now.

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

Successfully merging a pull request may close this issue.

2 participants