Skip to content

Is delayForAsyncCommit needed before verify records by foreign_key and constraints check? #48297

@jiyfhust

Description

@jiyfhust

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

I see there is delayForAsyncCommit before verifying records, for example:

tidb/pkg/ddl/partition.go

Lines 2496 to 2498 in 4f00ece

if d.lease > 0 {
delayForAsyncCommit()
}

But there is no delay used by foreign_key and constraints check.

func checkForeignKeyConstrain(w *worker, schema, table string, fkInfo *model.FKInfo, fkCheck bool) error {

func (w *worker) verifyRemainRecordsForCheckConstraint(dbInfo *model.DBInfo, tableInfo *model.TableInfo, constr *model.ConstraintInfo, job *model.Job) error {

Is it a potential bug under async commit?

I don't known how to reproduce it to verify this question.

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

master

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions