Skip to content

DROP INDEX may hang for a minute if idle worker attachments hold locks in their own metadata cache #8287

Open
@ilya071294

Description

@ilya071294

Steps to reproduce are kind of similar to #7783 but they show a completely different problem.

  1. Set parameters in firebird.conf:
MaxParallelWorkers = 8
ParallelWorkers = 8
  1. Execute the script in isql:
    index_drop_hang_fb_5_0.txt

Execution hangs for a minute at the last line drop index t1_idx1. This happens because worker attachments have been creating t1_idx2 index recently, and after loading T1 table metadata they still have P1 procedure in the metadata cache. The statement of the procedure holds SR lock on t1_idx1 index. A minute later the timer thread releases worker attachments, and drop index t1_idx1 is finally completed.
A simple solution is to call MET_clear_cache before putting a worker attachment into m_idleAtts array. I've tried it and it works. On the one hand, clearing the cache can be useful because in a general case the worker attachment can perform totally different tasks. On the other hand, different tasks may use the same objects. Any opinions?

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