Re: [Proposal] Global temporary tables

From: Andrew Bille <andrewbille(at)gmail(dot)com>
To: wenjing <wenjing(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Tony Zhu <tony(dot)zhu(at)ww-it(dot)cn>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [Proposal] Global temporary tables
Date: 2021-10-22 09:11:25
Message-ID: CAJnzarxgnm3wQhRHE=jWzV-e2CaNJ_U_Z8wA_Z7z7eaw-8yHgQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks, the vacuum is fixed

But I found another crash (on v57 patches), reproduced with:

psql -t -c "create global temp table t (a integer); insert into t values
(1); select count(*) from t group by t;"
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
connection to server was lost

with trace:

[New LWP 2580215]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `postgres: andrew postgres [local] SELECT
'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig(at)entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig(at)entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f258d482859 in __GI_abort () at abort.c:79
#2 0x000055ad0be8878f in ExceptionalCondition
(conditionName=conditionName(at)entry=0x55ad0bf19743
"gtt_rnode->att_stat_tups[i]", errorType=errorType(at)entry=0x55ad0bee500b
"FailedAssertion", fileName=fileName(at)entry=0x55ad0bf1966b "storage_gtt.c",
lineNumber=lineNumber(at)entry=902) at assert.c:69
#3 0x000055ad0ba9379f in get_gtt_att_statistic (reloid=<optimized out>,
attnum=0, inh=<optimized out>) at storage_gtt.c:902
#4 0x000055ad0be35625 in examine_simple_variable
(root=root(at)entry=0x55ad0c498748,
var=var(at)entry=0x55ad0c498c68, vardata=vardata(at)entry=0x7fff06c9ebf0) at
selfuncs.c:5391
#5 0x000055ad0be36a89 in examine_variable (root=root(at)entry=0x55ad0c498748,
node=node(at)entry=0x55ad0c498c68, varRelid=varRelid(at)entry=0,
vardata=vardata(at)entry=0x7fff06c9ebf0) at selfuncs.c:4990
#6 0x000055ad0be3ad64 in estimate_num_groups (root=root(at)entry=0x55ad0c498748,
groupExprs=<optimized out>, input_rows=input_rows(at)entry=255,
pgset=pgset(at)entry=0x0, estinfo=estinfo(at)entry=0x0) at selfuncs.c:3455
#7 0x000055ad0bc50835 in get_number_of_groups (root=root(at)entry=0x55ad0c498748,
path_rows=255, gd=gd(at)entry=0x0, target_list=0x55ad0c498bb8) at
planner.c:3241
#8 0x000055ad0bc5576f in create_ordinary_grouping_paths
(root=root(at)entry=0x55ad0c498748,
input_rel=input_rel(at)entry=0x55ad0c3ce148,
grouped_rel=grouped_rel(at)entry=0x55ad0c4983f0,
agg_costs=agg_costs(at)entry=0x7fff06c9edb0, gd=gd(at)entry=0x0,
extra=extra(at)entry=0x7fff06c9ede0,
partially_grouped_rel_p=0x7fff06c9eda8)
at planner.c:3628
#9 0x000055ad0bc55a72 in create_grouping_paths
(root=root(at)entry=0x55ad0c498748,
input_rel=input_rel(at)entry=0x55ad0c3ce148, target=target(at)entry=0x55ad0c4c95d8,
target_parallel_safe=target_parallel_safe(at)entry=true, gd=gd(at)entry=0x0) at
planner.c:3377
#10 0x000055ad0bc5686d in grouping_planner (root=root(at)entry=0x55ad0c498748,
tuple_fraction=<optimized out>, tuple_fraction(at)entry=0) at planner.c:1592
#11 0x000055ad0bc57910 in subquery_planner (glob=glob(at)entry=0x55ad0c497880,
parse=parse(at)entry=0x55ad0c3cdbb8, parent_root=parent_root(at)entry=0x0,
hasRecursion=hasRecursion(at)entry=false, tuple_fraction=tuple_fraction(at)entry=0)
at planner.c:1025
#12 0x000055ad0bc57f36 in standard_planner (parse=0x55ad0c3cdbb8,
query_string=<optimized out>, cursorOptions=2048, boundParams=0x0) at
planner.c:406
#13 0x000055ad0bc584d4 in planner (parse=parse(at)entry=0x55ad0c3cdbb8,
query_string=query_string(at)entry=0x55ad0c3cc470 "create global temp table t
(a integer); insert into t values (1); select count(*) from t group by t;",
cursorOptions=cursorOptions(at)entry=2048, boundParams=boundParams(at)entry=0x0)
at planner.c:277
#14 0x000055ad0bd4855f in pg_plan_query
(querytree=querytree(at)entry=0x55ad0c3cdbb8,
query_string=query_string(at)entry=0x55ad0c3cc470 "create global temp table t
(a integer); insert into t values (1); select count(*) from t group by t;",
cursorOptions=cursorOptions(at)entry=2048, boundParams=boundParams(at)entry=0x0)
at postgres.c:847
#15 0x000055ad0bd4863b in pg_plan_queries (querytrees=0x55ad0c4986f0,
query_string=query_string(at)entry=0x55ad0c3cc470 "create global temp table t
(a integer); insert into t values (1); select count(*) from t group by t;",
cursorOptions=cursorOptions(at)entry=2048, boundParams=boundParams(at)entry=0x0)
at postgres.c:939
#16 0x000055ad0bd48b20 in exec_simple_query
(query_string=query_string(at)entry=0x55ad0c3cc470
"create global temp table t (a integer); insert into t values (1); select
count(*) from t group by t;") at postgres.c:1133
#17 0x000055ad0bd4aaf3 in PostgresMain (dbname=<optimized out>,
username=<optimized out>) at postgres.c:4497
#18 0x000055ad0bca3f91 in BackendRun (port=port(at)entry=0x55ad0c3f1020) at
postmaster.c:4560
#19 0x000055ad0bca7115 in BackendStartup (port=port(at)entry=0x55ad0c3f1020)
at postmaster.c:4288
#20 0x000055ad0bca735c in ServerLoop () at postmaster.c:1801
#21 0x000055ad0bca893e in PostmasterMain (argc=3, argv=<optimized out>) at
postmaster.c:1473
#22 0x000055ad0bbe8e31 in main (argc=3, argv=0x55ad0c3c6660) at main.c:198

On Thu, Oct 21, 2021 at 4:25 PM wenjing <wjzeng2012(at)gmail(dot)com> wrote:

>
>
> Andrew Bille <andrewbille(at)gmail(dot)com> 于2021年10月20日周三 上午2:59写道:
>
>> Another thanks for the fix. It works for me.
>>
>> But I found another crash!
>>
> This is a check code that was added this year, but it did find a problem
> and I fixed it.
> Please review the new code(v57) again.
>
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-10-22 09:24:36 Re: [PATCH] Fix memory corruption in pg_shdepend.c
Previous Message Rafia Sabih 2021-10-22 08:22:54 Add connection active, idle time to pg_stat_activity