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

Log Backup: Advancer cannot resolve lock when memory lock is not nil. #57134

Closed
3pointer opened this issue Nov 5, 2024 · 1 comment · Fixed by #57178
Closed

Log Backup: Advancer cannot resolve lock when memory lock is not nil. #57134

3pointer opened this issue Nov 5, 2024 · 1 comment · Fixed by #57178
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. component/br This issue is related to BR of TiDB. severity/minor type/bug The issue is confirmed as a bug.

Comments

@3pointer
Copy link
Contributor

3pointer commented Nov 5, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

To reproduce this issue:

  1. In a log backup cluster, ensure there is an existing lock and trigger the advancer to resolve the lock on specific regions.
  2. Ensure the region contains a new lock ts in memory(from another new transaction).

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

Resolve Lock success

3. What did you see instead (Required)

Resolve Lock Failed, wait for next round.

resolve locks failed, wait for next tick"",""category"":""advancer"",""uuid"":""log backup advancer"",""error"":""unexpected scanlock error: error:<locked:<primary_lock:xxx

4. What is your TiDB version? (Required)

master

@3pointer 3pointer added type/bug The issue is confirmed as a bug. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. labels Nov 5, 2024
@3pointer
Copy link
Contributor Author

3pointer commented Nov 5, 2024

TiKV has an assumption: when any lock exists in memory less than max_ts, report Key is locked.

https://github.com/tikv/tikv/blob/37dfba1b046ebf308db972af0a3a788b7132244c/src/storage/mod.rs#L1634-L1641

We may need to adjust max_ts in the client from MaxUint64 to an appropriate range—greater than the lock ts but as small as feasible.

https://github.com/pingcap/tidb/blob/8a62d5a7bce32e56e22a8d17e85a086a2ceb1fd2/br/pkg/streamhelper/advancer.go#L691C17-L691C31

@jebter jebter added the component/br This issue is related to BR of TiDB. label Nov 8, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in 042846e Nov 11, 2024
@3pointer 3pointer added the affects-8.5 This bug affects the 8.5.x(LTS) versions. label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. component/br This issue is related to BR of TiDB. severity/minor type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants