Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL][SQLsmith] TRAP: FailedAssertion("!(!((allPgXact[proc->pgprocno].xid) != ((TransactionId) 0)))", File: "../../../../../../../src/postgres/src/backend/storage/ipc/procarray.c", Line: 440) #11235

Open
def- opened this issue Jan 26, 2022 · 4 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug kind/failing-test Tests and testing infra priority/medium Medium priority issue qa_automation Bugs identified via itest-system, LST, Stress automation or causing automation failures

Comments

@def-
Copy link
Contributor

def- commented Jan 26, 2022

Jira Link: DB-1168

Description

SQLsmith issue, sometimes ROLLBACK fails sporadically, can't reproduce. Postgres tserver log:

2022-01-26 18:44:03.159 CET [56123] ERROR:  operator does not exist: polygon = polygon at character 2013
2022-01-26 18:44:03.159 CET [56123] HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.
2022-01-26 18:44:03.159 CET [56123] STATEMENT:  select  
	  subq_0.c0 as c0
	from 
	  (select  
	        ref_0.gid as c0, 
	        ref_3.pid as c1, 
	        ref_3.datid as c2, 
	        ref_2.typowner as c3
	      from 
	        pg_catalog.pg_prepared_xacts as ref_0
	            right join information_schema.usage_privileges as ref_1
	            on (false)
	          inner join pg_catalog.pg_type as ref_2
	            left join pg_catalog.pg_stat_progress_vacuum as ref_3
	              left join pg_catalog.pg_attribute as ref_4
	              on (ref_3.relid = ref_4.attrelid )
	            on (ref_2.typarray = ref_4.attrelid )
	          on (((true) 
	                or (cast(null as timetz) <= cast(null as timetz))) 
	              and (cast(null as circle) @> cast(null as circle)))
	      where pg_catalog.circle(
	          cast(case when (false) 
	              or (true) then cast(null as point) else cast(null as point) end
	             as point),
	          cast(cast(null as float8) as float8)) ~ case when cast(null as lseg) <@ (select b from public.mvtest_boxes limit 1 offset 2)
	               then pg_catalog.circle(
	            cast(cast(null as point) as point),
	            cast((select pg_catalog.stddev_samp(total_time) from pg_catalog.pg_stat_statements)
	               as float8)) else pg_catalog.circle(
	            cast(cast(null as point) as point),
	            cast((select pg_catalog.stddev_samp(total_time) from pg_catalog.pg_stat_statements)
	               as float8)) end
	          
	      limit 61) as subq_0
	where ((subq_0.c3 is NULL) 
	    or ((case when true then cast(null as record) else cast(null as record) end
	           < cast(null as record)) 
	      or (case when (false) 
	            and (subq_0.c3 is not NULL) then cast(null as tsvector) else cast(null as tsvector) end
	           <> pg_catalog.jsonb_to_tsvector(
	          cast(cast(null as jsonb) as jsonb),
	          cast((select pg_catalog.jsonb_agg(implementation_info_id) from information_schema.sql_implementation_info)
	             as jsonb))))) 
	  and ((cast(nullif(cast(nullif(cast(null as polygon),
	          pg_catalog.polygon(
	            cast(subq_0.c1 as int4),
	            cast(cast(null as circle) as circle))) as polygon),
	        pg_catalog.poly_in(
	          cast(cast(coalesce(cast(null as cstring),
	            cast(null as cstring)) as cstring) as cstring))) as polygon) ~ pg_catalog.point(
	        cast((select b from public.mvtest_boxmv limit 1 offset 6)
	           as box))) 
	    or (case when pg_catalog.circle_in(
	            cast(cast(null as cstring) as cstring)) >> cast(null as circle) then cast(nullif(case when cast(null as macaddr8) > cast(null as macaddr8) then cast(null as date) else cast(null as date) end
	            ,
	          pg_catalog.to_date(
	            cast((select pg_catalog.max(md5) from public.mvtest_foo_data)
	               as text),
	            cast((select pg_catalog.max(locktype) from pg_catalog.pg_locks)
	               as text))) as date) else cast(nullif(case when cast(null as macaddr8) > cast(null as macaddr8) then cast(null as date) else cast(null as date) end
	            ,
	          pg_catalog.to_date(
	            cast((select pg_catalog.max(md5) from public.mvtest_foo_data)
	               as text),
	            cast((select pg_catalog.max(locktype) from pg_catalog.pg_locks)
	               as text))) as date) end
	         = case when ((cast(null as circle) < cast(null as circle)) 
	            and (cast(null as uuid) = cast(null as uuid))) 
	          and (((((subq_0.c3 is NULL) 
	                  and (subq_0.c1 is NULL)) 
	                and (cast(null as timestamptz) < cast(null as "timestamp"))) 
	              or ((subq_0.c2 is NULL) 
	                or (false))) 
	            and (cast(null as tsquery) <> cast(null as tsquery))) then cast(null as date) else cast(null as date) end
	        ))
	limit 83
2022-01-26 18:44:03.173 CET [56125] WARNING:  there is no transaction in progress
2022-01-26 18:44:03.181 CET [56124] WARNING:  there is no transaction in progress
2022-01-26 18:44:03.195 CET [56122] WARNING:  there is no transaction in progress
TRAP: FailedAssertion("!(!((allPgXact[proc->pgprocno].xid) != ((TransactionId) 0)))", File: "../../../../../../../src/postgres/src/backend/storage/ipc/procarray.c", Line: 440)
2022-01-26 18:44:03.196 CET [51547] LOG:  server process (PID 56122) was terminated by signal 6: Abort trap
2022-01-26 18:44:03.196 CET [51547] DETAIL:  Failed process was running: ROLLBACK;
2022-01-26 18:44:03.196 CET [51547] LOG:  terminating any other active server processes
2022-01-26 18:44:03.196 CET [56125] WARNING:  terminating connection because of crash of another server process
2022-01-26 18:44:03.196 CET [56125] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2022-01-26 18:44:03.196 CET [56125] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-26 18:44:03.196 CET [56123] WARNING:  terminating connection because of crash of another server process
2022-01-26 18:44:03.196 CET [56123] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2022-01-26 18:44:03.196 CET [56123] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-26 18:44:03.196 CET [56124] WARNING:  terminating connection because of crash of another server process
2022-01-26 18:44:03.196 CET [56124] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2022-01-26 18:44:03.196 CET [56124] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
I0126 18:44:03.196766 1830531072 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 58)
W0126 18:44:03.196738 1832824832 outbound_call.cc:131] Failed to schedule invoking callback on response for request yb.tserver.TabletServerService.Read to 127.0.0.1: Aborted (yb/rpc/thread_pool.cc:260): Service is shutting down
I0126 18:44:03.196907 1831104512 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 58)
W0126 18:44:03.197257 1832824832 rpc.cc:179] Aborted (yb/rpc/rpc.cc:178): Failed to schedule: 0x0000000109db1d08 -> Read(tablet: 00000000000000000000000000000000, num_ops: 1, num_attempts: 2, txn: 00000000-0000-0000-0000-000000000000, subtxn: [none])
I0126 18:44:03.197327 1831104512 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 58)
2022-01-26 18:44:03.202 CET [51547] LOG:  all server processes terminated; reinitializing
@def- def- added kind/bug This issue is a bug area/ysql Yugabyte SQL (YSQL) labels Jan 26, 2022
@def-
Copy link
Contributor Author

def- commented Jan 26, 2022

Was trying to find materialized view bugs, but the same error also happens without matviews.

@tedyu
Copy link
Contributor

tedyu commented Jan 26, 2022

ERROR:  relation "public.mvtest_boxes" does not exist
LINE 25: ... ~ case when cast(null as lseg) <@ (select b from public.mvt...
                                                              ^

What's the DDL for mvtest_boxes ?

@def-
Copy link
Contributor Author

def- commented Jan 26, 2022

DDLs are:

CREATE TABLE mvtest_foo_data AS SELECT i, md5(random()::text)
  FROM generate_series(1, 10) i;
CREATE TABLE mvtest_boxes (id serial primary key, b box);
INSERT INTO mvtest_boxes (b) VALUES
  ('(32,32),(31,31)'),
  ('(2.0000004,2.0000004),(1,1)'),
  ('(1.9999996,1.9999996),(1,1)');
CREATE MATERIALIZED VIEW mvtest_boxmv AS SELECT * FROM mvtest_boxes;

But can't reproduce here.

@def-
Copy link
Contributor Author

def- commented Jan 26, 2022

Can sometimes reproduce with:

select  
  subq_0.c4 as c0, 
  ref_1.datallowconn as c1, 
  74 as c2, 
  subq_1.c0 as c3
from 
  (select  
          ref_0.indexrelname as c0, 
          ref_0.relid as c1, 
          ref_0.indexrelname as c2, 
          37 as c3, 
          ref_0.relid as c4
        from 
          pg_catalog.pg_statio_sys_indexes as ref_0
        where true
        limit 93) as subq_0
    inner join pg_catalog.pg_database as ref_1
    on (subq_0.c3 = ref_1.encoding ),
  lateral (select  
        subq_0.c2 as c0
      from 
        information_schema.role_column_grants as ref_2
          right join pg_catalog.pg_file_settings as ref_3
          on (ref_1.datistemplate is NULL)
      where cast(null as tinterval) #<> cast(null as reltime)) as subq_1
where ((select sent_lsn from pg_catalog.pg_stat_replication limit 1 offset 3)
       < pg_catalog.pg_current_wal_flush_lsn()) 
  and ((select type from pg_catalog.pg_hba_file_rules limit 1 offset 1)
       >= cast(nullif(cast(null as text),
      cast(null as text)) as text))
limit 28

But mostly #11233 happens, which leads to me to believe these two bugs are related.

@def- def- changed the title [YSQL] TRAP: FailedAssertion("!(!((allPgXact[proc->pgprocno].xid) != ((TransactionId) 0)))", File: "../../../../../../../src/postgres/src/backend/storage/ipc/procarray.c", Line: 440) [YSQL][SQLsmith] TRAP: FailedAssertion("!(!((allPgXact[proc->pgprocno].xid) != ((TransactionId) 0)))", File: "../../../../../../../src/postgres/src/backend/storage/ipc/procarray.c", Line: 440) Feb 3, 2022
@yugabyte-ci yugabyte-ci added the priority/medium Medium priority issue label Jun 8, 2022
@kripasreenivasan kripasreenivasan added the qa_automation Bugs identified via itest-system, LST, Stress automation or causing automation failures label Sep 13, 2022
@yugabyte-ci yugabyte-ci added the kind/failing-test Tests and testing infra label Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug kind/failing-test Tests and testing infra priority/medium Medium priority issue qa_automation Bugs identified via itest-system, LST, Stress automation or causing automation failures
Projects
None yet
Development

No branches or pull requests

5 participants