Repository: tikv/tikv (language: rust)

Issue:
CDC data consistency is broken by #17878
### What did you do?

1. create mysql sink changefeed
2. run sysbench workload
```
sysbench --db-driver=mysql --mysql-host=`nslookup upstream-tidb.cdc-testbed-tps-7701161-1-721 | awk -F: '{print $2}' | awk 'NR==5' | sed s/[[:space:]]//g`  --mysql-port=4000 --mysql-user=root --mysql-db=workload --tables=10 --table-size=100000 --create_secondary=off --debug=true --threads=10 --mysql-ignore-errors=2013,1213,1105,1205,8022,8027,8028,9004,9007,1062 oltp_insert prepare
sysbench --db-driver=mysql --mysql-host=`nslookup upstream-tidb.cdc-testbed-tps-7701161-1-721 | awk -F: '{print $2}' | awk 'NR==5' | sed s/[[:space:]]//g`  --mysql-port=4000 --mysql-user=root --mysql-db=workload --tables=10 --table-size=100000 --create_secondary=off --time=3600 --debug=true --threads=10 --mysql-ignore-errors=2013,1213,1105,1205,8022,8027,8028,9004,9007,1062 oltp_insert run
```
4. When wait sync finished and do data consistency check between CDC upstram tidb and  downstream mysql

### What did you expect to see?

Data should be consisteny

### What did you see instead?

Data in consistency seen, there are few lines inconsistent.

```
[root@syncdiff-0 /]# /sync_diff_inspector -C diff.toml 
A total of 11 tables need to be compared
Comparing the table structure of ``workload`.`finishmark`` ... equivalent
Comparing the table data of ``workload`.`finishmark`` ... equivalent
Comparing the table structure of ``workload`.`sbtest7`` ... equivalent
Comparing the table structure of ``workload`.`sbtest3`` ... equivalent
Comparing the table structure of ``workload`.`sbtest9`` ... equivalent
Comparing the table structure of ``workload`.`sbtest2`` ... equivalent
Comparing the table structure of ``workload`.`sbtest8`` ... equivalent
Comparing the table structure of ``workload`.`sbtest5`` ... equivalent
Comparing the table structure of ``workload`.`sbtest6`` ... equivalent
Comparing the table structure of ``workload`.`sbtest1`` ... equivalent
Comparing the table structure of ``workload`.`sbtest4`` ... equivalent
Comparing the table structure of ``workload`.`sbtest10`` ... equivalent
Comparing the table data of ``workload`.`sbtest7`` ... failure
Comparing the table data of ``workload`.`sbtest3`` ... equivalent
Comparing the table data of ``workload`.`sbtest9`` ... equivalent
Comparing the table data of ``workload`.`sbtest2`` ... equivalent
Comparing the table data of ``workload`.`sbtest8`` ... equivalent
Comparing the table data of ``workload`.`sbtest6`` ... equivalent
Comparing the table data of ``workload`.`sbtest1`` ... equivalent
Comparing the table data of ``workload`.`sbtest4`` ... failure
Comparing the table data of ``workload`.`sbtest5`` ... failure
Comparing the table data of ``workload`.`sbtest10`` ... failure
_____________________________________________________________________________
Progress [============================================================>] 100% 0/0
The data of `workload`.`sbtest7` is not equal
The data of `workload`.`sbtest4` is not equal
The data of `workload`.`sbtest10` is not equal
The data of `workload`.`sbtest5` is not equal
The rest of tables are all equal.
A total of 11 tables have been compared, 7 tables finished, 4 tables failed, 0 tables skipped.
The patch file has been generated in 
	'output/fix-on-downstream/'
You can view the comparision details through './output/sync_diff.log'
[root@syncdiff-0 fix-on-downstream]# grep "REPLACE INTO" *.sql
workload:sbtest10:9:0-0:20.sql:REPLACE INTO `workload`.`sbtest10`(`id`,`k`,`c`,`pad`) VALUES (1028807,50910,'24148805148-55296554110-92675601264-45307534453-86293879844-88996756733-74923597199-46632911387-30331970634-11914911249','29443314871-64523337193-95541208583-67745410464-57973333624');
workload:sbtest4:5:0-0:23.sql:REPLACE INTO `workload`.`sbtest4`(`id`,`k`,`c`,`pad`) VALUES (1053987,49910,'46487590967-37895403518-70618185921-23620516385-18354212443-68513474731-38000488475-42484842973-88319701943-97221539611','50803736847-84531891702-66511846010-96887657094-34650605186');
workload:sbtest5:4:0-0:22.sql:REPLACE INTO `workload`.`sbtest5`(`id`,`k`,`c`,`pad`) VALUES (1031511,49850,'50015221825-97315544850-77263189170-46521467393-34506395384-46573470457-81403888016-72756654009-78622124110-95668207877','25144265728-78042258906-08345467750-19655530089-59156606991');
workload:sbtest7:2:0-0:29.sql:REPLACE INTO `workload`.`sbtest7`(`id`,`k`,`c`,`pad`) VALUES (1447421,50169,'49087348356-30775897774-50767088732-15383819805-73845323139-32573905660-99220260841-18067715584-59735121278-20745318785','65275507448-27151899474-28000872036-92928273748-70050120248');
```

### Versions of the cluster
release-7.5

Touch #17878



Discussion / hints:

Fix patch:
diff --git a/components/cdc/src/delegate.rs b/components/cdc/src/delegate.rs
index 70d0d605c6d..f576724b01f 100644
--- a/components/cdc/src/delegate.rs
+++ b/components/cdc/src/delegate.rs
@@ -912,8 +912,9 @@ impl Delegate {
 
                 let commit_ts = if is_one_pc {
                     set_event_row_type(&mut row, EventLogType::Committed);
-                    old_value_ts = Some(TimeStamp::from(row.commit_ts));
-                    Some(TimeStamp::from(row.commit_ts))
+                    let commit_ts = TimeStamp::from(row.commit_ts);
+                    old_value_ts = Some(commit_ts.prev());
+                    Some(commit_ts)
                 } else {
                     // 2PC
                     if row.commit_ts == 0 {


Test patch: