Skip to content

[YSQL][SQLsmith] Stuck query in ReplicationSlotAllocationLock, can't be cancelled #11220

@def-

Description

@def-

Jira Link: DB-858

Description

After a few hours SQLsmith gets stuck in ReplicationSlotAllocationLock, I can reproduce it with the last run query:

select
  subq_0.c0 as c0,
  subq_0.c2 as c1,
  subq_0.c2 as c2,
  subq_0.c0 as c3
from
  (select
        82 as c0,
        ref_0.privilege_type as c1,
          pg_catalog.bit_or(
            cast(ref_2.attlen as int2)) over (partition by ref_0.object_schema order by ref_2.attinhcount) as c2,
        pg_catalog.pg_create_physical_replication_slot(
          cast(ref_2.attname as name),
          cast(ref_2.atthasmissing as bool),
          cast(pg_catalog.yb_is_database_colocated() as bool)) as c3
      from
        information_schema.role_usage_grants as ref_0
            inner join information_schema.sql_parts as ref_1
            on ((false)
                and ((cast(null as int8) <= cast(null as int2))
                  and (89 <= 34)))
          right join pg_catalog.pg_attribute as ref_2
          on (ref_2.attnum = ref_2.atttypmod)
      where true
      limit 95) as subq_0
where true
limit 20;

The query seems to stay around:

\x
select *
  from pg_stat_activity
  where datname = 'yugabyte';
-[ RECORD 1 ]----+------------------------------------------------------------------------------------------------------------------
datid            | 13281
datname          | yugabyte
pid              | 46014
usesysid         | 13280
usename          | yugabyte
application_name | ysqlsh
client_addr      | 127.0.0.1
client_hostname  |
client_port      | 64372
backend_start    | 2022-01-26 14:21:25.051697+01
xact_start       | 2022-01-26 14:24:47.538128+01
query_start      | 2022-01-26 14:24:47.538128+01
state_change     | 2022-01-26 14:24:47.538181+01
wait_event_type  | LWLock
wait_event       | ReplicationSlotAllocationLock
state            | active
backend_xid      |
backend_xmin     | 799
query            | select
[...]
backend_type     | client backend

Cancelling with Ctrl-C has no effect.

Metadata

Metadata

Labels

area/ysqlYugabyte SQL (YSQL)kind/bugThis issue is a bugkind/failing-testTests and testing infrapriority/mediumMedium priority issueqa_automationBugs identified via itest-system, LST, Stress automation or causing automation failures

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions