Skip to content

Possible deadlock in truncate scenerios #147

@yugo-n

Description

@yugo-n

Reported by huyajun in https://www.postgresql.org/message-id/tencent_FCAF11BCA5003FD16BDDFDDA5D6A19587809%40qq.com

There is a risk of deadlock that is also acceptable for truncate scenarios.
The deadlock scene is as follows:

View definition: select * from base_a,base_b;

S1: truncate base_a; — only AccessExclusiveLock base_a and not run into after trigger
S2: insert into base_b; — The update has been completed and the incremental refresh is started in the after trigger,RowExclusive on base_b and ExclusiveLock on mv
S1: continue truncate mv, wait for AccessExclusiveLock on mv, wait for S2
S2: continue refresh mv, wait for AccessShardLock on base_a, wait for S1
So deadlock occurred

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions