Skip to content

cdc: remove assertion on the lock start-ts#19084

Merged
ti-chi-bot[bot] merged 26 commits intotikv:masterfrom
3AceShowHand:cdc-remove-assert
Nov 7, 2025
Merged

cdc: remove assertion on the lock start-ts#19084
ti-chi-bot[bot] merged 26 commits intotikv:masterfrom
3AceShowHand:cdc-remove-assert

Conversation

@3AceShowHand
Copy link
Contributor

@3AceShowHand 3AceShowHand commented Nov 4, 2025

What is changed and how it works?

Issue Number: Close #19083

What's Changed:

* revert #16864 to avoid the TiKV-CDC panic due to assertion failed
  • The generation field is removed by revert the PR, need to do more work about how to support pipelined DML.
  • When push_lock, just push it like before, and print logs if there is already the lock with the same key.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Release note

revert #16864 to avoid the TiKV-CDC panic due to assertion failed

@ti-chi-bot ti-chi-bot bot added dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 4, 2025
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
This reverts commit d99bd9b.

Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 4, 2025
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 5, 2025
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
@ti-chi-bot ti-chi-bot bot removed the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 5, 2025
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
@3AceShowHand
Copy link
Contributor Author

/test pull-unit-test

Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 6, 2025
@3AceShowHand
Copy link
Contributor Author

/test pull-unit-test

Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
@cfzjywxk
Copy link
Collaborator

cfzjywxk commented Nov 7, 2025

@3AceShowHand
It seems the DELETE LOCK event on non-protected-rollback lock key is not handled in the current PR yet?

@cfzjywxk
Copy link
Collaborator

cfzjywxk commented Nov 7, 2025

/retest

@3AceShowHand
Copy link
Contributor Author

/test pull-unit-test

@3AceShowHand
Copy link
Contributor Author

@3AceShowHand It seems the DELETE LOCK event on non-protected-rollback lock key is not handled in the current PR yet?

Yes, I am investigating how to handle the DELETE LOCK and also ignore the pessimistic locks, to avoid the #17876

Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
assert_eq!(row.lock_count_modify, 0);
let start_ts = TimeStamp::from(row.v.start_ts);
row.lock_count_modify = self.pop_lock(key, start_ts)?;
let mut modified = self.pop_lock(key, start_ts)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a important change.

Previous code assert_eq!(row.lock_count_modify, 0); make one assumption that there is no 2 put request with the same key in the one batch.

The assertion is removed, and make that it is possible the case above happens. For example, lock cf put key a, and then write cf pop key a.

@3AceShowHand
Copy link
Contributor Author

/retest

Copy link
Collaborator

@cfzjywxk cfzjywxk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we may leave the lock cf handling compalitity refactor in the later PR

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Nov 7, 2025
@ti-chi-bot ti-chi-bot bot added the lgtm label Nov 7, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Nov 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfzjywxk, overvenus

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 7, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Nov 7, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-11-07 06:53:06.901766863 +0000 UTC m=+425836.344796741: ☑️ agreed by cfzjywxk.
  • 2025-11-07 07:17:15.850791462 +0000 UTC m=+427285.293821341: ☑️ agreed by overvenus.

@ti-chi-bot ti-chi-bot bot merged commit 887e6c8 into tikv:master Nov 7, 2025
9 checks passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Nov 7, 2025
@3AceShowHand
Copy link
Contributor Author

/cherry-pick release-8.5

ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this pull request Nov 7, 2025
close tikv#19083

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

@3AceShowHand: new pull request created to branch release-8.5: #19096.
But this PR has conflicts, please resolve them!

Details

In response to this:

/cherry-pick release-8.5

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.

ti-chi-bot bot pushed a commit that referenced this pull request Nov 10, 2025
close #19083

* revert #16864 to avoid the TiKV-CDC panic due to assertion failed

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>

Co-authored-by: Ling Jin <7138436+3AceShowHand@users.noreply.github.com>
Co-authored-by: 3AceShowHand <jinl1037@hotmail.com>
rxdoi pushed a commit to rxdoi/tikv that referenced this pull request Nov 18, 2025
close tikv#19083

* revert tikv#16864 to avoid the TiKV-CDC panic due to assertion failed

Signed-off-by: 3AceShowHand <jinl1037@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tikv assert panic "assert!(x.get().ts <= start_ts.ts);" on the tikv-cdc

5 participants