Uploaded image for project: 'Apache HAWQ (Retired)'
  1. Apache HAWQ (Retired)
  2. HAWQ-512

Query hang due to deadlock in entrydb catalog access

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Resolved
    • 2.0.0.0-incubating
    • 2.0.0.0-incubating
    • Catalog
    • None

    Description

      When entry database is involved in query with joins, it may hang due to deadlock while accessing catalog.

      DROP TABLE IF EXISTS t;
      CREATE TABLE t (key INT, value INT) DISTRIBUTED RANDOMLY;
      INSERT INTO t VALUES (1, 0);
      
      CREATE OR REPLACE FUNCTION f()
      RETURNS VOID AS $$
          sql = """ALTER TABLE t SET DISTRIBUTED BY (key)"""
          plpy.execute(sql)
      
          sql = """INSERT INTO t
                   SELECT t2.key, t2.value
                   FROM
                       (SELECT key, value FROM t WHERE value = 0) AS t1,
                       (SELECT generate_series(1, 2)::INT AS key, 0::INT AS value ) AS t2
                   WHERE t1.value = t2.value """
          # plan = plpy.prepare(sql)
          plpy.execute(sql)
      $$
      LANGUAGE plpythonu VOLATILE;
      
      -- Call of function f() hangs here
      SELECT f();
      

      Attachments

        Activity

          People

            ztao1987 Zhenglin Tao
            ztao1987 Zhenglin Tao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment