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][randgen] Memory conetxt assertion failure: MemoryContextReset + 102 at .../src/postgres/src/backend/utils/mmgr/mcxt.c:346 #21292

Closed
mtakahar opened this issue Mar 4, 2024 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@mtakahar
Copy link
Contributor

mtakahar commented Mar 4, 2024

Jira Link: DB-10208

Description

Problem

  • Reproducible on the master (8de798e). Update: git bisect found this as the first broken commit:
    74064331f0 (tag: 2.21.0.0-b286) [#20003] YSQL: Fix BNL IN array type derivation. The test case hits the crash fixed by this commit.
  • Debug build: the test query intermittently hits a memory context assert, a crash or problem in alloc set CacheMemoryContext... warnings.
  • Release build intermittently crash at somewhat random locations.
  • The symptom manifest itself at least once in every 5 or so times.
psql test -U yugabyte -h 127.0.0.1 -p 5433 -Ppager=off -Pnull='<null>' -vPROMPT1='YB %/%# '
psql (15.1, server 11.2-YB-2.21.1.0-b0)
Type "help" for help.

YB test# /*+ Set(enable_hashjoin off) Set(enable_mergejoin off) Set(enable_material off) */
SELECT  FROM C  AS table1  JOIN (  SELECT SUBQUERY2_t2 .* FROM C  AS SUBQUERY2_t2  JOIN C  AS SUBQUERY2_t3  ON ( SUBQUERY2_t3 .col_varchar_nokey  = SUBQUERY2_t2 .col_varchar_key  )  WHERE SUBQUERY2_t3 .pk  <>  43  )  AS table2  ON ( table2 .col_varchar_key  = table1 .col_varchar_key  )  JOIN (  SELECT SUBQUERY3_t1 .* FROM CC  AS SUBQUERY3_t1  JOIN CC  AS SUBQUERY3_t2  ON ( SUBQUERY3_t2 .col_int_nokey  = SUBQUERY3_t1 .col_int_key  )  WHERE SUBQUERY3_t1 .col_varchar_key  != SUBQUERY3_t2 .col_varchar_key  )  AS table3  ON ( table3 .col_varchar_key  = table2 .col_varchar_nokey  )  WHERE  EXISTS (  SELECT  MIN( SUBQUERY4_t2 .col_varchar_key  )  FROM C  AS SUBQUERY4_t1  JOIN C  AS SUBQUERY4_t2  ON ( SUBQUERY4_t2 .col_varchar_key  = SUBQUERY4_t1 .col_varchar_key  )  WHERE SUBQUERY4_t2 .pk  <= table2 .col_int_nokey  AND SUBQUERY4_t2 .col_int_key  < table1 .pk  )  OR table3 .col_varchar_key  >= table1 .col_varchar_key   ;

WARNING:  problem in alloc set CacheMemoryContext: corrupt header in block 0x115c4c000
WARNING:  problem in alloc set CacheMemoryContext: bad single-chunk 0x115c4c028 in block 0x115c4c000
WARNING:  problem in alloc set CacheMemoryContext: detected write past chunk end in block 0x115c4c000, chunk 0x115c4c028
WARNING:  problem in alloc set CacheMemoryContext: found inconsistent memory block 0x115c4c000
--
(11 rows)

YB test# \c

psql (15.1, server 11.2-YB-2.21.1.0-b0)
You are now connected to database "test" as user "yugabyte".
YB test# /*+ Set(enable_hashjoin off) Set(enable_mergejoin off) Set(enable_material off) */
SELECT  FROM C  AS table1  JOIN (  SELECT SUBQUERY2_t2 .* FROM C  AS SUBQUERY2_t2  JOIN C  AS SUBQUERY2_t3  ON ( SUBQUERY2_t3 .col_varchar_nokey  = SUBQUERY2_t2 .col_varchar_key  )  WHERE SUBQUERY2_t3 .pk  <>  43  )  AS table2  ON ( table2 .col_varchar_key  = table1 .col_varchar_key  )  JOIN (  SELECT SUBQUERY3_t1 .* FROM CC  AS SUBQUERY3_t1  JOIN CC  AS SUBQUERY3_t2  ON ( SUBQUERY3_t2 .col_int_nokey  = SUBQUERY3_t1 .col_int_key  )  WHERE SUBQUERY3_t1 .col_varchar_key  != SUBQUERY3_t2 .col_varchar_key  )  AS table3  ON ( table3 .col_varchar_key  = table2 .col_varchar_nokey  )  WHERE  EXISTS (  SELECT  MIN( SUBQUERY4_t2 .col_varchar_key  )  FROM C  AS SUBQUERY4_t1  JOIN C  AS SUBQUERY4_t2  ON ( SUBQUERY4_t2 .col_varchar_key  = SUBQUERY4_t1 .col_varchar_key  )  WHERE SUBQUERY4_t2 .pk  <= table2 .col_int_nokey  AND SUBQUERY4_t2 .col_int_key  < table1 .pk  )  OR table3 .col_varchar_key  >= table1 .col_varchar_key   ;

server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
psql (15.1, server 11.2-YB-2.21.1.0-b0)
YB test# \c

psql (15.1, server 11.2-YB-2.21.1.0-b0)
You are now connected to database "test" as user "yugabyte".
YB test# /*+ Set(enable_hashjoin off) Set(enable_mergejoin off) Set(enable_material off) */
SELECT  FROM C  AS table1  JOIN (  SELECT SUBQUERY2_t2 .* FROM C  AS SUBQUERY2_t2  JOIN C  AS SUBQUERY2_t3  ON ( SUBQUERY2_t3 .col_varchar_nokey  = SUBQUERY2_t2 .col_varchar_key  )  WHERE SUBQUERY2_t3 .pk  <>  43  )  AS table2  ON ( table2 .col_varchar_key  = table1 .col_varchar_key  )  JOIN (  SELECT SUBQUERY3_t1 .* FROM CC  AS SUBQUERY3_t1  JOIN CC  AS SUBQUERY3_t2  ON ( SUBQUERY3_t2 .col_int_nokey  = SUBQUERY3_t1 .col_int_key  )  WHERE SUBQUERY3_t1 .col_varchar_key  != SUBQUERY3_t2 .col_varchar_key  )  AS table3  ON ( table3 .col_varchar_key  = table2 .col_varchar_nokey  )  WHERE  EXISTS (  SELECT  MIN( SUBQUERY4_t2 .col_varchar_key  )  FROM C  AS SUBQUERY4_t1  JOIN C  AS SUBQUERY4_t2  ON ( SUBQUERY4_t2 .col_varchar_key  = SUBQUERY4_t1 .col_varchar_key  )  WHERE SUBQUERY4_t2 .pk  <= table2 .col_int_nokey  AND SUBQUERY4_t2 .col_int_key  < table1 .pk  )  OR table3 .col_varchar_key  >= table1 .col_varchar_key   ;

--
(11 rows)

YB test# EXPLAIN (COSTS OFF)
/*+ Set(enable_hashjoin off) Set(enable_mergejoin off) Set(enable_material off) */
SELECT  FROM C  AS table1  JOIN (  SELECT SUBQUERY2_t2 .* FROM C  AS SUBQUERY2_t2  JOIN C  AS SUBQUERY2_t3  ON ( SUBQUERY2_t3 .col_varchar_nokey  = SUBQUERY2_t2 .col_varchar_key  )  WHERE SUBQUERY2_t3 .pk  <>  43  )  AS table2  ON ( table2 .col_varchar_key  = table1 .col_varchar_key  )  JOIN (  SELECT SUBQUERY3_t1 .* FROM CC  AS SUBQUERY3_t1  JOIN CC  AS SUBQUERY3_t2  ON ( SUBQUERY3_t2 .col_int_nokey  = SUBQUERY3_t1 .col_int_key  )  WHERE SUBQUERY3_t1 .col_varchar_key  != SUBQUERY3_t2 .col_varchar_key  )  AS table3  ON ( table3 .col_varchar_key  = table2 .col_varchar_nokey  )  WHERE  EXISTS (  SELECT  MIN( SUBQUERY4_t2 .col_varchar_key  )  FROM C  AS SUBQUERY4_t1  JOIN C  AS SUBQUERY4_t2  ON ( SUBQUERY4_t2 .col_varchar_key  = SUBQUERY4_t1 .col_varchar_key  )  WHERE SUBQUERY4_t2 .pk  <= table2 .col_int_nokey  AND SUBQUERY4_t2 .col_int_key  < table1 .pk  )  OR table3 .col_varchar_key  >= table1 .col_varchar_key   ;

                                                                                                                    QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Nested Loop
   Join Filter: ((subquery2_t2.col_varchar_key)::text = (subquery2_t3.col_varchar_nokey)::text)
   ->  YB Batched Nested Loop Join
         Join Filter: (((subquery2_t2.col_varchar_nokey)::text = (subquery3_t1.col_varchar_key)::text) AND ((SubPlan 1) OR ((subquery3_t1.col_varchar_key)::text >= (table1.col_varchar_key)::text)))
         Sort Keys: table1.col_varchar_key
         ->  Nested Loop
               ->  Index Scan using c_varchar_key on c table1
               ->  Index Scan using c_varchar_key on c subquery2_t2
                     Index Cond: ((col_varchar_key)::text = (table1.col_varchar_key)::text)
         ->  YB Batched Nested Loop Join
               Join Filter: (((subquery3_t1.col_varchar_key)::text <> (subquery3_t2.col_varchar_key)::text) AND (subquery3_t1.col_int_key = subquery3_t2.col_int_nokey))
               ->  Seq Scan on cc subquery3_t2
               ->  Index Only Scan using cc_varchar_key on cc subquery3_t1
                     Index Cond: ((col_int_key = ANY (ARRAY[subquery3_t2.col_int_nokey, $1028, $1029, ..., $2050])) AND (col_varchar_key = ANY (ARRAY[(subquery2_t2.col_varchar_nokey)::text, ($2052)::text, ($2053)::text, ..., ($3074)::text])))
                     Filter: ((col_varchar_key)::text <> (subquery3_t2.col_varchar_key)::text)
         SubPlan 1
           ->  Aggregate
                 ->  YB Batched Nested Loop Join
                       Join Filter: ((subquery4_t1.col_varchar_key)::text = (subquery4_t2.col_varchar_key)::text)
                       ->  Index Scan using c_pkey on c subquery4_t2
                             Index Cond: (pk <= subquery2_t2.col_int_nokey)
                             Storage Filter: (col_int_key < table1.pk)
                       ->  Index Only Scan using c_varchar_key on c subquery4_t1
                             Index Cond: (col_varchar_key = ANY (ARRAY[(subquery4_t2.col_varchar_key)::text, ($3)::text, ($4)::text, ..., ($1025)::text]))
   ->  Seq Scan on c subquery2_t3
         Storage Filter: (pk <> 43)
(26 rows)

YB test#

Backtrace

(lldb) Process 55958 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00007ff809d65196 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`:
->  0x7ff809d65196 <+10>: jae    0x7ff809d651a0            ; <+20>
    0x7ff809d65198 <+12>: movq   %rax, %rdi
    0x7ff809d6519b <+15>: jmp    0x7ff809d5ec7b            ; cerror_nocancel
    0x7ff809d651a0 <+20>: retq
Target 0: (postgres) stopped.
(lldb)  bt
bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007ff809d65196 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007ff809d9cee6 libsystem_pthread.dylib`pthread_kill + 263
    frame #2: 0x00007ff809cc3b45 libsystem_c.dylib`abort + 123
    frame #3: 0x0000000104feeb9d postgres`ExceptionalCondition + 125 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/utils/error/assert.c:54
    frame #4: 0x0000000105058bc6 postgres`MemoryContextReset + 102 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/utils/mmgr/mcxt.c:346
    frame #5: 0x0000000104b579f7 postgres`ReScanExprContext + 39 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/execUtils.c:431
    frame #6: 0x0000000104b2a53c postgres`ExecReScan + 412 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/execAmi.c:129
    frame #7: 0x0000000104b687a1 postgres`ExecYbBatchedNestLoop + 1025 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/nodeYbBatchedNestloop.c:205
    frame #8: 0x0000000104b4fbe2 postgres`ExecProcNodeFirst + 82 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/execProcnode.c:459
    frame #9: 0x0000000104b65242 postgres`ExecProcNode + 50 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/include/executor/executor.h:273
    frame #10: 0x0000000104b650ec postgres`fetch_input_tuple + 156 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/nodeAgg.c:415
    frame #11: 0x0000000104b64d18 postgres`agg_retrieve_direct + 2328 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/nodeAgg.c:2119
    frame #12: 0x0000000104b613c0 postgres`ExecAgg + 240 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/nodeAgg.c:1824
    frame #13: 0x0000000104b4fbe2 postgres`ExecProcNodeFirst + 82 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/execProcnode.c:459
    frame #14: 0x0000000104b98192 postgres`ExecProcNode + 50 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/include/executor/executor.h:273
    frame #15: 0x0000000104b960ce postgres`ExecScanSubPlan + 638 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/nodeSubplan.c:325
    frame #16: 0x0000000104b95ae6 postgres`ExecSubPlan + 486 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/nodeSubplan.c:90
    frame #17: 0x0000000104b3c25a postgres`ExecEvalSubPlan + 58 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/execExprInterp.c:3823
    frame #18: 0x0000000104b369aa postgres`ExecInterpExpr + 9290 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/execExprInterp.c:1552
    frame #19: 0x0000000104b34087 postgres`ExecInterpExprStillValid + 71 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/execExprInterp.c:1825
    frame #20: 0x0000000104b6998b postgres`ExecEvalExprSwitchContext + 59 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/include/executor/executor.h:345
    frame #21: 0x0000000104b69832 postgres`ExecQual + 114 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/include/executor/executor.h:414
    frame #22: 0x0000000104b68d46 postgres`ExecYbBatchedNestLoop + 2470 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/nodeYbBatchedNestloop.c:312
    frame #23: 0x0000000104b4fbe2 postgres`ExecProcNodeFirst + 82 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/execProcnode.c:459
    frame #24: 0x0000000104b8df52 postgres`ExecProcNode + 50 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/include/executor/executor.h:273
    frame #25: 0x0000000104b8d9e2 postgres`ExecNestLoop + 178 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/nodeNestloop.c:109
    frame #26: 0x0000000104b4fbe2 postgres`ExecProcNodeFirst + 82 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/execProcnode.c:459
    frame #27: 0x0000000104b48672 postgres`ExecProcNode + 50 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/include/executor/executor.h:273
    frame #28: 0x0000000104b42dd1 postgres`ExecutePlan + 209 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/execMain.c:1726
    frame #29: 0x0000000104b42c81 postgres`standard_ExecutorRun + 657 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/execMain.c:357
    frame #30: 0x000000010b50e116 pg_stat_statements.so`pgss_ExecutorRun + 230 at /Users/mtakahara/code/yugabyte-db2/src/postgres/contrib/pg_stat_statements/pg_stat_statements.c:1311
    frame #31: 0x000000010b529533 yb_pg_metrics.so`ybpgm_ExecutorRun + 179 at /Users/mtakahara/code/yugabyte-db2/src/postgres/contrib/yb_pg_metrics/yb_pg_metrics.c:586
    frame #32: 0x0000000104b429c5 postgres`ExecutorRun + 69 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/executor/execMain.c:295
    frame #33: 0x0000000104ded885 postgres`PortalRunSelect + 309 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/tcop/pquery.c:960
    frame #34: 0x0000000104ded1a4 postgres`PortalRun + 804 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/tcop/pquery.c:789
    frame #35: 0x0000000104dea5ea postgres`exec_simple_query + 1546 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/tcop/postgres.c:1220
    frame #36: 0x0000000104de8075 postgres`yb_exec_simple_query_impl + 21 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/tcop/postgres.c:4738
    frame #37: 0x0000000104de81da postgres`yb_exec_query_wrapper_one_attempt + 346 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/tcop/postgres.c:4706
    frame #38: 0x0000000104de804a postgres`yb_exec_query_wrapper + 74 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/tcop/postgres.c:4730
    frame #39: 0x0000000104de32c5 postgres`yb_exec_simple_query + 69 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/tcop/postgres.c:4753
    frame #40: 0x0000000104de1b8e postgres`PostgresMain + 2910 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/tcop/postgres.c:5378
    frame #41: 0x0000000104cff865 postgres`BackendRun + 933 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/postmaster/postmaster.c:4736
    frame #42: 0x0000000104cfe90f postgres`BackendStartup + 703 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/postmaster/postmaster.c:4400
    frame #43: 0x0000000104cfd2c0 postgres`ServerLoop + 992 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/postmaster/postmaster.c:1778
    frame #44: 0x0000000104cf984e postgres`PostmasterMain + 7566 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/postmaster/postmaster.c:1434
    frame #45: 0x0000000104beb2fb postgres`PostgresServerProcessMain + 779 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/main/main.c:234
    frame #46: 0x0000000104beb8b2 postgres`main + 34
    frame #47: 0x00007ff809a4341f dyld`start + 1903
(lldb) f 3
f 3
frame #3: 0x0000000104feeb9d postgres`ExceptionalCondition + 125 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/utils/error/assert.c:54
   51  		sleep(1000000);
   52  	#endif
   53
-> 54  		abort();
    		^
   55  	}
(lldb) up
up
frame #4: 0x0000000105058bc6 postgres`MemoryContextReset + 102 at /Users/mtakahara/code/yugabyte-db2/src/postgres/src/backend/utils/mmgr/mcxt.c:346
   343 	void
   344 	MemoryContextReset(MemoryContext context)
   345 	{
-> 346 		AssertArg(MemoryContextIsValid(context));
    		^
   347
   348 		/* save a function call in common case where there are no children */
   349 		if (context->firstchild != NULL)
(lldb) det

Test Case

CREATE TABLE public.c (
pk integer NOT NULL,
col_int_nokey integer,
col_int_key integer,
col_varchar_key character varying(1),
col_varchar_nokey character varying(1),
CONSTRAINT c_pkey PRIMARY KEY(pk ASC)
);

CREATE TABLE public.cc (
pk integer NOT NULL,
col_int_nokey integer,
col_int_key integer,
col_varchar_key character varying(1),
col_varchar_nokey character varying(1),
CONSTRAINT cc_pkey PRIMARY KEY(pk ASC)
);

COPY public.c (pk, col_int_nokey, col_int_key, col_varchar_key, col_varchar_nokey) FROM stdin;
1 2 4 v v
2 150 62 v v
3 \N 7 c c
4 2 1 \N \N
5 5 0 x x
6 3 7 i i
7 1 7 e e
8 4 1 p p
9 \N 7 s s
10 2 1 j j
11 6 5 z z
12 6 2 c c
13 8 0 a a
14 2 1 q q
15 6 8 y y
16 8 1 \N \N
17 3 1 r r
18 3 9 v v
19 9 1 \N \N
20 6 5 r r
.

COPY public.cc (pk, col_int_nokey, col_int_key, col_varchar_key, col_varchar_nokey) FROM stdin;
10 \N 8 x x
11 8 7 d d
12 1 1 r r
13 9 7 f f
14 4 9 y y
15 3 \N u u
16 2 1 m m
17 \N 9 \N \N
18 2 2 o o
19 \N 9 w w
20 6 2 m m
21 7 4 q q
22 2 0 \N \N
23 5 4 d d
24 7 8 g g
25 6 \N x x
26 6 \N f f
27 2 0 p p
28 9 \N j j
29 6 8 c c
.

CREATE INDEX c_varchar_key ON public.c (col_varchar_key ASC, col_int_key ASC);
CREATE INDEX cc_varchar_key ON public.cc (col_varchar_key ASC, col_int_key ASC);

/+ Set(enable_hashjoin off) Set(enable_mergejoin off) Set(enable_material off) /
SELECT
FROM
C AS table1
JOIN (
SELECT
SUBQUERY2_t2.

FROM
C AS SUBQUERY2_t2
JOIN C AS SUBQUERY2_t3 ON (
SUBQUERY2_t3.col_varchar_nokey = SUBQUERY2_t2.col_varchar_key
)
WHERE
SUBQUERY2_t3.pk <> 43
)
AS table2 ON (
table2.col_varchar_key = table1.col_varchar_key
)
JOIN (
SELECT
SUBQUERY3_t1.

FROM
CC AS SUBQUERY3_t1
JOIN CC AS SUBQUERY3_t2 ON (
SUBQUERY3_t2.col_int_nokey = SUBQUERY3_t1.col_int_key
)
WHERE
SUBQUERY3_t1.col_varchar_key != SUBQUERY3_t2.col_varchar_key
)
AS table3 ON (
table3.col_varchar_key = table2.col_varchar_nokey
)
WHERE
EXISTS (
SELECT
MIN (
SUBQUERY4_t2.col_varchar_key
)
FROM
C AS SUBQUERY4_t1
JOIN C AS SUBQUERY4_t2 ON (
SUBQUERY4_t2.col_varchar_key = SUBQUERY4_t1.col_varchar_key
)
WHERE
SUBQUERY4_t2.pk <= table2.col_int_nokey
AND
SUBQUERY4_t2.col_int_key < table1.pk
)
OR
table3.col_varchar_key >= table1.col_varchar_key
;

  

### Issue Type

kind/bug

### Warning: Please confirm that this issue does not contain any sensitive information

- [X] I confirm this issue does not contain any sensitive information.

[DB-10208]: https://yugabyte.atlassian.net/browse/DB-10208?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
@mtakahar mtakahar added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Mar 4, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Mar 4, 2024
@mtakahar mtakahar changed the title [YSQL][randgen] Invalid memory conetxt assertion failure: MemoryContextReset + 102 at .../src/postgres/src/backend/utils/mmgr/mcxt.c:346 [YSQL][randgen] Memory conetxt assertion failure: MemoryContextReset + 102 at .../src/postgres/src/backend/utils/mmgr/mcxt.c:346 Mar 4, 2024
@mtakahar mtakahar changed the title [YSQL][randgen] Memory conetxt assertion failure: MemoryContextReset + 102 at .../src/postgres/src/backend/utils/mmgr/mcxt.c:346 [YSQL][randgen] REGRESSION: Memory conetxt assertion failure: MemoryContextReset + 102 at .../src/postgres/src/backend/utils/mmgr/mcxt.c:346 Mar 4, 2024
@sushantrmishra sushantrmishra removed the status/awaiting-triage Issue awaiting triage label Mar 4, 2024
@mtakahar mtakahar changed the title [YSQL][randgen] REGRESSION: Memory conetxt assertion failure: MemoryContextReset + 102 at .../src/postgres/src/backend/utils/mmgr/mcxt.c:346 [YSQL][randgen] Memory conetxt assertion failure: MemoryContextReset + 102 at .../src/postgres/src/backend/utils/mmgr/mcxt.c:346 Mar 14, 2024
tanujnay112 added a commit that referenced this issue Mar 15, 2024
Summary:
This change fixes a bug where we would not detect some unbatchable filters when forming an indexpath if the indexpath acceptable batched values from more than one relation.

Needs backports to 2.20 and 2.18
Jira: DB-10208

Test Plan: ./yb_buid.sh --java-test "org.yb.pgsql.TestPgRegressJoin'

Reviewers: mtakahara

Reviewed By: mtakahara

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D33179
asrinivasanyb pushed a commit to asrinivasanyb/yugabyte-db that referenced this issue Mar 18, 2024
Summary:
This change fixes a bug where we would not detect some unbatchable filters when forming an indexpath if the indexpath acceptable batched values from more than one relation.

Needs backports to 2.20 and 2.18
Jira: DB-10208

Test Plan: ./yb_buid.sh --java-test "org.yb.pgsql.TestPgRegressJoin'

Reviewers: mtakahara

Reviewed By: mtakahara

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D33179
tanujnay112 added a commit that referenced this issue Mar 22, 2024
Summary:
Original commit: ad87ceb / D33179
This change fixes a bug where we would not detect some unbatchable filters when forming an indexpath if the indexpath acceptable batched values from more than one relation.

Needs backports to 2.20 and 2.18
Jira: DB-10208

Test Plan: ./yb_buid.sh --java-test "org.yb.pgsql.TestPgRegressJoin'

Reviewers: mtakahara

Reviewed By: mtakahara

Subscribers: yql

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D33228
tanujnay112 added a commit that referenced this issue Mar 22, 2024
Summary:
Original commit: ad87ceb / D33179
This change fixes a bug where we would not detect some unbatchable filters when forming an indexpath if the indexpath acceptable batched values from more than one relation.

Needs backports to 2.20 and 2.18
Jira: DB-10208

Test Plan: ./yb_buid.sh --java-test "org.yb.pgsql.TestPgRegressJoin'

Reviewers: mtakahara

Reviewed By: mtakahara

Subscribers: yql

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D33199
tanujnay112 added a commit that referenced this issue Mar 22, 2024
Summary:
Original commit: ad87ceb / D33179
This change fixes a bug where we would not detect some unbatchable filters when forming an indexpath if the indexpath acceptable batched values from more than one relation.

Needs backports to 2.20 and 2.18
Jira: DB-10208

Test Plan: ./yb_buid.sh --java-test "org.yb.pgsql.TestPgRegressJoin'

Reviewers: mtakahara

Reviewed By: mtakahara

Subscribers: yql

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D33200
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 priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

4 participants