Skip to content

panic when restore point: invalid memory address or nil pointer #61226

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

Open
apollodafoni opened this issue May 21, 2025 · 4 comments · May be fixed by #61225
Open

panic when restore point: invalid memory address or nil pointer #61226

apollodafoni opened this issue May 21, 2025 · 4 comments · May be fixed by #61225
Assignees
Labels
component/br This issue is related to BR of TiDB. feature/developing the related feature is in development severity/major type/bug The issue is confirmed as a bug.

Comments

@apollodafoni
Copy link

apollodafoni commented May 21, 2025

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  • first step: pitr with full backup, log backup, and restore-ts 458156326901252170
/br  restore  point --storage s3://tmp/br-log-backup6d5183eb-a828-4cac-93b6-c63d9c4f83e1/Log?access-key=xxx&secret-access-key=xxx&endpoint=http%3a%2f%2fminio-peer%3a9000&force-path-style=true --pd http://downstream-pd.brie-acceptance-pitr-tps-7864765-1-953:2379 --restored-ts 458156326901252170 --full-backup-storage s3://tmp/br-log-backup6d5183eb-a828-4cac-93b6-c63d9c4f83e1/Full?access-key=xxx&secret-access-key=xxx&endpoint=http%3a%2f%2fminio-peer%3a9000&force-path-style=true --concurrency=8 --check-requirements=false
  • second step: log restore only with start-ts 458156326901252170
/br  restore  point --storage s3://tmp/br-log-backup6d5183eb-a828-4cac-93b6-c63d9c4f83e1/Log?access-key=xxx&secret-access-key=xxx&endpoint=http%3a%2f%2fminio-peer%3a9000&force-path-style=true --pd http://downstream-pd.brie-acceptance-pitr-tps-7864765-1-953:2379 --restored-ts 458156607565987951 --start-ts 458156326901252170 --concurrency=8 --check-requirements=false

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

success when log restore only

3. What did you see instead (Required)

first step success, and second step panic

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5c0f1ba]

goroutine 1 [running]:
github.com/pingcap/tidb/br/pkg/utils.(*PiTRIdTracker).ContainsDB(...)
/workspace/source/tidb/br/pkg/utils/filter.go:120
github.com/pingcap/tidb/br/pkg/stream.(*TableMappingManager).ApplyFilterToDBReplaceMap(0xc001892b40?,0x0)
/workspace/source/tidb/br/pkg/stream/table_mapping.go:472+0x9a
github.com/pingcap/tidb/br/pkg/task.buildAndSaveIDMapIfNeeded({0x79d8130, 0xc0036f0640}, 0xc001892b40, 0xc0035c4800)
/workspace/source/tidb/br/pkg/task/stream.go:2134 +0xb3
github.com/pingcap/tidb/br/pkg/task.restoreStream({0x79d8130, 0xc001c5bb80}, 0xc00139d900, {0x79face0, 0xc0018df1e0}, 0xc0035c4800)
/workspace/source/tidb/br/pkg/task/stream.go:1562 +0xaa5
github.com/pingcap/tidb/br/pkg/task.RunStreamRestore({0x79d8130?, 0xc001c5a1e0?}, 0xc00139d900, {0x79face0, 0xc0018df1e0}, 0xc001c4ea08)
/workspace/source/tidb/br/pkg/task/stream.go:1422 +0x1266
github.com/pingcap/tidb/br/pkg/task.RunRestore({0x79d8130, 0xc001c5a1e0}, {0x79face0, 0xc0018df1e0}, {0x706afa7, 0xd}, 0xc001c4ea08)
/workspace/source/tidb/br/pkg/task/restore.go:818 +0x42e
main.runRestoreCommand(0xc001c8a608, {0x706afa7, 0xd})
/workspace/source/tidb/br/cmd/br/restore.go:80 +0x739
main.newStreamRestoreCommand.func1(0xc001c8a608?, {0xc001ca0dc0?, 0x4?,0x704cac7?})
/workspace/source/tidb/br/cmd/br/restore.go:254 +0x1f
github.com/spf13/cobra.(*Command).execute(0xc001c8a608, {0xc0000746b0, 0xa,0xa})
/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:1015 +0xa94
github.com/spf13/cobra(*Command).ExecuteC(0xc000c2c308)
/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148 +0x40c
github.com/spf13/cobra(*Command).Execute(...)
/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071
main.main()
/workspace/source/tidb/br/cmd/br/main.go:37 +0x23a

4. What is your TiDB version? (Required)

[release-version=v9.0.0-beta.1.pre-761-ge3478a5] [git-hash=e3478a5c15ea0322aad1a7fd0ee05371a6972b20] [git-branch=HEAD] [go-version=go1.23.9] [utc-build-time="2025-05-20 06:16:39"] [race-enabled=false]

@apollodafoni apollodafoni added the type/bug The issue is confirmed as a bug. label May 21, 2025
@apollodafoni
Copy link
Author

/severity critical
/component br
/assign @Leavrth

@Tristan1900
Copy link
Contributor

/label feature/developing

Copy link

ti-chi-bot bot commented May 21, 2025

@Tristan1900: The label(s) feature/developing cannot be applied. These labels are supported: fuzz/sqlancer, fuzz/comp, challenge-program, compatibility-breaker, first-time-contributor, contribution, good first issue, correctness, duplicate, proposal, security, needs-more-info, needs-cherry-pick-release-6.1, needs-cherry-pick-release-6.5, needs-cherry-pick-release-7.1, needs-cherry-pick-release-7.5, needs-cherry-pick-release-8.1, needs-cherry-pick-release-8.5, needs-cherry-pick-release-9.0-beta.1, affects-6.1, affects-6.5, affects-7.1, affects-7.5, affects-8.1, affects-8.4, affects-8.5, affects-9.0, may-affects-6.1, may-affects-6.5, may-affects-7.1, may-affects-7.5, may-affects-8.1, may-affects-8.5.

In response to this:

/label feature/developing

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@apollodafoni
Copy link
Author

/remove-severity critical
/severity major

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/br This issue is related to BR of TiDB. feature/developing the related feature is in development severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants