Skip to content

Some internal transactions cost too much time in transaction retry #38136

@jackysp

Description

@jackysp

Enhancement

There will be many slow commit statements if there are many tidb-servers and the cluster is set to 'optimistic' transaction mode, because each tidb-server will update stats_meta in every 3 mins by default, and it will also affect the analyze statements.

image

This is due to the optimistic transaction will retry at most 10 times when write conflict occurs.

And there may other internal transactions meet this situation.

In #18952, we turn the auto commit transaction to pessimistic mode when retrying, I think it is better to turn all optimistic transaction to pessimistic when retrying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-6.1This bug affects the 6.1.x(LTS) versions.sig/transactionSIG:Transactiontype/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions