Re: [Proposal] Global temporary tables

From: 曾文旌 <wenjing(dot)zwj(at)alibaba-inc(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: wenjing <wenjing(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>, "movead(dot)li(at)highgo(dot)ca" <movead(dot)li(at)highgo(dot)ca>, Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com>, tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [Proposal] Global temporary tables
Date: 2021-03-29 09:55:05
Message-ID: 4F3C5150-940A-42AF-8B9F-EA093D864174@alibaba-inc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 2021年3月28日 15:27,Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> 写道:
>
> Hi
>
> st 17. 3. 2021 v 12:59 odesílatel wenjing <wjzeng2012(at)gmail(dot)com <mailto:wjzeng2012(at)gmail(dot)com>> napsal:
> ok
>
> The cause of the problem is that the name of the dependent function (readNextTransactionID) has changed. I fixed it.
>
> This patch(V43) is base on 9fd2952cf4920d563e9cea51634c5b364d57f71a
>
> Wenjing
>
> I tested this patch and make check-world fails
>
> make[2]: Vstupuje se do adresáře „/home/pavel/src/postgresql.master/src/test/recovery“
> rm -rf '/home/pavel/src/postgresql.master/src/test/recovery'/tmp_check
> /usr/bin/mkdir -p '/home/pavel/src/postgresql.master/src/test/recovery'/tmp_check
> cd . && TESTDIR='/home/pavel/src/postgresql.master/src/test/recovery' PATH="/home/pavel/src/postgresql.master/tmp_install/usr/local/pgsql/master/bin:$PATH" LD_LIBRARY_PATH="/home/pavel/src/postgresql.master/tmp_install/usr/local/pgsql/master/lib" PGPORT='65432' PG_REGRESS='/home/pavel/src/postgresql.master/src/test/recovery/../../../src/test/regress/pg_regress' REGRESS_SHLIB='/home/pavel/src/postgresql.master/src/test/regress/regress.so' /usr/bin/prove -I ../../../src/test/perl/ -I . t/*.pl
> t/001_stream_rep.pl <http://001_stream_rep.pl/> .................. ok
> t/002_archiving.pl <http://002_archiving.pl/> ................... ok
> t/003_recovery_targets.pl <http://003_recovery_targets.pl/> ............ ok
> t/004_timeline_switch.pl <http://004_timeline_switch.pl/> ............. ok
> t/005_replay_delay.pl <http://005_replay_delay.pl/> ................ ok
> t/006_logical_decoding.pl <http://006_logical_decoding.pl/> ............ ok
> t/007_sync_rep.pl <http://007_sync_rep.pl/> .................... ok
> t/008_fsm_truncation.pl <http://008_fsm_truncation.pl/> .............. ok
> t/009_twophase.pl <http://009_twophase.pl/> .................... ok
> t/010_logical_decoding_timelines.pl <http://010_logical_decoding_timelines.pl/> .. ok
> t/011_crash_recovery.pl <http://011_crash_recovery.pl/> .............. ok
> t/012_subtransactions.pl <http://012_subtransactions.pl/> ............. ok
> t/013_crash_restart.pl <http://013_crash_restart.pl/> ............... ok
> t/014_unlogged_reinit.pl <http://014_unlogged_reinit.pl/> ............. ok
> t/015_promotion_pages.pl <http://015_promotion_pages.pl/> ............. ok
> t/016_min_consistency.pl <http://016_min_consistency.pl/> ............. ok
> t/017_shm.pl <http://017_shm.pl/> ......................... skipped: SysV shared memory not supported by this platform
> t/018_wal_optimize.pl <http://018_wal_optimize.pl/> ................ ok
> t/019_replslot_limit.pl <http://019_replslot_limit.pl/> .............. ok
> t/020_archive_status.pl <http://020_archive_status.pl/> .............. ok
> t/021_row_visibility.pl <http://021_row_visibility.pl/> .............. ok
> t/022_crash_temp_files.pl <http://022_crash_temp_files.pl/> ............ 1/9
> # Failed test 'one temporary file'
> # at t/022_crash_temp_files.pl <http://022_crash_temp_files.pl/> line 231.
> # got: '0'
> # expected: '1'
> t/022_crash_temp_files.pl <http://022_crash_temp_files.pl/> ............ 9/9 # Looks like you failed 1 test of 9.
> t/022_crash_temp_files.pl <http://022_crash_temp_files.pl/> ............ Dubious, test returned 1 (wstat 256, 0x100)
> Failed 1/9 subtests
> t/023_pitr_prepared_xact.pl <http://023_pitr_prepared_xact.pl/> .......... ok
>
> Test Summary Report
> -------------------
> t/022_crash_temp_files.pl <http://022_crash_temp_files.pl/> (Wstat: 256 Tests: 9 Failed: 1)
> Failed test: 8
> Non-zero exit status: 1
> Files=23, Tests=259, 115 wallclock secs ( 0.21 usr 0.06 sys + 28.57 cusr 18.01 csys = 46.85 CPU)
> Result: FAIL
> make[2]: *** [Makefile:19: check] Chyba 1
> make[2]: Opouští se adresář „/home/pavel/src/postgresql.master/src/test/recovery“
> make[1]: *** [Makefile:49: check-recovery-recurse] Chyba 2
> make[1]: Opouští se adresář „/home/pavel/src/postgresql.master/src/test“
> make: *** [GNUmakefile:71: check-world-src/test-recurse] Chyba 2

This is because part of the logic of GTT is duplicated with the new commid cd91de0d17952b5763466cfa663e98318f26d357
that is commit by Tomas Vondra merge 11 days ago: "Remove Temporary Files after Backend Crash”.
The "Remove Temporary Files after Backend Crash” is exactly what GTT needs, or even better.
Therefore, I chose to delete the temporary file cleanup logic in the GTT path.

Let me update a new version.

Wenjing

>
> Regards
>
> Pavel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2021-03-29 09:59:48 Re: Idea: Avoid JOINs by using path expressions to follow FKs
Previous Message Markus Wanner 2021-03-29 09:53:20 Re: [PATCH] add concurrent_abort callback for output plugin