agora inbox for [email protected]help / color / mirror / Atom feed
Re: [Proposal] Global temporary tables 1038+ messages / 9 participants [nested] [flat]
* Re: [Proposal] Global temporary tables @ 2020-01-05 20:06 Tomas Vondra <[email protected]> 0 siblings, 2 replies; 1038+ messages in thread From: Tomas Vondra @ 2020-01-05 20:06 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> Hi, I think we need to do something with having two patches aiming to add global temporary tables: [1] https://commitfest.postgresql.org/26/2349/ [2] https://commitfest.postgresql.org/26/2233/ As a reviewer I have no idea which of the threads to look at - certainly not without reading both threads, which I doubt anyone will really do. The reviews and discussions are somewhat intermixed between those two threads, which makes it even more confusing. I think we should agree on a minimal patch combining the necessary/good bits from the various patches, and terminate one of the threads (i.e. mark it as rejected or RWF). And we need to do that now, otherwise there's about 0% chance of getting this into v13. In general, I agree with the sentiment Rober expressed in [1] - the patch needs to be as small as possible, not adding "nice to have" features (like support for parallel queries - I very much doubt just using shared instead of local buffers is enough to make it work.) regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-06 05:04 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Tomas Vondra <[email protected]> 1 sibling, 2 replies; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-06 05:04 UTC (permalink / raw) To: Tomas Vondra <[email protected]>; +Cc: Konstantin Knizhnik <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> In the previous communication 1 we agreed on the general direction 1.1 gtt use local (private) buffer 1.2 no replica access in first version 2 We feel that gtt needs to maintain statistics, but there is no agreement on what it will be done. 3 Still no one commented on GTT's transaction information processing, they include 3.1 Should gtt's frozenxid need to be care? 3.2 gtt’s clog clean 3.3 How to deal with "too old" gtt data I suggest we discuss further, reach an agreement, and merge the two patches to one. Wenjing > 2020年1月6日 上午4:06,Tomas Vondra <[email protected]> 写道: > > Hi, > > I think we need to do something with having two patches aiming to add > global temporary tables: > > [1] https://commitfest.postgresql.org/26/2349/ > > [2] https://commitfest.postgresql.org/26/2233/ > > As a reviewer I have no idea which of the threads to look at - certainly > not without reading both threads, which I doubt anyone will really do. > The reviews and discussions are somewhat intermixed between those two > threads, which makes it even more confusing. > > I think we should agree on a minimal patch combining the necessary/good > bits from the various patches, and terminate one of the threads (i.e. > mark it as rejected or RWF). And we need to do that now, otherwise > there's about 0% chance of getting this into v13. > > In general, I agree with the sentiment Rober expressed in [1] - the > patch needs to be as small as possible, not adding "nice to have" > features (like support for parallel queries - I very much doubt just > using shared instead of local buffers is enough to make it work.) > > regards > > -- > Tomas Vondra http://www.2ndQuadrant.com > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-06 11:01 Tomas Vondra <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 1 sibling, 2 replies; 1038+ messages in thread From: Tomas Vondra @ 2020-01-06 11:01 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Konstantin Knizhnik <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Mon, Jan 06, 2020 at 01:04:15PM +0800, 曾文旌(义从) wrote: >In the previous communication > >1 we agreed on the general direction >1.1 gtt use local (private) buffer >1.2 no replica access in first version > OK, good. >2 We feel that gtt needs to maintain statistics, but there is no >agreement on what it will be done. > I certainly agree GTT needs to maintain statistics, otherwise it'll lead to poor query plans. AFAIK the current patch stores the info in a hash table in a backend private memory, and I don't see how else to do that (e.g. storing it in a catalog would cause catalog bloat). FWIW this is a reasons why I think just using shared buffers (instead of local ones) is not sufficient to support parallel queriesl as proposed by Alexander. The workers would not know the stats, breaking planning of queries in PARALLEL SAFE plpgsql functions etc. >3 Still no one commented on GTT's transaction information processing, they include >3.1 Should gtt's frozenxid need to be care? >3.2 gtt’s clog clean >3.3 How to deal with "too old" gtt data > No idea what to do about this. >I suggest we discuss further, reach an agreement, and merge the two patches to one. > OK, cool. Thanks for the clarification. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-06 12:17 Dean Rasheed <[email protected]> parent: Tomas Vondra <[email protected]> 1 sibling, 3 replies; 1038+ messages in thread From: Dean Rasheed @ 2020-01-06 12:17 UTC (permalink / raw) To: Tomas Vondra <[email protected]>; +Cc: 曾文旌(义从) <[email protected]>; Konstantin Knizhnik <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Mon, 6 Jan 2020 at 11:01, Tomas Vondra <[email protected]> wrote: > > On Mon, Jan 06, 2020 at 01:04:15PM +0800, 曾文旌(义从) wrote: > > >2 We feel that gtt needs to maintain statistics, but there is no > >agreement on what it will be done. > > > > I certainly agree GTT needs to maintain statistics, otherwise it'll lead > to poor query plans. +1 > AFAIK the current patch stores the info in a hash > table in a backend private memory, and I don't see how else to do that > (e.g. storing it in a catalog would cause catalog bloat). > It sounds like it needs a pair of system GTTs to hold the table and column statistics for other GTTs. One would probably have the same columns as pg_statistic, and the other just the relevant columns from pg_class. I can see it being useful for the user to be able to see these stats, so perhaps they could be UNIONed into the existing stats view. Regards, Dean ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-06 12:52 Tomas Vondra <[email protected]> parent: Dean Rasheed <[email protected]> 2 siblings, 0 replies; 1038+ messages in thread From: Tomas Vondra @ 2020-01-06 12:52 UTC (permalink / raw) To: Dean Rasheed <[email protected]>; +Cc: 曾文旌(义从) <[email protected]>; Konstantin Knizhnik <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Mon, Jan 06, 2020 at 12:17:43PM +0000, Dean Rasheed wrote: >On Mon, 6 Jan 2020 at 11:01, Tomas Vondra <[email protected]> wrote: >> >> On Mon, Jan 06, 2020 at 01:04:15PM +0800, 曾文旌(义从) wrote: >> >> >2 We feel that gtt needs to maintain statistics, but there is no >> >agreement on what it will be done. >> > >> >> I certainly agree GTT needs to maintain statistics, otherwise it'll lead >> to poor query plans. > >+1 > >> AFAIK the current patch stores the info in a hash >> table in a backend private memory, and I don't see how else to do that >> (e.g. storing it in a catalog would cause catalog bloat). >> > >It sounds like it needs a pair of system GTTs to hold the table and >column statistics for other GTTs. One would probably have the same >columns as pg_statistic, and the other just the relevant columns from >pg_class. I can see it being useful for the user to be able to see >these stats, so perhaps they could be UNIONed into the existing stats >view. > Hmmm, yeah. A "temporary catalog" (not sure if it can work exactly the same as GTT) storing pg_statistics data for GTTs might work, I think. It would not have the catalog bloat issue, which is good. I still think we'd need to integrate this with the regular pg_statistic catalogs somehow, so that people don't have to care about two things. I mean, extensions like hypopg do use pg_statistic data to propose indexes etc. and it would be nice if we don't make them more complicated. Not sure why we'd need a temporary version of pg_class, though? regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-06 13:50 Pavel Stehule <[email protected]> parent: Dean Rasheed <[email protected]> 2 siblings, 0 replies; 1038+ messages in thread From: Pavel Stehule @ 2020-01-06 13:50 UTC (permalink / raw) To: Dean Rasheed <[email protected]>; +Cc: Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> po 6. 1. 2020 v 13:17 odesílatel Dean Rasheed <[email protected]> napsal: > On Mon, 6 Jan 2020 at 11:01, Tomas Vondra <[email protected]> > wrote: > > > > On Mon, Jan 06, 2020 at 01:04:15PM +0800, 曾文旌(义从) wrote: > > > > >2 We feel that gtt needs to maintain statistics, but there is no > > >agreement on what it will be done. > > > > > > > I certainly agree GTT needs to maintain statistics, otherwise it'll lead > > to poor query plans. > > +1 > > > AFAIK the current patch stores the info in a hash > > table in a backend private memory, and I don't see how else to do that > > (e.g. storing it in a catalog would cause catalog bloat). > > > > It sounds like it needs a pair of system GTTs to hold the table and > column statistics for other GTTs. One would probably have the same > columns as pg_statistic, and the other just the relevant columns from > pg_class. I can see it being useful for the user to be able to see > these stats, so perhaps they could be UNIONed into the existing stats > view. > +1 Pavel > Regards, > Dean > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-08 07:03 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Dean Rasheed <[email protected]> 2 siblings, 0 replies; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-08 07:03 UTC (permalink / raw) To: Dean Rasheed <[email protected]>; +Cc: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月6日 下午8:17,Dean Rasheed <[email protected]> 写道: > > On Mon, 6 Jan 2020 at 11:01, Tomas Vondra <[email protected]> wrote: >> >> On Mon, Jan 06, 2020 at 01:04:15PM +0800, 曾文旌(义从) wrote: >> >>> 2 We feel that gtt needs to maintain statistics, but there is no >>> agreement on what it will be done. >>> >> >> I certainly agree GTT needs to maintain statistics, otherwise it'll lead >> to poor query plans. > > +1 > >> AFAIK the current patch stores the info in a hash >> table in a backend private memory, and I don't see how else to do that >> (e.g. storing it in a catalog would cause catalog bloat). >> > > It sounds like it needs a pair of system GTTs to hold the table and > column statistics for other GTTs. One would probably have the same > columns as pg_statistic, and the other just the relevant columns from > pg_class. I can see it being useful for the user to be able to see > these stats, so perhaps they could be UNIONed into the existing stats > view. The current patch provides several functions as extension(pg_gtt) for read gtt statistics. Next I can move them to the kernel and let the view pg_stats can see gtt’s statistics. > Regards, > Dean ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-09 11:17 Konstantin Knizhnik <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-09 11:17 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; Tomas Vondra <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 06.01.2020 8:04, 曾文旌(义从) wrote: > In the previous communication > > 1 we agreed on the general direction > 1.1 gtt use local (private) buffer > 1.2 no replica access in first version > > 2 We feel that gtt needs to maintain statistics, but there is no agreement on what it will be done. > > 3 Still no one commented on GTT's transaction information processing, they include > 3.1 Should gtt's frozenxid need to be care? > 3.2 gtt’s clog clean > 3.3 How to deal with "too old" gtt data > > I suggest we discuss further, reach an agreement, and merge the two patches to one. > I also hope that we should come to the common solution for GTT. If we do not try to address parallel execution issues and access to temp tables at replicas (and I agreed that it should be avoided in first version of the patch), then GTT patch becomes quite small. The most complex and challenged task is to support GTT for all kind of indexes. Unfortunately I can not proposed some good universal solution for it. Just patching all existed indexes implementation seems to be the only choice. Statistic is another important case. But once again I do not completely understand why we want to address all this issues with statistic in first version of the patch? It contradicts to the idea to make this patch as small as possible. Also it seems to me that everybody agreed that users very rarely create indexes for temp tables and explicitly analyze them. So I think GTT will be useful even with limited support of statistic. In my version statistics for GTT is provided by pushing correspondent information to backend's cache for pg_statistic table. Also I provided pg_temp_statistic view for inspecting it by users. The idea to make pg_statistic a view which combines statistic of normal and temporary tables is overkill from my point of view. I do not understand why do we need to maintain hash with some extra information for GTT in backends memory (as it was done in Wenjing patch). Also idea to use create extension for accessing this information seems to be dubious. -- Konstantin Knizhnik Postgres Professional:http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-09 15:07 Konstantin Knizhnik <[email protected]> parent: Tomas Vondra <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-09 15:07 UTC (permalink / raw) To: Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 06.01.2020 14:01, Tomas Vondra wrote: > On Mon, Jan 06, 2020 at 01:04:15PM +0800, 曾文旌(义从) wrote: >> In the previous communication >> >> 1 we agreed on the general direction >> 1.1 gtt use local (private) buffer >> 1.2 no replica access in first version >> > > OK, good. > >> 2 We feel that gtt needs to maintain statistics, but there is no >> agreement on what it will be done. >> > > I certainly agree GTT needs to maintain statistics, otherwise it'll lead > to poor query plans. AFAIK the current patch stores the info in a hash > table in a backend private memory, and I don't see how else to do that > (e.g. storing it in a catalog would cause catalog bloat). > > FWIW this is a reasons why I think just using shared buffers (instead of > local ones) is not sufficient to support parallel queriesl as proposed > by Alexander. The workers would not know the stats, breaking planning of > queries in PARALLEL SAFE plpgsql functions etc. I do not think that "all or nothing" approach is so good for software development as for database transactions. Yes, if we have function in PL/pgSQL which performs queries om temporary tables, then parallel workers may build inefficient plan for this queries due to lack of statistics. From my point of view this is not a pitfall of GTT but result of lack of global plan cache in Postgres. And it should be fixed not at GTT level. Also I never see real use cases with such functions, even in the systems which using hard temporary tables and stored procedures. But there are many other real problems with temp tables (except already mentioned in this thread). In PgPro/EE we have fixes for some of them, for example: 1. Do not reserve space in the file for temp relations. Right now append of relation cause writing zero page to the disk by mdextend. It cause useless disk IO for temp tables which in most cases fit in memory and should not be written at disk. 2. Implicitly perform analyze of temp table intermediately after storing data in it. Usually tables are analyzed by autovacuum in background. But it doesn't work for temp tables which are not processes by autovacuum and are accessed immediately after filling them with data and lack of statistic may cause building very inefficient plan. We have online_analyze extension which force analyze of the table after appending some bulk of data to it. It can be used for normal table but most of all it is useful for temp relations. Unlike hypothetical example with parallel safe function working with temp tables, this are real problems observed by some of our customers. Them are applicable both to local and global temp tables and this is why I do not want to discuss them in context of GTT. > >> 3 Still no one commented on GTT's transaction information processing, >> they include >> 3.1 Should gtt's frozenxid need to be care? >> 3.2 gtt’s clog clean >> 3.3 How to deal with "too old" gtt data >> > > No idea what to do about this. > I wonder what is the specific of GTT here? The same problem takes place for normal (local) temp tables, doesn't it? -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-09 16:30 Tomas Vondra <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Tomas Vondra @ 2020-01-09 16:30 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Thu, Jan 09, 2020 at 06:07:46PM +0300, Konstantin Knizhnik wrote: > > >On 06.01.2020 14:01, Tomas Vondra wrote: >>On Mon, Jan 06, 2020 at 01:04:15PM +0800, 曾文旌(义从) wrote: >>>In the previous communication >>> >>>1 we agreed on the general direction 1.1 gtt use local (private) >>>buffer 1.2 no replica access in first version >>> >> >>OK, good. >> >>>2 We feel that gtt needs to maintain statistics, but there is no >>>agreement on what it will be done. >>> >> >>I certainly agree GTT needs to maintain statistics, otherwise it'll >>lead to poor query plans. AFAIK the current patch stores the info in a >>hash table in a backend private memory, and I don't see how else to do >>that (e.g. storing it in a catalog would cause catalog bloat). >> >>FWIW this is a reasons why I think just using shared buffers (instead >>of local ones) is not sufficient to support parallel queriesl as >>proposed by Alexander. The workers would not know the stats, breaking >>planning of queries in PARALLEL SAFE plpgsql functions etc. > > >I do not think that "all or nothing" approach is so good for software >development as for database transactions. Well, sure. I'm not saying we need to have a perfect solution in v1. I'm saying if we have two choices: (1) Use shared buffers even if it means the parallel query plan may be arbitrarily bad. (2) Use private buffers, even if it means no parallel queries with temp tables. Then I'm voting for (2) because it's less likely to break down. I can imagine allowing parallel queries with GTT when there's no risk of having to plan in the worker, but that's not there yet. If we can come up with a reasonable solution for the parallel case, we can enable it later. >Yes, if we have function in PL/pgSQL which performs queries om >temporary tables, then >parallel workers may build inefficient plan for this queries due to >lack of statistics. IMHO that's a pretty awful deficiency, because it essentially means users may need to disable parallelism for such queries. Which means we'll get complaints from users, and we'll have to come up with some sort of solution. I'd rather not be in that position. From my point of view this is not a pitfall of GTT but result of lack >of global plan cache in Postgres. And it should be fixed not at GTT >level. > That doesn't give us free pass to just ignore the issue. Even if it really was due to a lack of global plan cache, the fact is we don't have that feature, so we have a problem. I mean, if you need infrastructure that is not available, you either have to implement that infrastructure or make it work properly without it. >Also I never see real use cases with such functions, even in the >systems which using hard temporary tables and stored procedures. >But there are many other real problems with temp tables (except >already mentioned in this thread). Oh, I'm sure there are pretty large plpgsql applications, and I'd be surprised if at least some of those were not affected. And I'm sure there are apps using UDF to do all sorts of stuff (e.g. I wonder if PostGIS would have this issue - IIRC it's using SPI etc.). The question is whether we should consider existing apps affected, because they are using the regular temporary tables and not GTT. So unless they switch to GTT there is no regression ... But even in that case I don't think it's a good idea to accept this as an acceptable limitation. I admit one of the reasons why I think that may be that statistics and planning are my areas of interest, so I'm not quite willing to accept incomplete stuff as OK. >In PgPro/EE we have fixes for some of them, for example: > >1. Do not reserve space in the file for temp relations. Right now >append of relation cause writing zero page to the disk by mdextend. >It cause useless disk IO for temp tables which in most cases fit in >memory and should not be written at disk. > >2. Implicitly perform analyze of temp table intermediately after >storing data in it. Usually tables are analyzed by autovacuum in >background. >But it doesn't work for temp tables which are not processes by >autovacuum and are accessed immediately after filling them with data >and lack of statistic may cause >building very inefficient plan. We have online_analyze extension which >force analyze of the table after appending some bulk of data to it. >It can be used for normal table but most of all it is useful for temp >relations. > >Unlike hypothetical example with parallel safe function working with >temp tables, >this are real problems observed by some of our customers. >Them are applicable both to local and global temp tables and this is >why I do not want to discuss them in context of GTT. > I think those are both interesting issues worth fixing, but I don't think it makes the issue discussed here less important. > >> >>>3 Still no one commented on GTT's transaction information >>>processing, they include >>>3.1 Should gtt's frozenxid need to be care? >>>3.2 gtt’s clog clean >>>3.3 How to deal with "too old" gtt data >>> >> >>No idea what to do about this. >> > >I wonder what is the specific of GTT here? >The same problem takes place for normal (local) temp tables, doesn't it? > Not sure. TBH I'm not sure I understand what the issue actually is. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-09 16:48 Tomas Vondra <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Tomas Vondra @ 2020-01-09 16:48 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Thu, Jan 09, 2020 at 02:17:08PM +0300, Konstantin Knizhnik wrote: > > >On 06.01.2020 8:04, 曾文旌(义从) wrote: >>In the previous communication >> >>1 we agreed on the general direction >>1.1 gtt use local (private) buffer >>1.2 no replica access in first version >> >>2 We feel that gtt needs to maintain statistics, but there is no agreement on what it will be done. >> >>3 Still no one commented on GTT's transaction information processing, they include >>3.1 Should gtt's frozenxid need to be care? >>3.2 gtt’s clog clean >>3.3 How to deal with "too old" gtt data >> >>I suggest we discuss further, reach an agreement, and merge the two patches to one. >> > >I also hope that we should come to the common solution for GTT. >If we do not try to address parallel execution issues and access to >temp tables at replicas (and I agreed >that it should be avoided in first version of the patch), then GTT >patch becomes quite small. > Well, that was kinda my goal - making the patch as small as possible by eliminating bits that are contentious or where we don't know the solution (like planning for parallel queries). >The most complex and challenged task is to support GTT for all kind of >indexes. Unfortunately I can not proposed some good universal solution >for it. >Just patching all existed indexes implementation seems to be the only >choice. > I haven't looked at the indexing issue closely, but IMO we need to ensure that every session sees/uses only indexes on GTT that were defined before the seesion started using the table. Can't we track which indexes a particular session sees, somehow? >Statistic is another important case. >But once again I do not completely understand why we want to address >all this issues with statistic in first version of the patch? I think the question is which "issues with statistic" you mean. I'm sure we can ignore some of them, e.g. the one with parallel workers not having any stats (assuming we consider functions using GTT to be parallel restricted). >It contradicts to the idea to make this patch as small as possible. Well, there's "making patch as small as possible" vs. "patch behaving correctly" trade-off ;-) >Also it seems to me that everybody agreed that users very rarely >create indexes for temp tables and explicitly analyze them. I certainly *disagree* with this. We often see temporary tables as a fix or misestimates in complex queries, and/or as a replacement for CTEs with statistics/indexes. In fact it's a pretty valuable tool when helping customers with complex queries affected by poor estimates. >So I think GTT will be useful even with limited support of statistic. >In my version statistics for GTT is provided by pushing correspondent >information to backend's cache for pg_statistic table. I think someone pointed out pushing stuff directly into the cache is rather problematic, but I don't recall the details. >Also I provided pg_temp_statistic view for inspecting it by users. The >idea to make pg_statistic a view which combines statistic of normal >and temporary tables is overkill from my point of view. > >I do not understand why do we need to maintain hash with some extra >information for GTT in backends memory (as it was done in Wenjing >patch). >Also idea to use create extension for accessing this information seems >to be dubious. > I think the extension was more a PoC rather than a final solution. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-10 08:47 Konstantin Knizhnik <[email protected]> parent: Tomas Vondra <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-10 08:47 UTC (permalink / raw) To: Tomas Vondra <[email protected]>; +Cc: 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 09.01.2020 19:48, Tomas Vondra wrote: > >> The most complex and challenged task is to support GTT for all kind >> of indexes. Unfortunately I can not proposed some good universal >> solution for it. >> Just patching all existed indexes implementation seems to be the only >> choice. >> > > I haven't looked at the indexing issue closely, but IMO we need to > ensure that every session sees/uses only indexes on GTT that were > defined before the seesion started using the table. Why? It contradicts with behavior of normal tables. Assume that you have active clients and at some point of time DBA recognizes that them are spending to much time in scanning some GTT. It cab create index for this GTT but if existed client will not be able to use this index, then we need somehow make this clients to restart their sessions? In my patch I have implemented building indexes for GTT on demand: if accessed index on GTT is not yet initialized, then it is filled with local data. > > Can't we track which indexes a particular session sees, somehow? > >> Statistic is another important case. >> But once again I do not completely understand why we want to address >> all this issues with statistic in first version of the patch? > > I think the question is which "issues with statistic" you mean. I'm sure > we can ignore some of them, e.g. the one with parallel workers not > having any stats (assuming we consider functions using GTT to be > parallel restricted). If we do not use shared buffers for GTT then parallel processing of GTT is not possible at all, so there is no problem with statistic for parallel workers. > > I think someone pointed out pushing stuff directly into the cache is > rather problematic, but I don't recall the details. > I have not encountered any problems, so if you can point me on what is wrong with this approach, I will think about alternative solution. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-10 12:24 Konstantin Knizhnik <[email protected]> parent: Tomas Vondra <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-10 12:24 UTC (permalink / raw) To: Tomas Vondra <[email protected]>; +Cc: 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 09.01.2020 19:30, Tomas Vondra wrote: > >> >>> >>>> 3 Still no one commented on GTT's transaction information >>>> processing, they include >>>> 3.1 Should gtt's frozenxid need to be care? >>>> 3.2 gtt’s clog clean >>>> 3.3 How to deal with "too old" gtt data >>>> >>> >>> No idea what to do about this. >>> >> >> I wonder what is the specific of GTT here? >> The same problem takes place for normal (local) temp tables, doesn't it? >> > > Not sure. TBH I'm not sure I understand what the issue actually is. Just open session, create temporary table and insert some data in it. Then in other session run 2^31 transactions (at my desktop it takes about 2 hours). As far as temp tables are not proceeded by vacuum, database is stalled: ERROR: database is not accepting commands to avoid wraparound data loss in database "postgres" It seems to be quite dubious behavior and it is strange to me that nobody complains about it. We discuss many issues related with temp tables (statistic, parallel queries,...) which seems to be less critical. But this problem is not specific to GTT - it can be reproduced with normal (local) temp tables. This is why I wonder why do we need to solve it in GTT patch. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-11 14:00 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Tomas Vondra <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-11 14:00 UTC (permalink / raw) To: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; +Cc: pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> Hi all This is the latest patch The updates are as follows: 1. Support global temp Inherit table global temp partition table 2. Support serial column in GTT 3. Provide views pg_gtt_relstats pg_gtt_stats for GTT’s statistics 4. Provide view pg_gtt_attached_pids to manage GTT 5. Provide function pg_list_gtt_relfrozenxids() to manage GTT 6. Alter GTT or rename GTT is allowed under some conditions Please give me feedback. Wenjing > 2020年1月6日 上午4:06,Tomas Vondra <[email protected]> 写道: > > Hi, > > I think we need to do something with having two patches aiming to add > global temporary tables: > > [1] https://commitfest.postgresql.org/26/2349/ > > [2] https://commitfest.postgresql.org/26/2233/ > > As a reviewer I have no idea which of the threads to look at - certainly > not without reading both threads, which I doubt anyone will really do. > The reviews and discussions are somewhat intermixed between those two > threads, which makes it even more confusing. > > I think we should agree on a minimal patch combining the necessary/good > bits from the various patches, and terminate one of the threads (i.e. > mark it as rejected or RWF). And we need to do that now, otherwise > there's about 0% chance of getting this into v13. > > In general, I agree with the sentiment Rober expressed in [1] - the > patch needs to be as small as possible, not adding "nice to have" > features (like support for parallel queries - I very much doubt just > using shared instead of local buffers is enough to make it work.) > > regards > > -- > Tomas Vondra http://www.2ndQuadrant.com > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services Attachments: [application/octet-stream] global_temporary_table_v3-pg13.patch (151.1K, ../../[email protected]/3-global_temporary_table_v3-pg13.patch) download | inline diff: diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 79430d2..b7173c7 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -158,6 +158,19 @@ static relopt_bool boolRelOpts[] = }, true }, + /* + * For global temp table only + * use AccessExclusiveLock for ensure safety + */ + { + { + "on_commit_delete_rows", + "global temp table on commit options", + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, + ShareUpdateExclusiveLock + }, + true + }, /* list terminator */ {{NULL}} }; @@ -1486,6 +1499,8 @@ bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind) { static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)}, {"fillfactor", RELOPT_TYPE_INT, offsetof(StdRdOptions, fillfactor)}, {"autovacuum_enabled", RELOPT_TYPE_BOOL, offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, enabled)}, @@ -1586,13 +1601,18 @@ build_reloptions(Datum reloptions, bool validate, bytea * partitioned_table_reloptions(Datum reloptions, bool validate) { + static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)} + }; + /* * There are no options for partitioned tables yet, but this is able to do * some validation. */ return (bytea *) build_reloptions(reloptions, validate, RELOPT_KIND_PARTITIONED, - 0, NULL, 0); + sizeof(StdRdOptions), tab, lengthof(tab)); } /* diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index dd975b1..1610e7d 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -1013,7 +1013,9 @@ gistGetFakeLSN(Relation rel) { static XLogRecPtr counter = FirstNormalUnloggedLSN; - if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + /* global temp is same as local temp table */ + if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + rel->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { /* * Temporary relations are only accessible in our session, so a simple diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 4bb6efc..8dc8b03 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -146,7 +146,9 @@ hashbuild(Relation heap, Relation index, IndexInfo *indexInfo) * metapage, nor the first bitmap page. */ sort_threshold = (maintenance_work_mem * 1024L) / BLCKSZ; - if (index->rd_rel->relpersistence != RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + if (!(index->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + index->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) sort_threshold = Min(sort_threshold, NBuffers); else sort_threshold = Min(sort_threshold, NLocBuffer); diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index a6c369e..675c2b8 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -598,7 +598,7 @@ heapam_relation_set_new_filenode(Relation rel, */ *minmulti = GetOldestMultiXactId(); - srel = RelationCreateStorage(*newrnode, persistence); + srel = RelationCreateStorage(*newrnode, persistence, rel); /* * If required, set up an init fork for an unlogged table so that it can @@ -651,7 +651,7 @@ heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index a5fe904..be6fc5f 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -60,6 +60,7 @@ #include "utils/pg_rusage.h" #include "utils/timestamp.h" +#include "catalog/storage_gtt.h" /* * Space/time tradeoff parameters: do these need to be user-tunable? @@ -217,8 +218,10 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, Assert(params->truncate != VACOPT_TERNARY_DEFAULT); /* not every AM requires these to be valid, but heap does */ - Assert(TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); - Assert(MultiXactIdIsValid(onerel->rd_rel->relminmxid)); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relfrozenxid == InvalidTransactionId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && TransactionIdIsNormal(onerel->rd_rel->relfrozenxid))); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relminmxid == InvalidMultiXactId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && MultiXactIdIsValid(onerel->rd_rel->relminmxid))); /* measure elapsed time iff autovacuum logging requires it */ if (IsAutoVacuumWorkerProcess() && params->log_min_duration >= 0) @@ -277,8 +280,19 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, vacrelstats = (LVRelStats *) palloc0(sizeof(LVRelStats)); - vacrelstats->old_rel_pages = onerel->rd_rel->relpages; - vacrelstats->old_live_tuples = onerel->rd_rel->reltuples; + /* get relstat from gtt localhash */ + if (RELATION_IS_GLOBAL_TEMP(onerel)) + { + get_gtt_relstats(RelationGetRelid(onerel), + &vacrelstats->old_rel_pages, + &vacrelstats->old_live_tuples, + NULL, NULL, NULL); + } + else + { + vacrelstats->old_rel_pages = onerel->rd_rel->relpages; + vacrelstats->old_live_tuples = onerel->rd_rel->reltuples; + } vacrelstats->num_index_scans = 0; vacrelstats->pages_removed = 0; vacrelstats->lock_waiter_detected = false; diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index f05cbe7..946c9d2 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -763,7 +763,14 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access) /* Read an existing block of the relation */ buf = ReadBuffer(rel, blkno); LockBuffer(buf, access); - _bt_checkpage(rel, buf); + + /* global temp table may be not yet initialized for this backend. */ + if (RELATION_IS_GLOBAL_TEMP(rel) && + blkno == BTREE_METAPAGE && + PageIsNew(BufferGetPage(buf))) + _bt_initmetapage(BufferGetPage(buf), P_NONE, 0); + else + _bt_checkpage(rel, buf); } else { diff --git a/src/backend/access/table/tableam.c b/src/backend/access/table/tableam.c index c814733..ff51840 100644 --- a/src/backend/access/table/tableam.c +++ b/src/backend/access/table/tableam.c @@ -24,6 +24,7 @@ #include "access/heapam.h" /* for ss_* */ #include "access/tableam.h" #include "access/xact.h" +#include "catalog/storage_gtt.h" #include "optimizer/plancat.h" #include "storage/bufmgr.h" #include "storage/shmem.h" @@ -560,10 +561,20 @@ table_block_relation_estimate_size(Relation rel, int32 *attr_widths, /* it should have storage, so we can call the smgr */ curpages = RelationGetNumberOfBlocks(rel); - /* coerce values in pg_class to more desirable types */ - relpages = (BlockNumber) rel->rd_rel->relpages; - reltuples = (double) rel->rd_rel->reltuples; - relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + /* global temp table get relstats from localhash */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + get_gtt_relstats(RelationGetRelid(rel), + &relpages, &reltuples, &relallvisible, + NULL, NULL); + } + else + { + /* coerce values in pg_class to more desirable types */ + relpages = (BlockNumber) rel->rd_rel->relpages; + reltuples = (double) rel->rd_rel->reltuples; + relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + } /* * HACK: if the relation has never yet been vacuumed, use a minimum size diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 7f4f784..aba8a9f 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6327,6 +6327,10 @@ StartupXLOG(void) else recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID; + /* clean temp relation files */ + if (max_active_gtt > 0) + RemovePgTempFiles(); + /* * Check for signal files, and if so set up state for offline recovery */ diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index 61db650..fb87816 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -44,6 +44,8 @@ OBJS = \ storage.o \ toasting.o +OBJS += storage_gtt.o + BKIFILES = postgres.bki postgres.description postgres.shdescription include $(top_srcdir)/src/backend/common.mk diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c index 16cb6d8..f28f2c2 100644 --- a/src/backend/catalog/catalog.c +++ b/src/backend/catalog/catalog.c @@ -398,7 +398,9 @@ GetNewRelFileNode(Oid reltablespace, Relation pg_class, char relpersistence) switch (relpersistence) { + /* global temp table is same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); break; case RELPERSISTENCE_UNLOGGED: diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 0fdff29..54a5243 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -61,6 +61,7 @@ #include "catalog/pg_type.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "commands/tablecmds.h" #include "commands/typecmds.h" #include "executor/executor.h" @@ -99,6 +100,7 @@ static void AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -404,6 +406,10 @@ heap_create(const char *relname, relpersistence, relkind); + /* global temp table not create storage file when catalog create */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + create_storage = false; + /* * Have the storage manager create the relation's disk file, if needed. * @@ -427,7 +433,7 @@ heap_create(const char *relname, case RELKIND_INDEX: case RELKIND_SEQUENCE: - RelationCreateStorage(rel->rd_node, relpersistence); + RelationCreateStorage(rel->rd_node, relpersistence, rel); break; case RELKIND_RELATION: @@ -956,6 +962,7 @@ AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -994,8 +1001,18 @@ AddNewRelationTuple(Relation pg_class_desc, break; } - new_rel_reltup->relfrozenxid = relfrozenxid; - new_rel_reltup->relminmxid = relminmxid; + /* global temp table not remember transaction info in catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + new_rel_reltup->relfrozenxid = InvalidTransactionId; + new_rel_reltup->relminmxid = InvalidMultiXactId; + } + else + { + new_rel_reltup->relfrozenxid = relfrozenxid; + new_rel_reltup->relminmxid = relminmxid; + } + new_rel_reltup->relowner = relowner; new_rel_reltup->reltype = new_type_oid; new_rel_reltup->reloftype = reloftype; @@ -1357,6 +1374,7 @@ heap_create_with_catalog(const char *relname, reloftypeid, ownerid, relkind, + relpersistence, relfrozenxid, relminmxid, PointerGetDatum(relacl), @@ -1441,11 +1459,15 @@ heap_create_with_catalog(const char *relname, */ StoreConstraints(new_rel_desc, cooked_constraints, is_internal); - /* - * If there's a special on-commit action, remember it - */ - if (oncommit != ONCOMMIT_NOOP) - register_on_commit_action(relid, oncommit); + /* global temp table register action when storage init */ + if (relpersistence != RELPERSISTENCE_GLOBAL_TEMP) + { + /* + * If there's a special on-commit action, remember it + */ + if (oncommit != ONCOMMIT_NOOP) + register_on_commit_action(relid, oncommit); + } /* * ok, the relation has been cataloged, so close our relations and return @@ -1937,6 +1959,13 @@ heap_drop_with_catalog(Oid relid) if (relid == defaultPartOid) update_default_partition_oid(parentOid, InvalidOid); + /* We allow to drop global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not drop relation when other backend attached this global temp table"); + } + /* * Schedule unlinking of the relation's physical files at commit. */ @@ -3163,9 +3192,10 @@ RemoveStatistics(Oid relid, AttrNumber attnum) * * The routine will truncate and then reconstruct the indexes on * the specified relation. Caller must hold exclusive lock on rel. + * */ static void -RelationTruncateIndexes(Relation heapRelation) +RelationTruncateIndexes(Relation heapRelation, LOCKMODE lockmode) { ListCell *indlist; @@ -3177,7 +3207,7 @@ RelationTruncateIndexes(Relation heapRelation) IndexInfo *indexInfo; /* Open the index relation; use exclusive lock, just to be sure */ - currentIndex = index_open(indexId, AccessExclusiveLock); + currentIndex = index_open(indexId, lockmode); /* * Fetch info needed for index_build. Since we know there are no @@ -3223,8 +3253,13 @@ heap_truncate(List *relids) { Oid rid = lfirst_oid(cell); Relation rel; + LOCKMODE lockmode = AccessExclusiveLock; - rel = table_open(rid, AccessExclusiveLock); + /* truncate global temp table only need RowExclusiveLock */ + if (get_rel_persistence(rid) == RELPERSISTENCE_GLOBAL_TEMP) + lockmode = RowExclusiveLock; + + rel = table_open(rid, lockmode); relations = lappend(relations, rel); } @@ -3257,6 +3292,8 @@ void heap_truncate_one_rel(Relation rel) { Oid toastrelid; + LOCKMODE lockmode = AccessExclusiveLock; + bool truncate_toastrel = false; /* * Truncate the relation. Partitioned tables have no storage, so there is @@ -3265,23 +3302,40 @@ heap_truncate_one_rel(Relation rel) if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) return; + toastrelid = rel->rd_rel->reltoastrelid; + + /* + * Truncate global temp table only need RowExclusiveLock + */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + lockmode = RowExclusiveLock; + if (OidIsValid(toastrelid) && + gtt_storage_attached(toastrelid)) + truncate_toastrel = true; + } + else if (OidIsValid(toastrelid)) + truncate_toastrel = true; + /* Truncate the underlying relation */ table_relation_nontransactional_truncate(rel); /* If the relation has indexes, truncate the indexes too */ - RelationTruncateIndexes(rel); + RelationTruncateIndexes(rel, lockmode); /* If there is a toast table, truncate that too */ - toastrelid = rel->rd_rel->reltoastrelid; - if (OidIsValid(toastrelid)) + if (truncate_toastrel) { - Relation toastrel = table_open(toastrelid, AccessExclusiveLock); + Relation toastrel = table_open(toastrelid, lockmode); table_relation_nontransactional_truncate(toastrel); - RelationTruncateIndexes(toastrel); + RelationTruncateIndexes(toastrel, lockmode); /* keep the lock... */ table_close(toastrel, NoLock); } + + if (RELATION_IS_GLOBAL_TEMP(rel)) + up_gtt_relstats(rel, 0, 0, 0, RecentXmin, InvalidMultiXactId); } /* diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 3e59e64..1d6306d 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -52,6 +52,7 @@ #include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/event_trigger.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -877,6 +878,26 @@ index_create(Relation heapRelation, indexRelationName, RelationGetRelationName(heapRelation)))); } + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + if (accessMethodObjectId != BTREE_AM_OID) + elog(ERROR, "only support btree index on global temp table"); + + /* We allow to create index on global temp table only this session use it */ + if (is_other_backend_use_gtt(heapRelation->rd_node)) + elog(ERROR, "can not create index when have other backend attached this global temp table"); + + /* No support create index on global temp table use concurrent mode yet */ + if (concurrent) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot create indexes on global temporary tables using concurrent mode"))); + + /* if global temp table not init storage, then skip build index */ + if (!gtt_storage_attached(heapRelation->rd_node.relNode)) + flags |= INDEX_CREATE_SKIP_BUILD; + } + /* * construct tuple descriptor for index tuples */ @@ -2045,6 +2066,13 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) */ CheckTableNotInUse(userIndexRelation, "DROP INDEX"); + /* We allow to drop index on global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(userHeapRelation)) + { + if (is_other_backend_use_gtt(userHeapRelation->rd_node)) + elog(ERROR, "can not drop index when other backend attached this global temp table"); + } + /* * Drop Index Concurrently is more or less the reverse process of Create * Index Concurrently. @@ -2736,20 +2764,29 @@ index_update_stats(Relation rel, else /* don't bother for indexes */ relallvisible = 0; - if (rd_rel->relpages != (int32) relpages) + /* update index stats into localhash for global temp table */ + if (RELATION_IS_GLOBAL_TEMP(rel)) { - rd_rel->relpages = (int32) relpages; - dirty = true; + up_gtt_relstats(rel, relpages, reltuples, relallvisible, + InvalidTransactionId, InvalidMultiXactId); } - if (rd_rel->reltuples != (float4) reltuples) - { - rd_rel->reltuples = (float4) reltuples; - dirty = true; - } - if (rd_rel->relallvisible != (int32) relallvisible) + else { - rd_rel->relallvisible = (int32) relallvisible; - dirty = true; + if (rd_rel->relpages != (int32) relpages) + { + rd_rel->relpages = (int32) relpages; + dirty = true; + } + if (rd_rel->reltuples != (float4) reltuples) + { + rd_rel->reltuples = (float4) reltuples; + dirty = true; + } + if (rd_rel->relallvisible != (int32) relallvisible) + { + rd_rel->relallvisible = (int32) relallvisible; + dirty = true; + } } } @@ -2864,6 +2901,13 @@ index_build(Relation heapRelation, pgstat_progress_update_multi_param(6, index, val); } + /* POALR */ + if (RELATION_IS_GLOBAL_TEMP(indexRelation)) + { + if (!gtt_storage_attached(indexRelation->rd_node.relNode)) + RelationCreateStorage(indexRelation->rd_node, RELPERSISTENCE_GLOBAL_TEMP, indexRelation); + } + /* * Call the access method's build procedure */ @@ -3196,12 +3240,22 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot) /* * Scan the index and gather up all the TIDs into a tuplesort object. */ + memset(&ivinfo, 0, sizeof(IndexVacuumInfo)); ivinfo.index = indexRelation; ivinfo.analyze_only = false; ivinfo.report_progress = true; ivinfo.estimated_count = true; ivinfo.message_level = DEBUG2; - ivinfo.num_heap_tuples = heapRelation->rd_rel->reltuples; + + /* get relstats abort global temp table from hashtable, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + get_gtt_relstats(RelationGetRelid(heapRelation), + NULL, &ivinfo.num_heap_tuples, NULL, + NULL, NULL); + } + else + ivinfo.num_heap_tuples = heapRelation->rd_rel->reltuples; ivinfo.strategy = NULL; /* @@ -3459,6 +3513,15 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence, errmsg("cannot reindex temporary tables of other sessions"))); /* + * Because global temp table cannot change relfilenode + * no support reindex on global temp table yet. + */ + if (RELATION_IS_GLOBAL_TEMP(iRel)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot reindex global temporary tables"))); + + /* * Also check for active uses of the index in the current transaction; we * don't want to reindex underneath an open indexscan. */ diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index c82f9fc..8248109 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -647,6 +647,13 @@ RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid) errmsg("cannot create temporary relation in non-temporary schema"))); } break; + /* global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + if (isAnyTempNamespace(nspid)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("cannot create global temp relations in temporary schemas"))); + break; case RELPERSISTENCE_PERMANENT: if (isTempOrTempToastNamespace(nspid)) newRelation->relpersistence = RELPERSISTENCE_TEMP; diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index fddfbf1..03806ae 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -26,6 +26,7 @@ #include "access/xlogutils.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "storage/freespace.h" #include "storage/smgr.h" @@ -73,9 +74,10 @@ static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */ * * This function is transactional. The creation is WAL-logged, and if the * transaction aborts later on, the storage will be destroyed. + * */ SMgrRelation -RelationCreateStorage(RelFileNode rnode, char relpersistence) +RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel) { PendingRelDelete *pending; SMgrRelation srel; @@ -85,6 +87,8 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) switch (relpersistence) { case RELPERSISTENCE_TEMP: + /* global temp table use same storage strategy as local temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); needs_wal = false; break; @@ -117,6 +121,10 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) pending->next = pendingDeletes; pendingDeletes = pending; + /* remember global temp table storage info to localhash */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && rel) + remember_gtt_storage_info(rnode, rel); + return srel; } @@ -486,8 +494,15 @@ smgrDoPendingDeletes(bool isCommit) smgrdounlinkall(srels, nrels, false); for (i = 0; i < nrels; i++) + { smgrclose(srels[i]); + /* clean global temp table flags when transaction commit or rollback */ + if (SmgrIsTemp(srels[i]) && + gtt_storage_attached(srels[i]->smgr_rnode.node.relNode)) + forget_gtt_storage_info(srels[i]->smgr_rnode.node.relNode); + } + pfree(srels); } } diff --git a/src/backend/catalog/storage_gtt.c b/src/backend/catalog/storage_gtt.c new file mode 100644 index 0000000..13cab8e --- /dev/null +++ b/src/backend/catalog/storage_gtt.c @@ -0,0 +1,1130 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.c + * code to create and destroy physical storage for global temparary table + * + * IDENTIFICATION + * src/backend/catalog/storage_gtt.c + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "access/table.h" +#include "access/visibilitymap.h" +#include "access/xact.h" +#include "access/xlog.h" +#include "access/xloginsert.h" +#include "access/xlogutils.h" +#include "access/htup_details.h" +#include "access/multixact.h" +#include "catalog/storage.h" +#include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" +#include "catalog/heap.h" +#include "catalog/namespace.h" +#include "catalog/pg_type.h" +#include "catalog/pg_statistic.h" +#include "commands/tablecmds.h" +#include "funcapi.h" +#include "nodes/primnodes.h" +#include "nodes/pg_list.h" +#include "nodes/execnodes.h" +#include "miscadmin.h" +#include "storage/freespace.h" +#include "storage/smgr.h" +#include "storage/ipc.h" +#include "storage/proc.h" +#include "storage/procarray.h" +#include "storage/lwlock.h" +#include "storage/shmem.h" +#include "storage/sinvaladt.h" +#include "utils/memutils.h" +#include "utils/rel.h" +#include "utils/hsearch.h" +#include "utils/catcache.h" +#include "utils/lsyscache.h" +#include <utils/relcache.h> +#include "utils/inval.h" +#include "utils/guc.h" +#include "utils/guc.h" + + +/* Copy from bitmapset.c, because gtt used the function in bitmapset.c */ +#define WORDNUM(x) ((x) / BITS_PER_BITMAPWORD) +#define BITNUM(x) ((x) % BITS_PER_BITMAPWORD) + +#define BITMAPSET_SIZE(nwords) \ + (offsetof(Bitmapset, words) + (nwords) * sizeof(bitmapword)) + +static bool gtt_cleaner_exit_registered = false; +static HTAB *gtt_storage_local_hash = NULL; +static HTAB *active_gtt_shared_hash = NULL; +static MemoryContext gtt_relstats_context = NULL; + +/* relfrozenxid of all gtts in the current session */ +static List *gtt_session_relfrozenxid_list = NIL; +static TransactionId gtt_session_frozenxid = InvalidTransactionId; + +typedef struct gtt_ctl_data +{ + LWLock lock; + int max_entry; + int entry_size; +}gtt_ctl_data; + +static gtt_ctl_data *gtt_shared_ctl = NULL; + +typedef struct +{ + RelFileNode rnode; + Bitmapset *map; + /* bitmap data */ +} gtt_shared_hash_entry; + +typedef struct +{ + Oid relid; + + Oid spcnode; + /* pg_class stat */ + int32 relpages; + float4 reltuples; + int32 relallvisible; + TransactionId relfrozenxid; + TransactionId relminmxid; + char relkind; + bool on_commit_delete; + + /* pg_statistic */ + int natts; + int *attnum; + HeapTuple *att_stat_tups; +} gtt_local_hash_entry; + +static Size action_gtt_shared_hash_entry_size(void); +static void gtt_storage_checkin(RelFileNode rnode); +static void gtt_storage_checkout(RelFileNode rnode, bool skiplock); +static void gtt_storage_removeall(int code, Datum arg); +static void insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid); +static void remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid); +static void set_gtt_session_relfrozenxid(void); + +Datum pg_get_gtt_statistics(PG_FUNCTION_ARGS); +Datum pg_get_gtt_relstats(PG_FUNCTION_ARGS); +Datum pg_gtt_attached_pid(PG_FUNCTION_ARGS); +Datum pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS); + + +static Size +action_gtt_shared_hash_entry_size(void) +{ + int wordnum; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + wordnum = WORDNUM(MaxBackends + 1); + hash_entry_size += MAXALIGN(sizeof(gtt_shared_hash_entry)); + hash_entry_size += MAXALIGN(BITMAPSET_SIZE(wordnum + 1)); + + return hash_entry_size; +} + +Size +active_gtt_shared_hash_size(void) +{ + Size size = 0; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + size = MAXALIGN(sizeof(gtt_ctl_data)); + hash_entry_size = action_gtt_shared_hash_entry_size(); + size += hash_estimate_size(max_active_gtt, hash_entry_size); + + return size; +} + +void +active_gtt_shared_hash_init(void) +{ + HASHCTL info; + bool found; + + if (max_active_gtt <= 0) + return; + + gtt_shared_ctl = + ShmemInitStruct("gtt_shared_ctl", + sizeof(gtt_ctl_data), + &found); + + if (!found) + { + LWLockRegisterTranche(LWTRANCHE_GTT_CTL, "gtt_shared_ctl"); + LWLockInitialize(>t_shared_ctl->lock, LWTRANCHE_GTT_CTL); + gtt_shared_ctl->max_entry = max_active_gtt; + gtt_shared_ctl->entry_size = action_gtt_shared_hash_entry_size(); + } + + info.keysize = sizeof(RelFileNode); + info.entrysize = gtt_shared_ctl->entry_size; + active_gtt_shared_hash = + ShmemInitHash("active gtt shared hash", + gtt_shared_ctl->max_entry, + gtt_shared_ctl->max_entry, + &info, HASH_ELEM | HASH_BLOBS | HASH_FIXED_SIZE); +} + +static void +gtt_storage_checkin(RelFileNode rnode) +{ + gtt_shared_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + entry = (gtt_shared_hash_entry *) hash_search(active_gtt_shared_hash, + &rnode, HASH_ENTER_NULL, &found); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of shared memory"), + errhint("You might need to increase max_active_gtt."))); + } + + if (found == false) + { + int wordnum; + + entry->map = (Bitmapset *)((char *)entry + MAXALIGN(sizeof(gtt_shared_hash_entry))); + wordnum = WORDNUM(MaxBackends + 1); + memset(entry->map, 0, BITMAPSET_SIZE(wordnum + 1)); + entry->map->nwords = wordnum + 1; + } + + bms_add_member(entry->map, MyBackendId); + LWLockRelease(>t_shared_ctl->lock); +} + +static void +gtt_storage_checkout(RelFileNode rnode, bool skiplock) +{ + gtt_shared_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (!skiplock) + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + + entry = hash_search(active_gtt_shared_hash, + (void *) &(rnode), HASH_FIND, NULL); + + if (entry == NULL) + { + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + elog(WARNING, "relfilenode %u/%u/%u not exist in gtt shared hash when forget", + rnode.dbNode, rnode.spcNode, rnode.relNode); + return; + } + + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + bms_del_member(entry->map, MyBackendId); + + if (bms_is_empty(entry->map)) + { + if (!hash_search(active_gtt_shared_hash, &rnode, HASH_REMOVE, NULL)) + elog(PANIC, "gtt shared hash table corrupted"); + } + + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + return; +} + +Bitmapset * +copy_active_gtt_bitmap(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + Bitmapset *map_copy = NULL; + + if (max_active_gtt <= 0) + return NULL; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return NULL; + } + + Assert(entry->map); + if (!bms_is_empty(entry->map)) + map_copy = bms_copy(entry->map); + + LWLockRelease(>t_shared_ctl->lock); + + return map_copy; +} + +bool +is_other_backend_use_gtt(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + bool in_use = false; + int num_use = 0; + + if (max_active_gtt <= 0) + return false; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return false; + } + + Assert(entry->map); + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + + num_use = bms_num_members(entry->map); + if (num_use == 0) + in_use = false; + else if (num_use == 1) + { + if(bms_is_member(MyBackendId, entry->map)) + in_use = false; + else + in_use = true; + } + else + in_use = true; + + LWLockRelease(>t_shared_ctl->lock); + + return in_use; +} + +void +remember_gtt_storage_info(RelFileNode rnode, Relation rel) +{ + gtt_local_hash_entry *entry; + MemoryContext oldcontext; + Oid relid = rnode.relNode; + bool found; + + if (max_active_gtt <= 0) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Global temporary table feature is disable"), + errhint("You might need to increase max_active_gtt to enable this feature."))); + + if (RecoveryInProgress()) + elog(ERROR, "readonly mode not support access global temp table yet"); + + if (gtt_storage_local_hash == NULL) + { +#define GTT_LOCAL_HASH_SIZE 1024 + /* First time through: initialize the hash table */ + HASHCTL ctl; + + MemSet(&ctl, 0, sizeof(ctl)); + ctl.keysize = sizeof(Oid); + ctl.entrysize = sizeof(gtt_local_hash_entry); + gtt_storage_local_hash = + hash_create("global temp relation table", + GTT_LOCAL_HASH_SIZE, + &ctl, HASH_ELEM | HASH_BLOBS); + + if (!CacheMemoryContext) + CreateCacheMemoryContext(); + + gtt_relstats_context = + AllocSetContextCreate(CacheMemoryContext, + "gtt relstats context", + ALLOCSET_DEFAULT_SIZES); + } + + /* Look up or create an entry */ + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_ENTER, &found); + + if (found) + { + elog(ERROR, "backend %d relid %u already exists in global temp table local hash", + MyBackendId, relid); + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + + entry->spcnode = rnode.spcNode; + entry->relpages = 0; + entry->reltuples = 0; + entry->relallvisible = 0; + entry->relkind = rel->rd_rel->relkind; + /* only heap contain transaction information */ + if (entry->relkind == RELKIND_RELATION || entry->relkind == RELKIND_PARTITIONED_TABLE) + { + int natts = RelationGetNumberOfAttributes(rel); + entry->natts = natts; + entry->attnum = palloc0(sizeof(int) * natts); + entry->att_stat_tups = palloc0(sizeof(HeapTuple) * natts); + + if (RELATION_GTT_ON_COMMIT_DELETE(rel)) + { + entry->on_commit_delete = true; + register_on_commit_action(rel->rd_node.relNode, ONCOMMIT_DELETE_ROWS); + } + + entry->relfrozenxid = RecentXmin; + entry->relminmxid = GetOldestMultiXactId(); + insert_gtt_relfrozenxid_to_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + gtt_storage_checkin(rnode); + } + else + { + entry->natts = 0; + entry->attnum = 0; + entry->att_stat_tups = NULL; + entry->on_commit_delete = false; + entry->relfrozenxid = 0; + entry->relminmxid = 0; + } + + MemoryContextSwitchTo(oldcontext); + + if (!gtt_cleaner_exit_registered) + { + before_shmem_exit(gtt_storage_removeall, 0); + gtt_cleaner_exit_registered = true; + } + + return; +} + +void +forget_gtt_storage_info(Oid relid) +{ + gtt_local_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, NULL); + + if (entry && entry->relkind == RELKIND_RELATION) + { + RelFileNode rnode; + int i; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + gtt_storage_checkout(rnode, false); + + Assert(TransactionIdIsNormal(entry->relfrozenxid)); + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + + for (i = 0; i < entry->natts; i++) + { + if (entry->att_stat_tups[i]) + { + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + } + } + } + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_REMOVE, NULL); + + return; +} + +/* is the storage file was created in this backend */ +bool +gtt_storage_attached(Oid relid) +{ + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, &found); + + return found; +} + +static void +gtt_storage_removeall(int code, Datum arg) +{ + HASH_SEQ_STATUS status; + gtt_local_hash_entry *entry; + int nrels = 0, + maxrels = 0; + SMgrRelation *srels = NULL; + RelFileNode *rnodes = NULL; + char *relkinds = NULL; + + if (gtt_storage_local_hash == NULL) + return; + + hash_seq_init(&status, gtt_storage_local_hash); + while ((entry = (gtt_local_hash_entry *) hash_seq_search(&status)) != NULL) + { + SMgrRelation srel; + RelFileNode rnode; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + srel = smgropen(rnode, MyBackendId); + + /* allocate the initial array, or extend it, if needed */ + if (maxrels == 0) + { + maxrels = 32; + srels = palloc(sizeof(SMgrRelation) * maxrels); + rnodes = palloc(sizeof(RelFileNode) * maxrels); + relkinds = palloc(sizeof(char) * maxrels); + } + else if (maxrels <= nrels) + { + maxrels *= 2; + srels = repalloc(srels, sizeof(SMgrRelation) * maxrels); + rnodes = repalloc(rnodes, sizeof(RelFileNode) * maxrels); + relkinds = repalloc(relkinds, sizeof(char) * maxrels); + } + + srels[nrels] = srel; + rnodes[nrels] = rnode; + relkinds[nrels] = entry->relkind; + nrels++; + } + + if (nrels > 0) + { + int i; + + smgrdounlinkall(srels, nrels, false); + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + for (i = 0; i < nrels; i++) + { + smgrclose(srels[i]); + if (relkinds[i] == RELKIND_RELATION) + gtt_storage_checkout(rnodes[i], true); + } + LWLockRelease(>t_shared_ctl->lock); + + pfree(srels); + pfree(rnodes); + pfree(relkinds); + } + + MyProc->session_gtt_frozenxid = InvalidTransactionId; + + return; +} + +/* + * Update global temp table relstats(relpage/reltuple/relallvisible) + * to local hashtable + */ +void +up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid) +{ + Oid relid = RelationGetRelid(relation); + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return; + + Assert(entry->spcnode); + + if (num_pages >= 0 && + entry->relpages != (int32)num_pages) + entry->relpages = (int32)num_pages; + + if (num_tuples >= 0 && + num_tuples != (float4)entry->reltuples) + entry->reltuples = (float4)num_tuples; + + /* only heap contain transaction information and relallvisible */ + if (entry->relkind == RELKIND_RELATION) + { + if (entry->relallvisible >= 0 && + entry->relallvisible != (int32)num_all_visible_pages) + { + entry->relallvisible = (int32)num_all_visible_pages; + } + + if (TransactionIdIsNormal(relfrozenxid) && + entry->relfrozenxid != relfrozenxid && + (TransactionIdPrecedes(entry->relfrozenxid, relfrozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), entry->relfrozenxid))) + { + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + entry->relfrozenxid = relfrozenxid; + insert_gtt_relfrozenxid_to_ordered_list(relfrozenxid); + set_gtt_session_relfrozenxid(); + } + + if (MultiXactIdIsValid(relminmxid) && + entry->relminmxid != relminmxid && + (MultiXactIdPrecedes(entry->relminmxid, relminmxid) || + MultiXactIdPrecedes(ReadNextMultiXactId(), entry->relminmxid))) + { + entry->relminmxid = relminmxid; + } + } + + return; +} + +/* + * Search global temp table relstats(relpage/reltuple/relallvisible) + * from local hashtable. + */ +bool +get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid) +{ + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return false; + + Assert(entry->relid == relid); + + if (relpages) + *relpages = entry->relpages; + + if (reltuples) + *reltuples = entry->reltuples; + + if (relallvisible) + *relallvisible = entry->relallvisible; + + if (relfrozenxid) + *relfrozenxid = entry->relfrozenxid; + + if (relminmxid) + *relminmxid = entry->relminmxid; + + return true; +} + +/* + * Update global temp table statistic info(definition is same as pg_statistic) + * to local hashtable where ananyze global temp table + */ +void +up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull) +{ + gtt_local_hash_entry *entry; + bool found; + MemoryContext oldcontext; + int i = 0; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return; + + if (entry->relkind != RELKIND_RELATION) + { + elog(WARNING, "oid %u not a relation", reloid); + return; + } + + /* todo */ + if (entry->natts < natts) + { + elog(WARNING, "reloid %u not support update attstat after add colunm", reloid); + return; + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + Assert(entry->relid == reloid); + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == 0) + { + entry->attnum[i] = attnum; + break; + } + else if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + break; + } + } + + Assert(i < entry->natts); + Assert(entry->att_stat_tups[i] == NULL); + entry->att_stat_tups[i] = heap_form_tuple(tupleDescriptor, values, isnull); + MemoryContextSwitchTo(oldcontext); + + return; +} + +/* + * Search global temp table statistic info(definition is same as pg_statistic) + * from local hashtable. + */ +HeapTuple +get_gtt_att_statistic(Oid reloid, int attnum, bool inh) +{ + gtt_local_hash_entry *entry; + bool found; + int i = 0; + + if (max_active_gtt <= 0) + return NULL; + + if (gtt_storage_local_hash == NULL) + return NULL; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return NULL; + + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + return entry->att_stat_tups[i]; + } + } + + return NULL; +} + +void +release_gtt_statistic_cache(HeapTuple tup) +{ + /* do nothing */ + return; +} + +static void +insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid) +{ + MemoryContext oldcontext; + ListCell *cell; + int i; + + Assert(TransactionIdIsNormal(relfrozenxid)); + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + /* Does the datum belong at the front? */ + if (gtt_session_relfrozenxid_list == NIL || + TransactionIdFollowsOrEquals(relfrozenxid, + linitial_oid(gtt_session_relfrozenxid_list))) + { + gtt_session_relfrozenxid_list = + lcons_oid(relfrozenxid, gtt_session_relfrozenxid_list); + MemoryContextSwitchTo(oldcontext); + + return; + } + + /* No, so find the entry it belongs after */ + i = 0; + foreach (cell, gtt_session_relfrozenxid_list) + { + if (TransactionIdFollowsOrEquals(relfrozenxid, lfirst_oid(cell))) + break; + + i++; + } + gtt_session_relfrozenxid_list = + list_insert_nth_oid(gtt_session_relfrozenxid_list, i, relfrozenxid); + MemoryContextSwitchTo(oldcontext); + + return; +} + +static void +remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid) +{ + gtt_session_relfrozenxid_list = + list_delete_oid(gtt_session_relfrozenxid_list, relfrozenxid); +} + +static void +set_gtt_session_relfrozenxid(void) +{ + TransactionId gtt_frozenxid = InvalidTransactionId; + + if (gtt_session_relfrozenxid_list) + gtt_frozenxid = llast_oid(gtt_session_relfrozenxid_list); + + gtt_session_frozenxid = gtt_frozenxid; + if (MyProc->session_gtt_frozenxid != gtt_frozenxid) + MyProc->session_gtt_frozenxid = gtt_frozenxid; +} + +Datum +pg_get_gtt_statistics(PG_FUNCTION_ARGS) +{ + HeapTuple tuple; + Relation rel = NULL; + int attnum = PG_GETARG_INT32(1); + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + MemoryContext oldcontext; + Tuplestorestate *tupstore; + Relation pg_tatistic = NULL; + TupleDesc sd; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not " \ + "allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + pg_tatistic = table_open(StatisticRelationId, AccessShareLock); + sd = RelationGetDescr(pg_tatistic); + + tuple = get_gtt_att_statistic(reloid, attnum, false); + if (tuple) + { + Datum values[31]; + bool isnull[31]; + HeapTuple res = NULL; + + memset(&values, 0, sizeof(values)); + memset(&isnull, 0, sizeof(isnull)); + heap_deform_tuple(tuple, sd, values, isnull); + res = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, res); + } + + table_close(rel, NoLock); + table_close(pg_tatistic, AccessShareLock); + tuplestore_donestoring(tupstore); + + return (Datum) 0; +} + +Datum +pg_get_gtt_relstats(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + uint32 relfrozenxid = 0; + uint32 relminmxid = 0; + Relation rel = NULL; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + if (get_gtt_relstats(reloid, + &relpages, &reltuples, &relallvisible, + &relfrozenxid, &relminmxid)) + { + Datum values[5]; + bool isnull[5]; + + memset(isnull, 0, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(relpages); + values[1] = Float4GetDatum((float4)reltuples); + values[2] = Int32GetDatum(relallvisible); + values[3] = UInt32GetDatum(relfrozenxid); + values[4] = UInt32GetDatum(relminmxid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_gtt_attached_pid(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + Relation rel = NULL; + PGPROC *proc = NULL; + Bitmapset *map = NULL; + pid_t pid = 0; + int backendid = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + map = copy_active_gtt_bitmap(rel->rd_node); + if (map) + { + backendid = bms_first_member(map); + + do + { + proc = BackendIdGetProc(backendid); + pid = proc->pid; + if (pid > 0) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = UInt32GetDatum(reloid); + values[1] = Int32GetDatum(pid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + backendid = bms_next_member(map, backendid); + } while (backendid > 0); + + pfree(map); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + int num_xid = MaxBackends + 1; + int *pids = NULL; + uint32 *xids = NULL; + int i = 0; + int j = 0; + uint32 oldest = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + if (max_active_gtt <= 0) + return (Datum) 0; + + if (RecoveryInProgress()) + return (Datum) 0; + + pids = palloc0(sizeof(int) * num_xid); + xids = palloc0(sizeof(int) * num_xid); + oldest = list_all_session_gtt_frozenxids(num_xid, pids, xids, &i); + if (i > 0) + { + if (i > 0) + { + pids[i] = 0; + xids[i] = oldest; + i++; + } + + for(j = 0; j < i; j++) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(pids[j]); + values[1] = UInt32GetDatum(xids[j]); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + } + tuplestore_donestoring(tupstore); + pfree(pids); + pfree(xids); + + return (Datum) 0; +} + diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index 2fc3e3f..d0efd18 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -186,6 +186,91 @@ CREATE OR REPLACE VIEW pg_sequences AS WHERE NOT pg_is_other_temp_schema(N.oid) AND relkind = 'S'; +-- For global temporary table +CREATE VIEW pg_gtt_relstats WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_relstats(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_attached_pids WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_gtt_attached_pid(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_stats WITH (security_barrier) AS +SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN s.stakind1 = 1 THEN s.stavalues1 + WHEN s.stakind2 = 1 THEN s.stavalues2 + WHEN s.stakind3 = 1 THEN s.stavalues3 + WHEN s.stakind4 = 1 THEN s.stavalues4 + WHEN s.stakind5 = 1 THEN s.stavalues5 + END AS most_common_vals, + CASE + WHEN s.stakind1 = 1 THEN s.stanumbers1 + WHEN s.stakind2 = 1 THEN s.stanumbers2 + WHEN s.stakind3 = 1 THEN s.stanumbers3 + WHEN s.stakind4 = 1 THEN s.stanumbers4 + WHEN s.stakind5 = 1 THEN s.stanumbers5 + END AS most_common_freqs, + CASE + WHEN s.stakind1 = 2 THEN s.stavalues1 + WHEN s.stakind2 = 2 THEN s.stavalues2 + WHEN s.stakind3 = 2 THEN s.stavalues3 + WHEN s.stakind4 = 2 THEN s.stavalues4 + WHEN s.stakind5 = 2 THEN s.stavalues5 + END AS histogram_bounds, + CASE + WHEN s.stakind1 = 3 THEN s.stanumbers1[1] + WHEN s.stakind2 = 3 THEN s.stanumbers2[1] + WHEN s.stakind3 = 3 THEN s.stanumbers3[1] + WHEN s.stakind4 = 3 THEN s.stanumbers4[1] + WHEN s.stakind5 = 3 THEN s.stanumbers5[1] + END AS correlation, + CASE + WHEN s.stakind1 = 4 THEN s.stavalues1 + WHEN s.stakind2 = 4 THEN s.stavalues2 + WHEN s.stakind3 = 4 THEN s.stavalues3 + WHEN s.stakind4 = 4 THEN s.stavalues4 + WHEN s.stakind5 = 4 THEN s.stavalues5 + END AS most_common_elems, + CASE + WHEN s.stakind1 = 4 THEN s.stanumbers1 + WHEN s.stakind2 = 4 THEN s.stanumbers2 + WHEN s.stakind3 = 4 THEN s.stanumbers3 + WHEN s.stakind4 = 4 THEN s.stanumbers4 + WHEN s.stakind5 = 4 THEN s.stanumbers5 + END AS most_common_elem_freqs, + CASE + WHEN s.stakind1 = 5 THEN s.stanumbers1 + WHEN s.stakind2 = 5 THEN s.stanumbers2 + WHEN s.stakind3 = 5 THEN s.stanumbers3 + WHEN s.stakind4 = 5 THEN s.stanumbers4 + WHEN s.stakind5 = 5 THEN s.stanumbers5 + END AS elem_count_histogram + FROM + pg_class c + JOIN pg_attribute a ON c.oid = a.attrelid + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_statistics(c.oid, a.attnum, ''::text) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') and NOT a.attisdropped AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + CREATE VIEW pg_stats WITH (security_barrier) AS SELECT nspname AS schemaname, diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 53b11d7..104d6ce 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -65,6 +65,7 @@ #include "utils/syscache.h" #include "utils/timestamp.h" +#include "catalog/storage_gtt.h" /* Per-index data for ANALYZE */ typedef struct AnlIndexData @@ -102,7 +103,7 @@ static int acquire_inherited_sample_rows(Relation onerel, int elevel, HeapTuple *rows, int targrows, double *totalrows, double *totaldeadrows); static void update_attstats(Oid relid, bool inh, - int natts, VacAttrStats **vacattrstats); + int natts, VacAttrStats **vacattrstats, char relpersistence); static Datum std_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); @@ -575,14 +576,15 @@ do_analyze_rel(Relation onerel, VacuumParams *params, * pg_statistic for columns we didn't process, we leave them alone.) */ update_attstats(RelationGetRelid(onerel), inh, - attr_cnt, vacattrstats); + attr_cnt, vacattrstats, RelationGetRelPersistence(onerel)); for (ind = 0; ind < nindexes; ind++) { AnlIndexData *thisdata = &indexdata[ind]; update_attstats(RelationGetRelid(Irel[ind]), false, - thisdata->attr_cnt, thisdata->vacattrstats); + thisdata->attr_cnt, thisdata->vacattrstats, + RelationGetRelPersistence(Irel[ind])); } /* @@ -659,11 +661,20 @@ do_analyze_rel(Relation onerel, VacuumParams *params, IndexBulkDeleteResult *stats; IndexVacuumInfo ivinfo; + memset(&ivinfo, 0, sizeof(IndexVacuumInfo)); ivinfo.index = Irel[ind]; ivinfo.analyze_only = true; ivinfo.estimated_count = true; ivinfo.message_level = elevel; - ivinfo.num_heap_tuples = onerel->rd_rel->reltuples; + /* get global temp relstats from localhash, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(onerel)) + { + get_gtt_relstats(RelationGetRelid(onerel), + NULL, &ivinfo.num_heap_tuples, NULL, + NULL, NULL); + } + else + ivinfo.num_heap_tuples = onerel->rd_rel->reltuples; ivinfo.strategy = vac_strategy; stats = index_vacuum_cleanup(&ivinfo, NULL); @@ -1425,7 +1436,7 @@ acquire_inherited_sample_rows(Relation onerel, int elevel, * by taking a self-exclusive lock on the relation in analyze_rel(). */ static void -update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) +update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats, char relpersistence) { Relation sd; int attno; @@ -1527,31 +1538,45 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) } } - /* Is there already a pg_statistic tuple for this attribute? */ - oldtup = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(relid), - Int16GetDatum(stats->attr->attnum), - BoolGetDatum(inh)); - - if (HeapTupleIsValid(oldtup)) + /* Update column statistic to localhash, not catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { - /* Yes, replace it */ - stup = heap_modify_tuple(oldtup, - RelationGetDescr(sd), - values, - nulls, - replaces); - ReleaseSysCache(oldtup); - CatalogTupleUpdate(sd, &stup->t_self, stup); + up_gtt_att_statistic(relid, + stats->attr->attnum, + inh, + natts, + RelationGetDescr(sd), + values, + nulls); } else { - /* No, insert new tuple */ - stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); - CatalogTupleInsert(sd, stup); - } + /* Is there already a pg_statistic tuple for this attribute? */ + oldtup = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(relid), + Int16GetDatum(stats->attr->attnum), + BoolGetDatum(inh)); + + if (HeapTupleIsValid(oldtup)) + { + /* Yes, replace it */ + stup = heap_modify_tuple(oldtup, + RelationGetDescr(sd), + values, + nulls, + replaces); + ReleaseSysCache(oldtup); + CatalogTupleUpdate(sd, &stup->t_self, stup); + } + else + { + /* No, insert new tuple */ + stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); + CatalogTupleInsert(sd, stup); + } - heap_freetuple(stup); + heap_freetuple(stup); + } } table_close(sd, RowExclusiveLock); diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index e9d7a7f..3088e26 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -391,6 +391,12 @@ cluster_rel(Oid tableOid, Oid indexOid, int options) errmsg("cannot vacuum temporary tables of other sessions"))); } + /* not support cluster global temp table yet */ + if (RELATION_IS_GLOBAL_TEMP(OldHeap)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("not support cluster global temporary tables yet"))); + /* * Also check for active uses of the relation in the current transaction, * including open scans and pending AFTER trigger events. diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 52ce02f..3d3f7dc 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2583,6 +2583,16 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind, !isTempNamespace(classtuple->relnamespace)) continue; + /* not support reindex on global temp table, so skip it */ + if (classtuple->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + ereport(WARNING, + (errmsg("global temp table \"%s.%s\" skip reindexed", + get_namespace_name(get_rel_namespace(relid)), + get_rel_name(relid)))); + continue; + } + /* Check user/system classification, and optionally skip */ if (objectKind == REINDEX_OBJECT_SYSTEM && !IsSystemClass(relid, classtuple)) diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c index 75410f0..eb1acea 100644 --- a/src/backend/commands/lockcmds.c +++ b/src/backend/commands/lockcmds.c @@ -107,7 +107,8 @@ RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, * transaction. */ relpersistence = get_rel_persistence(relid); - if (relpersistence == RELPERSISTENCE_TEMP) + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPNAMESPACE; /* Check permissions. */ diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 6aab73b..44f350d 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -94,7 +94,7 @@ static HTAB *seqhashtab = NULL; /* hash table for SeqTable items */ */ static SeqTableData *last_used_seq = NULL; -static void fill_seq_with_data(Relation rel, HeapTuple tuple); +static void fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf); static Relation lock_and_open_sequence(SeqTable seq); static void create_seq_hashtable(void); static void init_sequence(Oid relid, SeqTable *p_elm, Relation *p_rel); @@ -108,6 +108,7 @@ static void init_params(ParseState *pstate, List *options, bool for_identity, List **owned_by); static void do_setval(Oid relid, int64 next, bool iscalled); static void process_owned_by(Relation seqrel, List *owned_by, bool for_identity); +int64 get_seqence_start_value(Oid seqid); /* @@ -222,7 +223,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq) /* now initialize the sequence's data */ tuple = heap_form_tuple(tupDesc, value, null); - fill_seq_with_data(rel, tuple); + fill_seq_with_data(rel, tuple, InvalidBuffer); /* process OWNED BY if given */ if (owned_by) @@ -327,7 +328,7 @@ ResetSequence(Oid seq_relid) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seq_rel, tuple); + fill_seq_with_data(seq_rel, tuple, InvalidBuffer); /* Clear local cache so that we don't think we have cached numbers */ /* Note that we do not change the currval() state */ @@ -340,17 +341,21 @@ ResetSequence(Oid seq_relid) * Initialize a sequence's relation with the specified tuple as content */ static void -fill_seq_with_data(Relation rel, HeapTuple tuple) +fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf) { - Buffer buf; Page page; sequence_magic *sm; OffsetNumber offnum; + bool lockBuffer = false; /* Initialize first page of relation with special magic number */ - buf = ReadBuffer(rel, P_NEW); - Assert(BufferGetBlockNumber(buf) == 0); + if (buf == InvalidBuffer) + { + buf = ReadBuffer(rel, P_NEW); + Assert(BufferGetBlockNumber(buf) == 0); + lockBuffer = true; + } page = BufferGetPage(buf); @@ -360,7 +365,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) /* Now insert sequence tuple */ - LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); + if (lockBuffer) + LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); /* * Since VACUUM does not process sequences, we have to force the tuple to @@ -410,7 +416,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) END_CRIT_SECTION(); - UnlockReleaseBuffer(buf); + if (lockBuffer) + UnlockReleaseBuffer(buf); } /* @@ -502,7 +509,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seqrel, newdatatuple); + fill_seq_with_data(seqrel, newdatatuple, InvalidBuffer); } /* process OWNED BY if given */ @@ -1178,6 +1185,25 @@ read_seq_tuple(Relation rel, Buffer *buf, HeapTuple seqdatatuple) LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); page = BufferGetPage(*buf); + if (GlobalTempRelationPageIsNotInitialized(rel, page)) + { + /* Initialize sequence for global temporary tables */ + Datum value[SEQ_COL_LASTCOL] = {0}; + bool null[SEQ_COL_LASTCOL] = {false}; + HeapTuple tuple; + int64 startv = get_seqence_start_value(RelationGetRelid(rel)); + + /* + * last_value from pg_sequence.seqstart + * log_cnt = 0 + * is_called = false + */ + value[SEQ_COL_LASTVAL-1] = Int64GetDatumFast(startv); /* start sequence with 1 */ + + tuple = heap_form_tuple(RelationGetDescr(rel), value, null); + fill_seq_with_data(rel, tuple, *buf); + heap_freetuple(tuple); + } sm = (sequence_magic *) PageGetSpecialPointer(page); if (sm->magic != SEQ_MAGIC) @@ -1954,3 +1980,23 @@ seq_mask(char *page, BlockNumber blkno) mask_unused_space(page); } + +int64 +get_seqence_start_value(Oid seqid) +{ + HeapTuple seqtuple; + Form_pg_sequence seqform; + int64 start; + + seqtuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(seqid)); + if (!HeapTupleIsValid(seqtuple)) + elog(ERROR, "cache lookup failed for sequence %u", + seqid); + + seqform = (Form_pg_sequence) GETSTRUCT(seqtuple); + start = seqform->seqstart; + ReleaseSysCache(seqtuple); + + return start; +} + diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 1c4394a..84bc81e 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -47,6 +47,7 @@ #include "catalog/storage.h" #include "catalog/storage_xlog.h" #include "catalog/toasting.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/comment.h" #include "commands/defrem.h" @@ -527,6 +528,7 @@ static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTbl); static List *GetParentedForeignKeyRefs(Relation partition); static void ATDetachCheckNoForeignKeyRefs(Relation partition); +static bool has_oncommit_option(List *options); /* ---------------------------------------------------------------- @@ -572,6 +574,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, LOCKMODE parentLockmode; const char *accessMethod = NULL; Oid accessMethodId = InvalidOid; + bool has_oncommit_clause = false; /* * Truncate relname to appropriate length (probably a waste of time, as @@ -582,8 +585,10 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Check consistency of arguments */ + /* global temp table same as local temp table */ if (stmt->oncommit != ONCOMMIT_NOOP - && stmt->relation->relpersistence != RELPERSISTENCE_TEMP) + && !(stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("ON COMMIT can only be used on temporary tables"))); @@ -613,7 +618,9 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, * code. This is needed because calling code might not expect untrusted * tables to appear in pg_temp at the front of its search path. */ - if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP + /* global temp table same as local temp table */ + if ((stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) && InSecurityRestrictedOperation()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -714,6 +721,57 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Parse and validate reloptions, if any. */ + /* global temp table */ + has_oncommit_clause = has_oncommit_option(stmt->options); + if (stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (relkind == RELKIND_RELATION || relkind == RELKIND_PARTITIONED_TABLE)) + { + /* inherit table or parition table inherit on commit property from parent table*/ + if (inheritOids && stmt->oncommit == ONCOMMIT_NOOP && !has_oncommit_clause) + { + Oid parent = linitial_oid(inheritOids); + Relation relation = table_open(parent, NoLock); + + if (!RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "The parent table must be global temporary table"); + + if (RELATION_GTT_ON_COMMIT_DELETE(relation)) + stmt->oncommit = ONCOMMIT_DELETE_ROWS; + else + stmt->oncommit = ONCOMMIT_PRESERVE_ROWS; + table_close(relation, NoLock); + } + + if (has_oncommit_clause) + { + if (stmt->oncommit != ONCOMMIT_NOOP) + elog(ERROR, "can not defeine global temp table with on commit and with clause at same time"); + } + else + { + DefElem *opt = makeNode(DefElem); + + opt->type = T_DefElem; + opt->defnamespace = NULL; + opt->defname = "on_commit_delete_rows"; + opt->defaction = DEFELEM_UNSPEC; + + /* use reloptions to remember on commit clause */ + if (stmt->oncommit == ONCOMMIT_DELETE_ROWS) + opt->arg = (Node *)makeString("true"); + else if (stmt->oncommit == ONCOMMIT_PRESERVE_ROWS) + opt->arg = (Node *)makeString("false"); + else if (stmt->oncommit == ONCOMMIT_NOOP) + opt->arg = (Node *)makeString("true"); + else + elog(ERROR, "global temp table not support on commit drop clause"); + + stmt->options = lappend(stmt->options, opt); + } + } + else if (has_oncommit_clause) + elog(ERROR, "regular table cannot specifie on_commit_delete_rows"); + reloptions = transformRelOptions((Datum) 0, stmt->options, NULL, validnsps, true, false); @@ -1775,7 +1833,8 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged, * table or the current physical file to be thrown away anyway. */ if (rel->rd_createSubid == mySubid || - rel->rd_newRelfilenodeSubid == mySubid) + rel->rd_newRelfilenodeSubid == mySubid || + RELATION_IS_GLOBAL_TEMP(rel)) { /* Immediate, non-rollbackable truncation is OK */ heap_truncate_one_rel(rel); @@ -3334,6 +3393,13 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo * specially. */ targetrelation = relation_open(myrelid, is_index ? ShareUpdateExclusiveLock : AccessExclusiveLock); + + if (RELATION_IS_GLOBAL_TEMP(targetrelation)) + { + if (is_other_backend_use_gtt(targetrelation->rd_node)) + elog(ERROR, "can not rename relation when other backend attached this global temp table"); + } + namespaceId = RelationGetNamespace(targetrelation); /* @@ -3503,6 +3569,13 @@ AlterTable(Oid relid, LOCKMODE lockmode, AlterTableStmt *stmt) /* Caller is required to provide an adequate lock. */ rel = relation_open(relid, NoLock); + /* We allow to alter global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not alter relation when other backend attached this global temp table"); + } + CheckTableNotInUse(rel, "ALTER TABLE"); ATController(stmt, rel, stmt->cmds, stmt->relation->inh, lockmode); @@ -7656,6 +7729,13 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, errmsg("referenced relation \"%s\" is not a table", RelationGetRelationName(pkrel)))); + /* global temp table not support foreign key constraint yet */ + if (RELATION_IS_GLOBAL_TEMP(pkrel)) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("referenced relation \"%s\" is not a global temp table", + RelationGetRelationName(pkrel)))); + if (!allowSystemTableMods && IsSystemRelation(pkrel)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -7695,6 +7775,12 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("constraints on temporary tables must involve temporary tables of this session"))); break; + /* global temp table not support foreign key constraint yet */ + case RELPERSISTENCE_GLOBAL_TEMP: + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("not support foreign key constraints on global temp table yet"))); + break; } /* @@ -12706,7 +12792,7 @@ index_copy_data(Relation rel, RelFileNode newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, @@ -14113,7 +14199,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged) */ switch (rel->rd_rel->relpersistence) { + /* global temp table same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("cannot change logged status of table \"%s\" because it is temporary", @@ -16753,3 +16841,20 @@ ATDetachCheckNoForeignKeyRefs(Relation partition) table_close(rel, NoLock); } } + +static bool +has_oncommit_option(List *options) +{ + ListCell *listptr; + + foreach(listptr, options) + { + DefElem *def = (DefElem *) lfirst(listptr); + + if (pg_strcasecmp(def->defname, "on_commit_delete_rows") == 0) + return true; + } + + return false; +} + diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index bb34e25..6e1896f 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -35,6 +35,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/defrem.h" #include "commands/vacuum.h" @@ -1070,12 +1071,25 @@ vac_estimate_reltuples(Relation relation, BlockNumber scanned_pages, double scanned_tuples) { - BlockNumber old_rel_pages = relation->rd_rel->relpages; - double old_rel_tuples = relation->rd_rel->reltuples; + BlockNumber old_rel_pages = 0; + double old_rel_tuples = 0; double old_density; double unscanned_pages; double total_tuples; + /* get relstat from gtt local hash */ + if (RELATION_IS_GLOBAL_TEMP(relation)) + { + get_gtt_relstats(RelationGetRelid(relation), + &old_rel_pages, &old_rel_tuples, NULL, + NULL, NULL); + } + else + { + old_rel_pages = relation->rd_rel->relpages; + old_rel_tuples = relation->rd_rel->reltuples; + } + /* If we did scan the whole table, just use the count as-is */ if (scanned_pages >= total_pages) return scanned_tuples; @@ -1175,24 +1189,8 @@ vac_update_relstats(Relation relation, /* Apply statistical updates, if any, to copied tuple */ dirty = false; - if (pgcform->relpages != (int32) num_pages) - { - pgcform->relpages = (int32) num_pages; - dirty = true; - } - if (pgcform->reltuples != (float4) num_tuples) - { - pgcform->reltuples = (float4) num_tuples; - dirty = true; - } - if (pgcform->relallvisible != (int32) num_all_visible_pages) - { - pgcform->relallvisible = (int32) num_all_visible_pages; - dirty = true; - } /* Apply DDL updates, but not inside an outer transaction (see above) */ - if (!in_outer_xact) { /* @@ -1217,37 +1215,64 @@ vac_update_relstats(Relation relation, } } - /* - * Update relfrozenxid, unless caller passed InvalidTransactionId - * indicating it has no new data. - * - * Ordinarily, we don't let relfrozenxid go backwards: if things are - * working correctly, the only way the new frozenxid could be older would - * be if a previous VACUUM was done with a tighter freeze_min_age, in - * which case we don't want to forget the work it already did. However, - * if the stored relfrozenxid is "in the future", then it must be corrupt - * and it seems best to overwrite it with the cutoff we used this time. - * This should match vac_update_datfrozenxid() concerning what we consider - * to be "in the future". - */ - if (TransactionIdIsNormal(frozenxid) && - pgcform->relfrozenxid != frozenxid && - (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || - TransactionIdPrecedes(ReadNewTransactionId(), - pgcform->relfrozenxid))) + /* global temp table remember relstats to localhash not catalog */ + if (RELATION_IS_GLOBAL_TEMP(relation)) { - pgcform->relfrozenxid = frozenxid; - dirty = true; + up_gtt_relstats(relation, + num_pages, num_tuples, + num_all_visible_pages, + frozenxid, minmulti); } - - /* Similarly for relminmxid */ - if (MultiXactIdIsValid(minmulti) && - pgcform->relminmxid != minmulti && - (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || - MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) + else { - pgcform->relminmxid = minmulti; - dirty = true; + if (pgcform->relpages != (int32) num_pages) + { + pgcform->relpages = (int32) num_pages; + dirty = true; + } + if (pgcform->reltuples != (float4) num_tuples) + { + pgcform->reltuples = (float4) num_tuples; + dirty = true; + } + if (pgcform->relallvisible != (int32) num_all_visible_pages) + { + pgcform->relallvisible = (int32) num_all_visible_pages; + dirty = true; + } + + /* + * Update relfrozenxid, unless caller passed InvalidTransactionId + * indicating it has no new data. + * + * Ordinarily, we don't let relfrozenxid go backwards: if things are + * working correctly, the only way the new frozenxid could be older would + * be if a previous VACUUM was done with a tighter freeze_min_age, in + * which case we don't want to forget the work it already did. However, + * if the stored relfrozenxid is "in the future", then it must be corrupt + * and it seems best to overwrite it with the cutoff we used this time. + * This should match vac_update_datfrozenxid() concerning what we consider + * to be "in the future". + */ + if (TransactionIdIsNormal(frozenxid) && + pgcform->relfrozenxid != frozenxid && + (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), + pgcform->relfrozenxid))) + { + pgcform->relfrozenxid = frozenxid; + dirty = true; + } + + /* Similarly for relminmxid */ + if (MultiXactIdIsValid(minmulti) && + pgcform->relminmxid != minmulti && + (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || + MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) + { + pgcform->relminmxid = minmulti; + dirty = true; + } } /* If anything changed, write out the tuple. */ @@ -1339,6 +1364,10 @@ vac_update_datfrozenxid(void) continue; } + /* global temp table relstats not in pg_class */ + if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + continue; + /* * Some table AMs might not need per-relation xid / multixid horizons. * It therefore seems reasonable to allow relfrozenxid and relminmxid @@ -1396,6 +1425,25 @@ vac_update_datfrozenxid(void) Assert(TransactionIdIsNormal(newFrozenXid)); Assert(MultiXactIdIsValid(newMinMulti)); + /* + * Global temp table get frozenxid from MyProc + * to avoid the vacuum truncate clog that gtt need. + */ + if (max_active_gtt > 0) + { + TransactionId oldest_gtt_frozenxid = + list_all_session_gtt_frozenxids(0, NULL, NULL, NULL); + + if (TransactionIdIsNormal(oldest_gtt_frozenxid) && + TransactionIdPrecedes(oldest_gtt_frozenxid, newFrozenXid)) + { + ereport(WARNING, + (errmsg("global temp table oldest FrozenXid is far in the past"), + errhint("please truncate them or kill those sessions that use them."))); + newFrozenXid = oldest_gtt_frozenxid; + } + } + /* Now fetch the pg_database tuple we need to update. */ relation = table_open(DatabaseRelationId, RowExclusiveLock); diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 8286d9c..c3992a4 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -591,6 +591,8 @@ static void set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) { + char relpersistence; + /* * The flag has previously been initialized to false, so we can just * return if it becomes clear that we can't safely set it. @@ -618,7 +620,11 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, * the rest of the necessary infrastructure right now anyway. So * for now, bail out if we see a temporary table. */ - if (get_rel_persistence(rte->relid) == RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + relpersistence = get_rel_persistence(rte->relid); + + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) return; /* diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index d6f2153..310a9e2 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -6312,7 +6312,9 @@ plan_create_index_workers(Oid tableOid, Oid indexOid) * Furthermore, any index predicate or index expressions must be parallel * safe. */ + /* global temp table is same as local temp table */ if (heap->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + heap->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP || !is_parallel_safe(root, (Node *) RelationGetIndexExpressions(index)) || !is_parallel_safe(root, (Node *) RelationGetIndexPredicate(index))) { diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index d82fc5a..189286b 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -31,6 +31,7 @@ #include "catalog/pg_am.h" #include "catalog/pg_proc.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "foreign/fdwapi.h" #include "miscadmin.h" #include "nodes/makefuncs.h" @@ -53,6 +54,7 @@ #include "utils/snapmgr.h" #include "utils/syscache.h" + /* GUC parameter */ int constraint_exclusion = CONSTRAINT_EXCLUSION_PARTITION; @@ -946,10 +948,10 @@ void estimate_rel_size(Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac) { - BlockNumber curpages; - BlockNumber relpages; - double reltuples; - BlockNumber relallvisible; + BlockNumber curpages = 0; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; double density; switch (rel->rd_rel->relkind) @@ -963,6 +965,21 @@ estimate_rel_size(Relation rel, int32 *attr_widths, case RELKIND_INDEX: + /* global temp table get relstats from localhash */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + get_gtt_relstats(RelationGetRelid(rel), + &relpages, &reltuples, &relallvisible, + NULL, NULL); + } + else + { + /* coerce values in pg_class to more desirable types */ + relpages = (BlockNumber) rel->rd_rel->relpages; + reltuples = (double) rel->rd_rel->reltuples; + relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + } + /* * XXX: It'd probably be good to move this into a callback, * individual index types e.g. know if they have a metapage. @@ -971,11 +988,6 @@ estimate_rel_size(Relation rel, int32 *attr_widths, /* it has storage, ok to call the smgr */ curpages = RelationGetNumberOfBlocks(rel); - /* coerce values in pg_class to more desirable types */ - relpages = (BlockNumber) rel->rd_rel->relpages; - reltuples = (double) rel->rd_rel->reltuples; - relallvisible = (BlockNumber) rel->rd_rel->relallvisible; - /* report estimated # pages */ *pages = curpages; /* quick exit if rel is clearly empty */ @@ -985,10 +997,6 @@ estimate_rel_size(Relation rel, int32 *attr_widths, *allvisfrac = 0; break; } - /* coerce values in pg_class to more desirable types */ - relpages = (BlockNumber) rel->rd_rel->relpages; - reltuples = (double) rel->rd_rel->reltuples; - relallvisible = (BlockNumber) rel->rd_rel->relallvisible; /* * Discount the metapage while estimating the number of tuples. diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 447a61e..a27f57f 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2576,6 +2576,11 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("materialized views must not use temporary tables or views"))); + if (is_query_using_gtt(query)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialized views must not use global temporary tables or views"))); + /* * A materialized view would either need to save parameters for use in * maintaining/loading the data or prohibit them entirely. The latter diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index ad5be90..dff21e0 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3270,17 +3270,11 @@ OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; } | LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; } | GLOBAL TEMPORARY { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; } | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; } @@ -11568,19 +11562,13 @@ OptTempTableName: } | GLOBAL TEMPORARY opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED opt_table qualified_name { diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index ceed0ce..cd1ca50 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -81,6 +81,7 @@ static void expandTupleDesc(TupleDesc tupdesc, Alias *eref, List **colnames, List **colvars); static int specialAttNum(const char *attname); static bool isQueryUsingTempRelation_walker(Node *node, void *context); +static bool is_query_using_gtt_walker(Node *node, void *context); /* @@ -3564,3 +3565,49 @@ isQueryUsingTempRelation_walker(Node *node, void *context) isQueryUsingTempRelation_walker, context); } + +/* check if the query uses global temp table */ +static bool +is_query_using_gtt_walker(Node *node, void *context) +{ + if (node == NULL) + return false; + + if (IsA(node, Query)) + { + Query *query = (Query *) node; + ListCell *rtable; + + foreach(rtable, query->rtable) + { + RangeTblEntry *rte = lfirst(rtable); + + if (rte->rtekind == RTE_RELATION) + { + Relation rel = relation_open(rte->relid, AccessShareLock); + char relpersistence = rel->rd_rel->relpersistence; + + relation_close(rel, AccessShareLock); + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + return true; + } + } + + return query_tree_walker(query, + is_query_using_gtt_walker, + context, + QTW_IGNORE_JOINALIASES); + } + + return expression_tree_walker(node, + is_query_using_gtt_walker, + context); +} + +/* check if the query uses global temp table */ +bool +is_query_using_gtt(Query *query) +{ + return is_query_using_gtt_walker((Node *) query, NULL); +} + diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 42095ab..d5fcbed 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -436,6 +436,9 @@ generateSerialExtraStmts(CreateStmtContext *cxt, ColumnDef *column, seqstmt->sequence = makeRangeVar(snamespace, sname, -1); seqstmt->options = seqoptions; + if (cxt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + seqstmt->sequence->relpersistence = cxt->relation->relpersistence; + /* * If a sequence data type was specified, add it to the options. Prepend * to the list rather than append; in case a user supplied their own AS diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index f0e40e3..bb60926 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2086,6 +2086,11 @@ do_autovacuum(void) } continue; } + else if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + /* autovacuum skip vacuum global temp table */ + continue; + } /* Fetch reloptions and the pgstat entry for this table */ relopts = extract_autovac_opts(tuple, pg_class_desc); @@ -2152,7 +2157,9 @@ do_autovacuum(void) /* * We cannot safely process other backends' temp tables, so skip 'em. */ - if (classForm->relpersistence == RELPERSISTENCE_TEMP) + /* autovacuum skip vacuum global temp table */ + if (classForm->relpersistence == RELPERSISTENCE_TEMP || + classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) continue; relid = classForm->oid; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index aba3960..68adcd5 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -53,6 +53,8 @@ #include "utils/resowner_private.h" #include "utils/timestamp.h" +#include "utils/guc.h" +#include "catalog/storage_gtt.h" /* Note: these two macros only work on shared buffers, not local ones! */ #define BufHdrGetBlock(bufHdr) ((Block) (BufferBlocks + ((Size) (bufHdr)->buf_id) * BLCKSZ)) @@ -432,7 +434,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref) static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, - bool *hit); + bool *hit, Relation rel); static bool PinBuffer(BufferDesc *buf, BufferAccessStrategy strategy); static void PinBuffer_Locked(BufferDesc *buf); static void UnpinBuffer(BufferDesc *buf, bool fixOwner); @@ -664,7 +666,8 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, */ pgstat_count_buffer_read(reln); buf = ReadBuffer_common(reln->rd_smgr, reln->rd_rel->relpersistence, - forkNum, blockNum, mode, strategy, &hit); + forkNum, blockNum, mode, strategy, &hit, + reln); if (hit) pgstat_count_buffer_hit(reln); return buf; @@ -692,7 +695,7 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, Assert(InRecovery); return ReadBuffer_common(smgr, RELPERSISTENCE_PERMANENT, forkNum, blockNum, - mode, strategy, &hit); + mode, strategy, &hit, NULL); } @@ -704,7 +707,8 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, - BufferAccessStrategy strategy, bool *hit) + BufferAccessStrategy strategy, bool *hit, + Relation rel) { BufferDesc *bufHdr; Block bufBlock; @@ -719,6 +723,15 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, isExtend = (blockNum == P_NEW); + /* create storage when first read data page for gtt */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (isExtend || blockNum == 0) && + forkNum == MAIN_FORKNUM && + !gtt_storage_attached(smgr->smgr_rnode.node.relNode)) + { + RelationCreateStorage(smgr->smgr_rnode.node, relpersistence, rel); + } + TRACE_POSTGRESQL_BUFFER_READ_START(forkNum, blockNum, smgr->smgr_rnode.node.spcNode, smgr->smgr_rnode.node.dbNode, @@ -2809,6 +2822,16 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln) BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum) { + /* + * When this backend not init gtt storage + * return 0 + */ + if (RELATION_IS_GLOBAL_TEMP(relation) && + !gtt_storage_attached(relation->rd_node.relNode)) + { + return 0; + } + switch (relation->rd_rel->relkind) { case RELKIND_SEQUENCE: diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c index 427b0d5..7adb969 100644 --- a/src/backend/storage/ipc/ipci.c +++ b/src/backend/storage/ipc/ipci.c @@ -21,6 +21,7 @@ #include "access/nbtree.h" #include "access/subtrans.h" #include "access/twophase.h" +#include "catalog/storage_gtt.h" #include "commands/async.h" #include "miscadmin.h" #include "pgstat.h" @@ -147,6 +148,7 @@ CreateSharedMemoryAndSemaphores(void) size = add_size(size, BTreeShmemSize()); size = add_size(size, SyncScanShmemSize()); size = add_size(size, AsyncShmemSize()); + size = add_size(size, active_gtt_shared_hash_size()); #ifdef EXEC_BACKEND size = add_size(size, ShmemBackendArraySize()); #endif @@ -217,6 +219,8 @@ CreateSharedMemoryAndSemaphores(void) SUBTRANSShmemInit(); MultiXactShmemInit(); InitBufferPool(); + /* global temporary table */ + active_gtt_shared_hash_init(); /* * Set up lock manager diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index c3adb2e..eb95e5f 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -62,6 +62,7 @@ #include "utils/builtins.h" #include "utils/rel.h" #include "utils/snapmgr.h" +#include "utils/guc.h" #define UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) @@ -4087,3 +4088,77 @@ KnownAssignedXidsReset(void) LWLockRelease(ProcArrayLock); } + +/* + * search all active backend to get oldest frozenxid + * for global temp table. + */ +int +list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n) +{ + ProcArrayStruct *arrayP = procArray; + TransactionId result = InvalidTransactionId; + int index; + int flags = 0; + int i = 0; + + if (max_active_gtt <= 0) + return 0; + + if (max_size > 0) + { + Assert(pids); + Assert(xids); + Assert(n); + *n = 0; + } + + if (max_active_gtt <= 0) + return InvalidTransactionId; + + if (RecoveryInProgress()) + return InvalidTransactionId; + + flags |= PROC_IS_AUTOVACUUM; + flags |= PROC_IN_LOGICAL_DECODING; + + LWLockAcquire(ProcArrayLock, LW_SHARED); + if (max_size > 0 && max_size < arrayP->numProcs) + { + LWLockRelease(ProcArrayLock); + elog(ERROR, "list_all_gtt_frozenxids require more array"); + } + + for (index = 0; index < arrayP->numProcs; index++) + { + int pgprocno = arrayP->pgprocnos[index]; + volatile PGPROC *proc = &allProcs[pgprocno]; + volatile PGXACT *pgxact = &allPgXact[pgprocno]; + + if (pgxact->vacuumFlags & flags) + continue; + + if (proc->databaseId == MyDatabaseId && + TransactionIdIsNormal(proc->session_gtt_frozenxid)) + { + if (result == InvalidTransactionId) + result = proc->session_gtt_frozenxid; + else if (TransactionIdPrecedes(proc->session_gtt_frozenxid, result)) + result = proc->session_gtt_frozenxid; + + if (max_size > 0) + { + pids[i] = proc->pid; + xids[i] = proc->session_gtt_frozenxid; + i++; + } + } + } + LWLockRelease(ProcArrayLock); + + if (max_size > 0) + *n = i; + + return result; +} + diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 99e5221..d3a0a18 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -395,6 +395,7 @@ InitProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; @@ -577,6 +578,7 @@ InitAuxiliaryProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index 199c722..92aefd0 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -654,6 +654,12 @@ mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, */ if (zero_damaged_pages || InRecovery) MemSet(buffer, 0, BLCKSZ); + else if(SmgrIsTemp(reln) && blocknum == 0 && forknum == MAIN_FORKNUM) + { + /* global temp table init btree meta page */ + MemSet(buffer, 0, BLCKSZ); + mdwrite(reln, forknum, blocknum, buffer, true); + } else ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c index 8406644..46eb23a 100644 --- a/src/backend/utils/adt/dbsize.c +++ b/src/backend/utils/adt/dbsize.c @@ -1008,6 +1008,10 @@ pg_relation_filepath(PG_FUNCTION_ARGS) Assert(backend != InvalidBackendId); } break; + /* For global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + backend = BackendIdForTempRelations(); + break; default: elog(ERROR, "invalid relpersistence: %c", relform->relpersistence); backend = InvalidBackendId; /* placate compiler */ diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 18d77ac..eaeebfe 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -142,6 +142,7 @@ #include "utils/timestamp.h" #include "utils/typcache.h" +#include "catalog/storage_gtt.h" /* Hooks for plugins to get control when we ask for stats */ get_relation_stats_hook_type get_relation_stats_hook = NULL; @@ -4578,12 +4579,25 @@ examine_variable(PlannerInfo *root, Node *node, int varRelid, } else if (index->indpred == NIL) { - vardata->statsTuple = - SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(index->indexoid), - Int16GetDatum(pos + 1), - BoolGetDatum(false)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(index->indexoid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = + get_gtt_att_statistic(index->indexoid, + Int16GetDatum(pos + 1), + false); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + vardata->statsTuple = + SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(index->indexoid), + Int16GetDatum(pos + 1), + BoolGetDatum(false)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -4708,15 +4722,27 @@ examine_simple_variable(PlannerInfo *root, Var *var, } else if (rte->rtekind == RTE_RELATION) { - /* - * Plain table or parent of an inheritance appendrel, so look up the - * column in pg_statistic - */ - vardata->statsTuple = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(rte->relid), - Int16GetDatum(var->varattno), - BoolGetDatum(rte->inh)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(rte->relid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = get_gtt_att_statistic(rte->relid, + var->varattno, + rte->inh); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + /* + * Plain table or parent of an inheritance appendrel, so look up the + * column in pg_statistic + */ + vardata->statsTuple = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(rte->relid), + Int16GetDatum(var->varattno), + BoolGetDatum(rte->inh)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -6098,6 +6124,7 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, { /* Simple variable --- look to stats for the underlying table */ RangeTblEntry *rte = planner_rt_fetch(index->rel->relid, root); + char rel_persistence = get_rel_persistence(rte->relid); Assert(rte->rtekind == RTE_RELATION); relid = rte->relid; @@ -6115,6 +6142,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + rte->inh); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -6126,6 +6160,8 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* Expression --- maybe there are stats for the index itself */ relid = index->indexoid; colnum = 1; @@ -6141,6 +6177,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -7029,6 +7072,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, /* attempt to lookup stats in relation for this index column */ if (attnum != 0) { + char rel_persistence = get_rel_persistence(rte->relid); + /* Simple variable -- look to stats for the underlying table */ if (get_relation_stats_hook && (*get_relation_stats_hook) (root, rte, attnum, &vardata)) @@ -7041,6 +7086,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(rte->relid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = @@ -7053,6 +7106,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* * Looks like we've found an expression column in the index. Let's * see if there's any stats for it. @@ -7072,6 +7127,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(index->indexoid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 1e3e6d3..44686ce 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -34,6 +34,7 @@ #include "catalog/pg_statistic.h" #include "catalog/pg_transform.h" #include "catalog/pg_type.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "utils/array.h" @@ -46,6 +47,7 @@ #include "utils/syscache.h" #include "utils/typcache.h" + /* Hook for plugins to get control in get_attavgwidth() */ get_attavgwidth_hook_type get_attavgwidth_hook = NULL; @@ -2878,6 +2880,18 @@ get_attavgwidth(Oid relid, AttrNumber attnum) if (stawidth > 0) return stawidth; } + if (get_rel_persistence(relid) == RELPERSISTENCE_GLOBAL_TEMP) + { + tp = get_gtt_att_statistic(relid, attnum, false); + if (!HeapTupleIsValid(tp)) + return 0; + + stawidth = ((Form_pg_statistic) GETSTRUCT(tp))->stawidth; + if (stawidth > 0) + return stawidth; + else + return 0; + } tp = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(relid), Int16GetDatum(attnum), diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index df025a5..1c30d86 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -1124,6 +1124,16 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) relation->rd_islocaltemp = false; } break; + case RELPERSISTENCE_GLOBAL_TEMP: + { + relation->rd_backend = BackendIdForTempRelations(); + /* + * For global temp table, all backend can use + * this relation, so rd_islocaltemp always true. + */ + relation->rd_islocaltemp = true; + } + break; default: elog(ERROR, "invalid relpersistence: %c", relation->rd_rel->relpersistence); @@ -3313,6 +3323,10 @@ RelationBuildLocalRelation(const char *relname, rel->rd_backend = BackendIdForTempRelations(); rel->rd_islocaltemp = true; break; + case RELPERSISTENCE_GLOBAL_TEMP: + rel->rd_backend = BackendIdForTempRelations(); + rel->rd_islocaltemp = true; + break; default: elog(ERROR, "invalid relpersistence: %c", relpersistence); break; @@ -3427,6 +3441,9 @@ RelationSetNewRelfilenode(Relation relation, char persistence) TransactionId freezeXid = InvalidTransactionId; RelFileNode newrnode; + if (RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "global temp table does not allow setting new relfilenode"); + /* Allocate a new relfilenode */ newrelfilenode = GetNewRelFileNode(relation->rd_rel->reltablespace, NULL, persistence); @@ -3467,7 +3484,7 @@ RelationSetNewRelfilenode(Relation relation, char persistence) /* handle these directly, at least for now */ SMgrRelation srel; - srel = RelationCreateStorage(newrnode, persistence); + srel = RelationCreateStorage(newrnode, persistence, relation); smgrclose(srel); } break; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index a4e5d08..37ce83d 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -139,6 +139,18 @@ char *GUC_check_errmsg_string; char *GUC_check_errdetail_string; char *GUC_check_errhint_string; +/* + * num = 0 means disable global temp table feature. + * global temp table define can still storage in catalog + * just can not use. + * num > 0 means database can management num active global temp table. + */ +#define MIN_NUM_ACTIVE_GTT 0 +#define DEFAULT_NUM_ACTIVE_GTT 1000 +#define MAX_NUM_ACTIVE_GTT 1000000 + +int max_active_gtt = MIN_NUM_ACTIVE_GTT; + static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3, 4); static void set_config_sourcefile(const char *name, char *sourcefile, @@ -1979,6 +1991,15 @@ static struct config_bool ConfigureNamesBool[] = static struct config_int ConfigureNamesInt[] = { { + {"max_active_global_temporary_table", PGC_POSTMASTER, UNGROUPED, + gettext_noop("max active global temporary table."), + NULL + }, + &max_active_gtt, + DEFAULT_NUM_ACTIVE_GTT, MIN_NUM_ACTIVE_GTT, MAX_NUM_ACTIVE_GTT, + NULL, NULL, NULL + }, + { {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Forces a switch to the next WAL file if a " "new file has not been started within N seconds."), diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 799b698..b98d396 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15583,6 +15583,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) { char *ftoptions = NULL; char *srvname = NULL; + char *table_type = NULL; switch (tbinfo->relkind) { @@ -15634,9 +15635,15 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) binary_upgrade_set_pg_class_oids(fout, q, tbinfo->dobj.catId.oid, false); + if (tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED) + table_type = "UNLOGGED "; + else if (tbinfo->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + table_type = "GLOBAL TEMPORARY "; + else + table_type = ""; + appendPQExpBuffer(q, "CREATE %s%s %s", - tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ? - "UNLOGGED " : "", + table_type, reltypename, qualrelname); diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index a12fc1f..78958e4 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -165,6 +165,7 @@ typedef FormData_pg_class *Form_pg_class; #define RELPERSISTENCE_PERMANENT 'p' /* regular table */ #define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */ #define RELPERSISTENCE_TEMP 't' /* temporary table */ +#define RELPERSISTENCE_GLOBAL_TEMP 'g' /* global temporary table */ /* default selection for replica identity (primary key or nothing) */ #define REPLICA_IDENTITY_DEFAULT 'd' diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 0b6045a..6bc884e 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5477,6 +5477,40 @@ proparallel => 'r', prorettype => 'float8', proargtypes => 'oid', prosrc => 'pg_stat_get_xact_function_self_time' }, +# For global temporary table +{ oid => '4191', + descr => 'List local statistics for global temporary table', + proname => 'pg_get_gtt_statistics', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid int4 anyelement', + proallargtypes => '{oid,int4,anyelement,oid,int2,bool,float4,int4,float4,int2,int2,int2,int2,int2,oid,oid,oid,oid,oid,oid,oid,oid,oid,oid,_float4,_float4,_float4,_float4,_float4,anyarray,anyarray,anyarray,anyarray,anyarray}', + proargmodes => '{i,i,i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}', + proargnames => '{relid,att,x,starelid,staattnum,stainherit,stanullfrac,stawidth,stadistinct,stakind1,stakind2,stakind3,stakind4,stakind5,staop1,staop2,staop3,staop4,staop5,stacoll1,stacoll2,stacoll3,stacoll4,stacoll5,stanumbers1,stanumbers2,stanumbers3,stanumbers4,stanumbers5,stavalues1,stavalues2,stavalues3,stavalues4,stavalues5}', + prosrc => 'pg_get_gtt_statistics' }, +{ oid => '4192', + descr => 'List local relstats for global temporary table', + proname => 'pg_get_gtt_relstats', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,int4,float4,int4,xid,xid}', + proargmodes => '{i,o,o,o,o,o}', + proargnames => '{relid,relpages,reltuples,relallvisible,relfrozenxid,relminmxid}', + prosrc => 'pg_get_gtt_relstats' }, +{ oid => '4193', + descr => 'List attached pid for one global temporary table', + proname => 'pg_gtt_attached_pid', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,oid,int4}', + proargmodes => '{i,o,o}', + proargnames => '{relid,relid,pid}', + prosrc => 'pg_gtt_attached_pid' }, +{ oid => '4194', + descr => 'List those backends that have used global temporary table', + proname => 'pg_list_gtt_relfrozenxids', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => '', + proallargtypes => '{int4,xid}', + proargmodes => '{o,o}', + proargnames => '{pid,relfrozenxid}', + prosrc => 'pg_list_gtt_relfrozenxids' }, + { oid => '3788', descr => 'statistics: timestamp of the current statistics snapshot', proname => 'pg_stat_get_snapshot_timestamp', provolatile => 's', diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h index 048003c..af48cdf 100644 --- a/src/include/catalog/storage.h +++ b/src/include/catalog/storage.h @@ -19,7 +19,7 @@ #include "storage/smgr.h" #include "utils/relcache.h" -extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence); +extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel); extern void RelationDropStorage(Relation rel); extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit); extern void RelationTruncate(Relation rel, BlockNumber nblocks); diff --git a/src/include/catalog/storage_gtt.h b/src/include/catalog/storage_gtt.h new file mode 100644 index 0000000..eacc214 --- /dev/null +++ b/src/include/catalog/storage_gtt.h @@ -0,0 +1,39 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.h + * prototypes for functions in backend/catalog/storage_gtt.c + * + * src/include/catalog/storage_gtt.h + * + *------------------------------------------------------------------------- + */ +#ifndef STORAGE_GTT_H +#define STORAGE_GTT_H + +#include "access/htup.h" +#include "storage/block.h" +#include "storage/relfilenode.h" +#include "utils/relcache.h" + +extern Size active_gtt_shared_hash_size(void); +extern void active_gtt_shared_hash_init(void); +extern void remember_gtt_storage_info(RelFileNode rnode, Relation rel); +extern void forget_gtt_storage_info(Oid relid); +extern bool is_other_backend_use_gtt(RelFileNode node); +extern bool gtt_storage_attached(Oid relid); +extern Bitmapset *copy_active_gtt_bitmap(RelFileNode node); +extern void up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull); +extern HeapTuple get_gtt_att_statistic(Oid reloid, int attnum, bool inh); +extern void release_gtt_statistic_cache(HeapTuple tup); +extern void up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid); +extern bool get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid); + +#endif /* STORAGE_H */ diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index b8bff23..70c01f7 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -117,4 +117,7 @@ extern Oid attnumTypeId(Relation rd, int attid); extern Oid attnumCollationId(Relation rd, int attid); extern bool isQueryUsingTempRelation(Query *query); +/* global temp table check */ +extern bool is_query_using_gtt(Query *query); + #endif /* PARSE_RELATION_H */ diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 870ecb5..92c590e 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -405,6 +405,8 @@ do { \ #define PageClearPrunable(page) \ (((PageHeader) (page))->pd_prune_xid = InvalidTransactionId) +#define GlobalTempRelationPageIsNotInitialized(rel, page) \ + ((rel)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && PageIsNew(page)) /* ---------------------------------------------------------------- * extern declarations diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 8fda8e4..172eae9 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -220,6 +220,7 @@ typedef enum BuiltinTrancheIds LWTRANCHE_TBM, LWTRANCHE_PARALLEL_APPEND, LWTRANCHE_SXACT, + LWTRANCHE_GTT_CTL, LWTRANCHE_FIRST_USER_DEFINED } BuiltinTrancheIds; diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 5b407e6..f13250a 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -117,6 +117,8 @@ struct PGPROC Oid tempNamespaceId; /* OID of temp schema this backend is * using */ + TransactionId session_gtt_frozenxid; /* session level global temp table relfrozenxid */ + bool isBackgroundWorker; /* true if background worker. */ /* diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index a5c7d0c..a86f61f 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -125,4 +125,6 @@ extern void ProcArraySetReplicationSlotXmin(TransactionId xmin, extern void ProcArrayGetReplicationSlotXmin(TransactionId *xmin, TransactionId *catalog_xmin); +extern int list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n); + #endif /* PROCARRAY_H */ diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index ce93ace..0f7262e 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -281,6 +281,10 @@ extern int tcp_user_timeout; extern bool trace_sort; #endif +/* global temporary table */ +extern int max_active_gtt; +/* end */ + /* * Functions exported by guc.c */ diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 44ed04d..3f9720d 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -277,6 +277,7 @@ typedef struct StdRdOptions int parallel_workers; /* max number of parallel workers */ bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */ bool vacuum_truncate; /* enables vacuum to truncate a relation */ + bool on_commit_delete_rows; /* global temp table */ } StdRdOptions; #define HEAP_MIN_FILLFACTOR 10 @@ -535,7 +536,8 @@ typedef struct ViewOptions * True if relation's pages are stored in local buffers. */ #define RelationUsesLocalBuffers(relation) \ - ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP || \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) /* * RELATION_IS_LOCAL @@ -602,6 +604,17 @@ typedef struct ViewOptions RelationNeedsWAL(relation) && \ !IsCatalogRelation(relation)) +/* global temp table implementations */ +#define RELATION_IS_GLOBAL_TEMP(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + +#define RELATION_GTT_ON_COMMIT_DELETE(relation) \ + ((relation)->rd_options && \ + ((relation)->rd_rel->relkind == RELKIND_RELATION || (relation)->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) && \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP ? \ + ((StdRdOptions *) (relation)->rd_options)->on_commit_delete_rows : false) + +#define RelationGetRelPersistence(relation) ((relation)->rd_rel->relpersistence) + /* routines in utils/cache/relcache.c */ extern void RelationIncrementReferenceCount(Relation rel); extern void RelationDecrementReferenceCount(Relation rel); diff --git a/src/test/regress/expected/gtt_clean.out b/src/test/regress/expected/gtt_clean.out new file mode 100644 index 0000000..50ca9ac --- /dev/null +++ b/src/test/regress/expected/gtt_clean.out @@ -0,0 +1,7 @@ +reset search_path; +drop schema gtt cascade; +NOTICE: drop cascades to 4 other objects +DETAIL: drop cascades to table gtt.gtt1 +drop cascades to table gtt.gtt2 +drop cascades to table gtt.gtt3 +drop cascades to table gtt.gtt_t_kenyon diff --git a/src/test/regress/expected/gtt_function.out b/src/test/regress/expected/gtt_function.out new file mode 100644 index 0000000..2c69f14 --- /dev/null +++ b/src/test/regress/expected/gtt_function.out @@ -0,0 +1,197 @@ +CREATE SCHEMA IF NOT EXISTS gtt_function; +set search_path=gtt_function,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt_test_rename(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); +ERROR: cannot create indexes on global temporary tables using concurrent mode +-- ERROR +cluster gtt1 using gtt1_pkey; +ERROR: not support cluster global temporary tables yet +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; +ERROR: ON COMMIT can only be used on temporary tables +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); +ERROR: regular table cannot specifie on_commit_delete_rows +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +); + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; + count +------- + 2 +(1 row) + +commit; +select count(*) from p_table01; + count +------- + 0 +(1 row) + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +ERROR: The parent table must be global temporary table +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp); +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + relname | relkind | relpersistence | reloptions +---------------------------------+---------+----------------+------------------------------- + p_table01 | p | g | {on_commit_delete_rows=true} + p_table01_2017 | r | g | {on_commit_delete_rows=true} + p_table01_2018 | r | g | {on_commit_delete_rows=true} + p_table01_id_seq | S | g | + p_table02 | p | g | {on_commit_delete_rows=false} + p_table02_2017 | r | g | {on_commit_delete_rows=false} + p_table02_2018 | r | g | {on_commit_delete_rows=false} + p_table02_id_seq | S | g | + tbl_inherits_parent | r | p | + tbl_inherits_parent_global_temp | r | g | {on_commit_delete_rows=true} + tbl_inherits_partition | r | g | {on_commit_delete_rows=true} +(11 rows) + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; +ERROR: global temp table not support on commit drop clause +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; +ERROR: can not defeine global temp table with on commit and with clause at same time +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); +--ok +alter table gtt_test_rename rename to gtt_test; +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; + id | a +----+--- + 2 | 1 + 3 | 2 +(2 rows) + +truncate gtt_seq; +select * from gtt_seq order by id; + id | a +----+--- +(0 rows) + +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + id | a +----+--- + 4 | 3 +(1 row) + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; +ERROR: materialized views must not use global temporary tables or views +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +ERROR: only support btree index on global temp table +create index idx_err on gtt1 using gist (a); +ERROR: data type integer has no default operator class for access method "gist" +HINT: You must specify an operator class for the index or define a default operator class for the data type. +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +ERROR: only support btree index on global temp table +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); +ERROR: only support btree index on global temp table +reset search_path; +drop schema gtt_function cascade; +NOTICE: drop cascades to 15 other objects +DETAIL: drop cascades to table gtt_function.gtt1 +drop cascades to table gtt_function.gtt_test +drop cascades to table gtt_function.gtt2 +drop cascades to table gtt_function.gtt3 +drop cascades to table gtt_function.tmp_t0 +drop cascades to table gtt_function.tbl_inherits_parent +drop cascades to table gtt_function.tbl_inherits_parent_global_temp +drop cascades to table gtt_function.products +drop cascades to table gtt_function.measurement +drop cascades to table gtt_function.p_table01 +drop cascades to table gtt_function.p_table02 +drop cascades to table gtt_function.tbl_inherits_partition +drop cascades to table gtt_function.gtt5 +drop cascades to table gtt_function.mytable +drop cascades to table gtt_function.gtt_seq diff --git a/src/test/regress/expected/gtt_parallel_1.out b/src/test/regress/expected/gtt_parallel_1.out new file mode 100644 index 0000000..30d8a7b --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_1.out @@ -0,0 +1,84 @@ +set search_path=gtt,sys; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_parallel_2.out b/src/test/regress/expected/gtt_parallel_2.out new file mode 100644 index 0000000..70bf4a6 --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_2.out @@ -0,0 +1,142 @@ +set search_path=gtt,sys; +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +commit; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 + 3 | test1 +(3 rows) + +rollback; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test2 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; + a | b +---+------- + 3 | test3 +(1 row) + +rollback; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; + a | b +---+------- + 5 | test5 +(1 row) + +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + a | b +---+------- + 6 | test6 +(1 row) + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; + count +-------- + 100000 +(1 row) + +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + QUERY PLAN +------------------------------------ + Index Scan using gtt3_pkey on gtt3 + Index Cond: (a = 300) +(2 rows) + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',10000); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid) from pg_class where relname = 'gtt_t_kenyon'; + relname | pg_relation_size | pg_relation_size +--------------+------------------+------------------ + gtt_t_kenyon | 450560 | 16384 +(1 row) + +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + relname +-------------- + gtt_t_kenyon +(1 row) + +reset search_path; diff --git a/src/test/regress/expected/gtt_prepare.out b/src/test/regress/expected/gtt_prepare.out new file mode 100644 index 0000000..9e8f5f0 --- /dev/null +++ b/src/test/regress/expected/gtt_prepare.out @@ -0,0 +1,7 @@ +CREATE SCHEMA IF NOT EXISTS gtt; +set search_path=gtt,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +reset search_path; diff --git a/src/test/regress/expected/gtt_stats.out b/src/test/regress/expected/gtt_stats.out new file mode 100644 index 0000000..b258b7c --- /dev/null +++ b/src/test/regress/expected/gtt_stats.out @@ -0,0 +1,76 @@ +CREATE SCHEMA IF NOT EXISTS gtt_stats; +set search_path=gtt_stats,sys; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +insert into gtt values(generate_series(1,10000),'test'); +-- expect 1 +select count(*) from pg_gtt_attached_pids; + count +------- + 1 +(1 row) + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 2 +(1 row) + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 0 | 0 | 0 +(1 row) + +-- expect 0 +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+------------------+-------------+-------------------+------------------------+---------------------- +(0 rows) + +analyze gtt; +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 55 | 10000 | 0 +(1 row) + +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------------------+------------------------+---------------------- + gtt_stats | gtt | a | f | 0 | 4 | -1 | | | {1,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,8700,8800,8900,9000,9100,9200,9300,9400,9500,9600,9700,9800,9900,10000} | 1 | | | + gtt_stats | gtt | b | f | 0 | 5 | 1 | {test} | {1} | | 1 | | | +(2 rows) + +reset search_path; +drop schema gtt_stats cascade; +NOTICE: drop cascades to table gtt_stats.gtt diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 80a0782..d3d9927 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1348,6 +1348,93 @@ pg_group| SELECT pg_authid.rolname AS groname, WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin); +pg_gtt_attached_pids| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relid, + s.pid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_gtt_attached_pid(c.oid) s(relid, pid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_relstats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relpages, + s.reltuples, + s.relallvisible, + s.relfrozenxid, + s.relminmxid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_relstats(c.oid) s(relpages, reltuples, relallvisible, relfrozenxid, relminmxid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_stats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN (s.stakind1 = 1) THEN s.stavalues1 + WHEN (s.stakind2 = 1) THEN s.stavalues2 + WHEN (s.stakind3 = 1) THEN s.stavalues3 + WHEN (s.stakind4 = 1) THEN s.stavalues4 + WHEN (s.stakind5 = 1) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_vals, + CASE + WHEN (s.stakind1 = 1) THEN s.stanumbers1 + WHEN (s.stakind2 = 1) THEN s.stanumbers2 + WHEN (s.stakind3 = 1) THEN s.stanumbers3 + WHEN (s.stakind4 = 1) THEN s.stanumbers4 + WHEN (s.stakind5 = 1) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_freqs, + CASE + WHEN (s.stakind1 = 2) THEN s.stavalues1 + WHEN (s.stakind2 = 2) THEN s.stavalues2 + WHEN (s.stakind3 = 2) THEN s.stavalues3 + WHEN (s.stakind4 = 2) THEN s.stavalues4 + WHEN (s.stakind5 = 2) THEN s.stavalues5 + ELSE NULL::text[] + END AS histogram_bounds, + CASE + WHEN (s.stakind1 = 3) THEN s.stanumbers1[1] + WHEN (s.stakind2 = 3) THEN s.stanumbers2[1] + WHEN (s.stakind3 = 3) THEN s.stanumbers3[1] + WHEN (s.stakind4 = 3) THEN s.stanumbers4[1] + WHEN (s.stakind5 = 3) THEN s.stanumbers5[1] + ELSE NULL::real + END AS correlation, + CASE + WHEN (s.stakind1 = 4) THEN s.stavalues1 + WHEN (s.stakind2 = 4) THEN s.stavalues2 + WHEN (s.stakind3 = 4) THEN s.stavalues3 + WHEN (s.stakind4 = 4) THEN s.stavalues4 + WHEN (s.stakind5 = 4) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_elems, + CASE + WHEN (s.stakind1 = 4) THEN s.stanumbers1 + WHEN (s.stakind2 = 4) THEN s.stanumbers2 + WHEN (s.stakind3 = 4) THEN s.stanumbers3 + WHEN (s.stakind4 = 4) THEN s.stanumbers4 + WHEN (s.stakind5 = 4) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_elem_freqs, + CASE + WHEN (s.stakind1 = 5) THEN s.stanumbers1 + WHEN (s.stakind2 = 5) THEN s.stanumbers2 + WHEN (s.stakind3 = 5) THEN s.stanumbers3 + WHEN (s.stakind4 = 5) THEN s.stanumbers4 + WHEN (s.stakind5 = 5) THEN s.stanumbers5 + ELSE NULL::real[] + END AS elem_count_histogram + FROM ((pg_class c + JOIN pg_attribute a ON ((c.oid = a.attrelid))) + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_statistics(c.oid, (a.attnum)::integer, ''::text) s(starelid, staattnum, stainherit, stanullfrac, stawidth, stadistinct, stakind1, stakind2, stakind3, stakind4, stakind5, staop1, staop2, staop3, staop4, staop5, stacoll1, stacoll2, stacoll3, stacoll4, stacoll5, stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5, stavalues1, stavalues2, stavalues3, stavalues4, stavalues5) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND (NOT a.attisdropped) AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); pg_hba_file_rules| SELECT a.line_number, a.type, a.database, diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index d33a4e1..643afe4 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -121,3 +121,10 @@ test: fast_default # run stats by itself because its delay may be insufficient under heavy load test: stats + +# global temp table test +test: gtt_stats +test: gtt_function +test: gtt_prepare +test: gtt_parallel_1 gtt_parallel_2 +test: gtt_clean diff --git a/src/test/regress/sql/gtt_clean.sql b/src/test/regress/sql/gtt_clean.sql new file mode 100644 index 0000000..f3cf710 --- /dev/null +++ b/src/test/regress/sql/gtt_clean.sql @@ -0,0 +1,6 @@ + + +reset search_path; + +drop schema gtt cascade; + diff --git a/src/test/regress/sql/gtt_function.sql b/src/test/regress/sql/gtt_function.sql new file mode 100644 index 0000000..49c3f11 --- /dev/null +++ b/src/test/regress/sql/gtt_function.sql @@ -0,0 +1,163 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_function; + +set search_path=gtt_function,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt_test_rename(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); + +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); + +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); + +-- ERROR +cluster gtt1 using gtt1_pkey; + +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; + +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); + +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); + +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +); + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; +commit; + +select count(*) from p_table01; + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; + +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp); + +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; + +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; + +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); + +--ok +alter table gtt_test_rename rename to gtt_test; + +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); + +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; + +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; +truncate gtt_seq; +select * from gtt_seq order by id; +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; + +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +create index idx_err on gtt1 using gist (a); +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); + +reset search_path; + +drop schema gtt_function cascade; + diff --git a/src/test/regress/sql/gtt_parallel_1.sql b/src/test/regress/sql/gtt_parallel_1.sql new file mode 100644 index 0000000..d7d81de --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_1.sql @@ -0,0 +1,42 @@ + + +set search_path=gtt,sys; + +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +commit; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +rollback; +select * from gtt1 order by a; + +truncate gtt1; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +select * from gtt1 order by a; +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + +begin; +select * from gtt1 order by a; +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +commit; +select * from gtt1 order by a; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_parallel_2.sql b/src/test/regress/sql/gtt_parallel_2.sql new file mode 100644 index 0000000..cb2f7a6 --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_2.sql @@ -0,0 +1,62 @@ + + +set search_path=gtt,sys; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; +commit; +select * from gtt3 order by a; + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +truncate gtt3; +select * from gtt3 order by a; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; +truncate gtt3; +select * from gtt3 order by a; +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +begin; +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',10000); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid) from pg_class where relname = 'gtt_t_kenyon'; +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_prepare.sql b/src/test/regress/sql/gtt_prepare.sql new file mode 100644 index 0000000..042d9e6 --- /dev/null +++ b/src/test/regress/sql/gtt_prepare.sql @@ -0,0 +1,15 @@ + +CREATE SCHEMA IF NOT EXISTS gtt; + +set search_path=gtt,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_stats.sql b/src/test/regress/sql/gtt_stats.sql new file mode 100644 index 0000000..f041892 --- /dev/null +++ b/src/test/regress/sql/gtt_stats.sql @@ -0,0 +1,42 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_stats; + +set search_path=gtt_stats,sys; + +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +insert into gtt values(generate_series(1,10000),'test'); + +-- expect 1 +select count(*) from pg_gtt_attached_pids; + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +-- expect 0 +select * from pg_gtt_stats order by tablename; + +analyze gtt; + +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +select * from pg_gtt_stats order by tablename; + +reset search_path; + +drop schema gtt_stats cascade; + ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-11 20:27 Pavel Stehule <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 0 siblings, 2 replies; 1038+ messages in thread From: Pavel Stehule @ 2020-01-11 20:27 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> --000000000000e18792059be3139c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi so 11. 1. 2020 v 15:00 odes=C3=ADlatel =E6=9B=BE=E6=96=87=E6=97=8C(=E4=B9= =89=E4=BB=8E) <[email protected]> napsal: > Hi all > > This is the latest patch > > The updates are as follows: > 1. Support global temp Inherit table global temp partition table > 2. Support serial column in GTT > 3. Provide views pg_gtt_relstats pg_gtt_stats for GTT=E2=80=99s statistic= s > 4. Provide view pg_gtt_attached_pids to manage GTT > 5. Provide function pg_list_gtt_relfrozenxids() to manage GTT > 6. Alter GTT or rename GTT is allowed under some conditions > > > Please give me feedback. > I tested the functionality 1. i think so "ON COMMIT PRESERVE ROWS" should be default mode (like local temp tables). I tested some simple scripts test01.sql CREATE TEMP TABLE foo(a int, b int); INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); ANALYZE foo; SELECT sum(a), sum(b) FROM foo; DROP TABLE foo; -- simulate disconnect after 100 sec, the table pg_attribute has 3.2MB and 64 tps, 6446 transaction test02.sql INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); ANALYZE foo; SELECT sum(a), sum(b) FROM foo; DELETE FROM foo; -- simulate disconnect after 100 sec, 1688 tps, 168830 transactions So performance is absolutely different as we expected. ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-12 01:14 Tomas Vondra <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Tomas Vondra @ 2020-01-12 01:14 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Fri, Jan 10, 2020 at 03:24:34PM +0300, Konstantin Knizhnik wrote: > > >On 09.01.2020 19:30, Tomas Vondra wrote: > > >> >>> >>>> >>>>>3 Still no one commented on GTT's transaction information >>>>>processing, they include >>>>>3.1 Should gtt's frozenxid need to be care? >>>>>3.2 gtt’s clog clean >>>>>3.3 How to deal with "too old" gtt data >>>>> >>>> >>>>No idea what to do about this. >>>> >>> >>>I wonder what is the specific of GTT here? >>>The same problem takes place for normal (local) temp tables, doesn't it? >>> >> >>Not sure. TBH I'm not sure I understand what the issue actually is. > >Just open session, create temporary table and insert some data in it. >Then in other session run 2^31 transactions (at my desktop it takes >about 2 hours). >As far as temp tables are not proceeded by vacuum, database is stalled: > > ERROR: database is not accepting commands to avoid wraparound data >loss in database "postgres" > >It seems to be quite dubious behavior and it is strange to me that >nobody complains about it. >We discuss many issues related with temp tables (statistic, parallel >queries,...) which seems to be less critical. > >But this problem is not specific to GTT - it can be reproduced with >normal (local) temp tables. >This is why I wonder why do we need to solve it in GTT patch. > Yeah, I think that's out of scope for GTT patch. Once we solve it for plain temporary tables, we'll solve it for GTT too. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-12 01:51 Tomas Vondra <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 2 replies; 1038+ messages in thread From: Tomas Vondra @ 2020-01-12 01:51 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Fri, Jan 10, 2020 at 11:47:42AM +0300, Konstantin Knizhnik wrote: > > >On 09.01.2020 19:48, Tomas Vondra wrote: >> >>>The most complex and challenged task is to support GTT for all >>>kind of indexes. Unfortunately I can not proposed some good >>>universal solution for it. >>>Just patching all existed indexes implementation seems to be the >>>only choice. >>> >> >>I haven't looked at the indexing issue closely, but IMO we need to >>ensure that every session sees/uses only indexes on GTT that were >>defined before the seesion started using the table. > >Why? It contradicts with behavior of normal tables. >Assume that you have active clients and at some point of time DBA >recognizes that them are spending to much time in scanning some GTT. >It cab create index for this GTT but if existed client will not be >able to use this index, then we need somehow make this clients to >restart their sessions? >In my patch I have implemented building indexes for GTT on demand: if >accessed index on GTT is not yet initialized, then it is filled with >local data. Yes, I know the behavior would be different from behavior for regular tables. And yes, it would not allow fixing slow queries in sessions without interrupting those sessions. I proposed just ignoring those new indexes because it seems much simpler than alternative solutions that I can think of, and it's not like those other solutions don't have other issues. For example, I've looked at the "on demand" building as implemented in global_private_temp-8.patch, I kinda doubt adding a bunch of index build calls into various places in index code seems somewht suspicious. * brinbuild is added to brinRevmapInitialize, which is meant to initialize state for scanning. It seems wrong to build the index we're scanning from this function (layering and all that). * btbuild is called from _bt_getbuf. That seems a bit ... suspicious? ... and so on for other index types. Also, what about custom indexes implemented in extensions? It seems a bit strange each of them has to support this separately. IMHO if this really is the right solution, we need to make it work for existing indexes without having to tweak them individually. Why don't we track a flag whether an index on GTT was initialized in a given session, and if it was not then call the build function before calling any other function from the index AM? But let's talk about other issues caused by "on demand" build. Imagine you have 50 sessions, each using the same GTT with a GB of per-session data. Now you create a new index on the GTT, which forces the sessions to build it's "local" index. Those builds will use maintenance_work_mem each, so 50 * m_w_m. I doubt that's expected/sensible. So I suggest we start by just ignoring the *new* indexes, and improve this in the future (by building the indexes on demand or whatever). >> >>Can't we track which indexes a particular session sees, somehow? >> >>>Statistic is another important case. >>>But once again I do not completely understand why we want to >>>address all this issues with statistic in first version of the >>>patch? >> >>I think the question is which "issues with statistic" you mean. I'm sure >>we can ignore some of them, e.g. the one with parallel workers not >>having any stats (assuming we consider functions using GTT to be >>parallel restricted). > >If we do not use shared buffers for GTT then parallel processing of >GTT is not possible at all, so there is no problem with statistic for >parallel workers. > Right. >> >>I think someone pointed out pushing stuff directly into the cache is >>rather problematic, but I don't recall the details. >> >I have not encountered any problems, so if you can point me on what is >wrong with this approach, I will think about alternative solution. > I meant this comment by Robert: https://www.postgresql.org/message-id/CA%2BTgmoZFWaND4PpT_CJbeu6VZGZKi2rrTuSTL-Ykd97fexTN-w%40mail.g... regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-13 08:08 Konstantin Knizhnik <[email protected]> parent: Tomas Vondra <[email protected]> 1 sibling, 2 replies; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-13 08:08 UTC (permalink / raw) To: Tomas Vondra <[email protected]>; +Cc: 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 12.01.2020 4:51, Tomas Vondra wrote: > On Fri, Jan 10, 2020 at 11:47:42AM +0300, Konstantin Knizhnik wrote: >> >> >> On 09.01.2020 19:48, Tomas Vondra wrote: >>> >>>> The most complex and challenged task is to support GTT for all kind >>>> of indexes. Unfortunately I can not proposed some good universal >>>> solution for it. >>>> Just patching all existed indexes implementation seems to be the >>>> only choice. >>>> >>> >>> I haven't looked at the indexing issue closely, but IMO we need to >>> ensure that every session sees/uses only indexes on GTT that were >>> defined before the seesion started using the table. >> >> Why? It contradicts with behavior of normal tables. >> Assume that you have active clients and at some point of time DBA >> recognizes that them are spending to much time in scanning some GTT. >> It cab create index for this GTT but if existed client will not be >> able to use this index, then we need somehow make this clients to >> restart their sessions? >> In my patch I have implemented building indexes for GTT on demand: if >> accessed index on GTT is not yet initialized, then it is filled with >> local data. > > Yes, I know the behavior would be different from behavior for regular > tables. And yes, it would not allow fixing slow queries in sessions > without interrupting those sessions. > > I proposed just ignoring those new indexes because it seems much simpler > than alternative solutions that I can think of, and it's not like those > other solutions don't have other issues. Quit opposite: prohibiting sessions to see indexes created before session start to use GTT requires more efforts. We need to somehow maintain and check GTT first access time. > > For example, I've looked at the "on demand" building as implemented in > global_private_temp-8.patch, I kinda doubt adding a bunch of index build > calls into various places in index code seems somewht suspicious. We in any case has to initialize GTT indexes on demand even if we prohibit usages of indexes created after first access by session to GTT. So the difference is only in one thing: should we just initialize empty index or populate it with local data (if rules for index usability are the same for GTT as for normal tables). From implementation point of view there is no big difference. Actually building index in standard way is even simpler than constructing empty index. Originally I have implemented first approach (I just forgot to consider case when GTT was already user by a session). Then I rewrited it using second approach and patch even became simpler. > > * brinbuild is added to brinRevmapInitialize, which is meant to > initialize state for scanning. It seems wrong to build the index we're > scanning from this function (layering and all that). > > * btbuild is called from _bt_getbuf. That seems a bit ... suspicious? As I already mentioned - support of indexes for GTT is one of the most challenged things in my patch. I didn't find good and universal solution. So I agreed that call of btbuild from _bt_getbuf may be considered as suspicious. I will be pleased if you or sombody else can propose better elternative and not only for B-Tree, but for all other indexes. But as I already wrote above, prohibiting session to used indexes created after first access to GTT doesn't solve the problem. For normal tables (and for local temp tables) indexes are initialized at the time of their creation. With GTT it doesn't work, because each session has its own local data of GTT. We should either initialize/build index on demand (when it is first accessed), either at the moment of session start initialize indexes for all existed GTTs. Last options seem to be much worser from my point of view: there may me huge number of GTT and session may not need to access GTT at all. > > ... and so on for other index types. Also, what about custom indexes > implemented in extensions? It seems a bit strange each of them has to > support this separately. I have already complained about it: my patch supports GTT for all built-in indexes, but custom indexes has to handle it themselves. Looks like to provide some generic solution we need to extend index API, providing two diffrent operations: creation and initialization. But extending index API is very critical change... And also it doesn't solve the problem with all existed extensions: them in any case have to be rewritten to implement new API version in order to support GTT. > > IMHO if this really is the right solution, we need to make it work for > existing indexes without having to tweak them individually. Why don't we > track a flag whether an index on GTT was initialized in a given session, > and if it was not then call the build function before calling any other > function from the index AM? > But let's talk about other issues caused by "on demand" build. Imagine > you have 50 sessions, each using the same GTT with a GB of per-session > data. Now you create a new index on the GTT, which forces the sessions > to build it's "local" index. Those builds will use maintenance_work_mem > each, so 50 * m_w_m. I doubt that's expected/sensible. I do not see principle difference here with scenario when 50 sessions create (local) temp table, populate it with GB of data and create index for it. > > So I suggest we start by just ignoring the *new* indexes, and improve > this in the future (by building the indexes on demand or whatever). Sorry, but still do not agree with this suggestions: - it doesn't simplify things - it makes behavior of GTT incompatible with normal tables. - it doesn't prevent some bad or unexpected behavior which can't be currently reproduced with normal (local) temp tables. > >>> >>> I think someone pointed out pushing stuff directly into the cache is >>> rather problematic, but I don't recall the details. >>> >> I have not encountered any problems, so if you can point me on what >> is wrong with this approach, I will think about alternative solution. >> > > I meant this comment by Robert: > > https://www.postgresql.org/message-id/CA%2BTgmoZFWaND4PpT_CJbeu6VZGZKi2rrTuSTL-Ykd97fexTN-w%40mail.g... > > "if any code tried to access the statistics directly from the table, rather than via the caches". Currently optimizer is accessing statistic though caches. So this approach works. If somebody will rewrite optimizer or provide own custom optimizer in extension which access statistic directly then it we really be a problem. But I wonder why bypassing catalog cache may be needed. Moreover, if we implement alternative solution - for example make pg_statistic a view which combines results for normal tables and GTT, then existed optimizer has to be rewritten because it can not access statistic in the way it is doing now. And there will be all problem with all existed extensions which are accessing statistic in most natural way - through system cache. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-13 16:32 Tomas Vondra <[email protected]> parent: Konstantin Knizhnik <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: Tomas Vondra @ 2020-01-13 16:32 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Mon, Jan 13, 2020 at 11:08:40AM +0300, Konstantin Knizhnik wrote: > > >On 12.01.2020 4:51, Tomas Vondra wrote: >>On Fri, Jan 10, 2020 at 11:47:42AM +0300, Konstantin Knizhnik wrote: >>> >>> >>>On 09.01.2020 19:48, Tomas Vondra wrote: >>>> >>>>>The most complex and challenged task is to support GTT for all >>>>>kind of indexes. Unfortunately I can not proposed some good >>>>>universal solution for it. >>>>>Just patching all existed indexes implementation seems to be >>>>>the only choice. >>>>> >>>> >>>>I haven't looked at the indexing issue closely, but IMO we need to >>>>ensure that every session sees/uses only indexes on GTT that were >>>>defined before the seesion started using the table. >>> >>>Why? It contradicts with behavior of normal tables. >>>Assume that you have active clients and at some point of time DBA >>>recognizes that them are spending to much time in scanning some >>>GTT. >>>It cab create index for this GTT but if existed client will not be >>>able to use this index, then we need somehow make this clients to >>>restart their sessions? >>>In my patch I have implemented building indexes for GTT on demand: >>>if accessed index on GTT is not yet initialized, then it is filled >>>with local data. >> >>Yes, I know the behavior would be different from behavior for regular >>tables. And yes, it would not allow fixing slow queries in sessions >>without interrupting those sessions. >> >>I proposed just ignoring those new indexes because it seems much simpler >>than alternative solutions that I can think of, and it's not like those >>other solutions don't have other issues. > >Quit opposite: prohibiting sessions to see indexes created before >session start to use GTT requires more efforts. We need to somehow >maintain and check GTT first access time. > Hmmm, OK. I'd expect such check to be much simpler than the on-demand index building, but I admit I haven't tried implementing either of those options. >> >>For example, I've looked at the "on demand" building as implemented in >>global_private_temp-8.patch, I kinda doubt adding a bunch of index build >>calls into various places in index code seems somewht suspicious. > >We in any case has to initialize GTT indexes on demand even if we >prohibit usages of indexes created after first access by session to >GTT. >So the difference is only in one thing: should we just initialize >empty index or populate it with local data (if rules for index >usability are the same for GTT as for normal tables). From implementation point of view there is no big difference. Actually >building index in standard way is even simpler than constructing empty >index. Originally I have implemented >first approach (I just forgot to consider case when GTT was already >user by a session). Then I rewrited it using second approach and patch >even became simpler. > >> >>* brinbuild is added to brinRevmapInitialize, which is meant to >> initialize state for scanning. It seems wrong to build the index we're >> scanning from this function (layering and all that). >> >>* btbuild is called from _bt_getbuf. That seems a bit ... suspicious? > > >As I already mentioned - support of indexes for GTT is one of the most >challenged things in my patch. >I didn't find good and universal solution. So I agreed that call of >btbuild from _bt_getbuf may be considered as suspicious. >I will be pleased if you or sombody else can propose better >elternative and not only for B-Tree, but for all other indexes. > >But as I already wrote above, prohibiting session to used indexes >created after first access to GTT doesn't solve the problem. >For normal tables (and for local temp tables) indexes are initialized >at the time of their creation. >With GTT it doesn't work, because each session has its own local data >of GTT. >We should either initialize/build index on demand (when it is first >accessed), either at the moment of session start initialize indexes >for all existed GTTs. >Last options seem to be much worser from my point of view: there may >me huge number of GTT and session may not need to access GTT at all. >> >>... and so on for other index types. Also, what about custom indexes >>implemented in extensions? It seems a bit strange each of them has to >>support this separately. > >I have already complained about it: my patch supports GTT for all >built-in indexes, but custom indexes has to handle it themselves. >Looks like to provide some generic solution we need to extend index >API, providing two diffrent operations: creation and initialization. >But extending index API is very critical change... And also it doesn't >solve the problem with all existed extensions: them in any case have >to be rewritten to implement new API version in order to support GTT. > Why not to allow creating only indexes implementing this new API method (on GTT)? >> >>IMHO if this really is the right solution, we need to make it work for >>existing indexes without having to tweak them individually. Why don't we >>track a flag whether an index on GTT was initialized in a given session, >>and if it was not then call the build function before calling any other >>function from the index AM? >>But let's talk about other issues caused by "on demand" build. Imagine >>you have 50 sessions, each using the same GTT with a GB of per-session >>data. Now you create a new index on the GTT, which forces the sessions >>to build it's "local" index. Those builds will use maintenance_work_mem >>each, so 50 * m_w_m. I doubt that's expected/sensible. > >I do not see principle difference here with scenario when 50 sessions >create (local) temp table, >populate it with GB of data and create index for it. > I'd say the high memory consumption is pretty significant. >> >>So I suggest we start by just ignoring the *new* indexes, and improve >>this in the future (by building the indexes on demand or whatever). > >Sorry, but still do not agree with this suggestions: >- it doesn't simplify things >- it makes behavior of GTT incompatible with normal tables. >- it doesn't prevent some bad or unexpected behavior which can't be >currently reproduced with normal (local) temp tables. > >> >>>> >>>>I think someone pointed out pushing stuff directly into the cache is >>>>rather problematic, but I don't recall the details. >>>> >>>I have not encountered any problems, so if you can point me on >>>what is wrong with this approach, I will think about alternative >>>solution. >>> >> >>I meant this comment by Robert: >> >>https://www.postgresql.org/message-id/CA%2BTgmoZFWaND4PpT_CJbeu6VZGZKi2rrTuSTL-Ykd97fexTN-w%40mail.g... >> >> >"if any code tried to access the statistics directly from the table, >rather than via the caches". > >Currently optimizer is accessing statistic though caches. So this >approach works. If somebody will rewrite optimizer or provide own >custom optimizer in extension which access statistic directly >then it we really be a problem. But I wonder why bypassing catalog >cache may be needed. > I don't know, but it seems extensions like hypopg do it. >Moreover, if we implement alternative solution - for example make >pg_statistic a view which combines results for normal tables and GTT, >then existed optimizer has to be rewritten >because it can not access statistic in the way it is doing now. And >there will be all problem with all existed extensions which are >accessing statistic in most natural way - through system cache. > Perhaps. I don't know enough about this part of the code to have a strong opinion. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-13 20:12 Julien Rouhaud <[email protected]> parent: Tomas Vondra <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Julien Rouhaud @ 2020-01-13 20:12 UTC (permalink / raw) To: Tomas Vondra <[email protected]>; +Cc: Konstantin Knizhnik <[email protected]>; 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Mon, Jan 13, 2020 at 05:32:53PM +0100, Tomas Vondra wrote: > On Mon, Jan 13, 2020 at 11:08:40AM +0300, Konstantin Knizhnik wrote: > > > >"if any code tried to access the statistics directly from the table, > >rather than via the caches". > > > >Currently optimizer is accessing statistic though caches. So this > >approach works. If somebody will rewrite optimizer or provide own > >custom optimizer in extension which access statistic directly > >then it we really be a problem. But I wonder why bypassing catalog > >cache may be needed. > > > > I don't know, but it seems extensions like hypopg do it. AFAIR, hypopg only opens pg_statistic to use its tupledesc when creating statistics on hypothetical partitions, but it should otherwise never reads or need plain pg_statistic rows. ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-13 21:03 Tomas Vondra <[email protected]> parent: Julien Rouhaud <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Tomas Vondra @ 2020-01-13 21:03 UTC (permalink / raw) To: Julien Rouhaud <[email protected]>; +Cc: Konstantin Knizhnik <[email protected]>; 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Mon, Jan 13, 2020 at 09:12:38PM +0100, Julien Rouhaud wrote: >On Mon, Jan 13, 2020 at 05:32:53PM +0100, Tomas Vondra wrote: >> On Mon, Jan 13, 2020 at 11:08:40AM +0300, Konstantin Knizhnik wrote: >> > >> >"if any code tried to access the statistics directly from the table, >> >rather than via the caches". >> > >> >Currently optimizer is accessing statistic though caches. So this >> >approach works. If somebody will rewrite optimizer or provide own >> >custom optimizer in extension which access statistic directly >> >then it we really be a problem. But I wonder why bypassing catalog >> >cache may be needed. >> > >> >> I don't know, but it seems extensions like hypopg do it. > >AFAIR, hypopg only opens pg_statistic to use its tupledesc when creating >statistics on hypothetical partitions, but it should otherwise never reads or >need plain pg_statistic rows. Ah, OK! Thanks for the clarification. I knew it does something with the catalog, didn't realize it only gets the descriptor. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-14 13:09 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Pavel Stehule <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-14 13:09 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> Thank you for review my patch. > 2020年1月12日 上午4:27,Pavel Stehule <[email protected]> 写道: > > Hi > > so 11. 1. 2020 v 15:00 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: > Hi all > > This is the latest patch > > The updates are as follows: > 1. Support global temp Inherit table global temp partition table > 2. Support serial column in GTT > 3. Provide views pg_gtt_relstats pg_gtt_stats for GTT’s statistics > 4. Provide view pg_gtt_attached_pids to manage GTT > 5. Provide function pg_list_gtt_relfrozenxids() to manage GTT > 6. Alter GTT or rename GTT is allowed under some conditions > > > Please give me feedback. > > I tested the functionality > > 1. i think so "ON COMMIT PRESERVE ROWS" should be default mode (like local temp tables). makes sense, I will fix it. > > I tested some simple scripts > > test01.sql > > CREATE TEMP TABLE foo(a int, b int); > INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); > ANALYZE foo; > SELECT sum(a), sum(b) FROM foo; > DROP TABLE foo; -- simulate disconnect > > > after 100 sec, the table pg_attribute has 3.2MB > and 64 tps, 6446 transaction > > test02.sql > > INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); > ANALYZE foo; > SELECT sum(a), sum(b) FROM foo; > DELETE FROM foo; -- simulate disconnect > > > after 100 sec, 1688 tps, 168830 transactions > > So performance is absolutely different as we expected. > > From my perspective, this functionality is great. Yes, frequent ddl causes catalog bloat, GTT avoids this problem. > > Todo: > > pg_table_size function doesn't work Do you mean that function pg_table_size() need get the storage space used by the one GTT in the entire db(include all session) . > > Regards > > Pavel > > > Wenjing > > > > > >> 2020年1月6日 上午4:06,Tomas Vondra <[email protected] <mailto:[email protected]>> 写道: >> >> Hi, >> >> I think we need to do something with having two patches aiming to add >> global temporary tables: >> >> [1] https://commitfest.postgresql.org/26/2349/ <https://commitfest.postgresql.org/26/2349/; >> >> [2] https://commitfest.postgresql.org/26/2233/ <https://commitfest.postgresql.org/26/2233/; >> >> As a reviewer I have no idea which of the threads to look at - certainly >> not without reading both threads, which I doubt anyone will really do. >> The reviews and discussions are somewhat intermixed between those two >> threads, which makes it even more confusing. >> >> I think we should agree on a minimal patch combining the necessary/good >> bits from the various patches, and terminate one of the threads (i.e. >> mark it as rejected or RWF). And we need to do that now, otherwise >> there's about 0% chance of getting this into v13. >> >> In general, I agree with the sentiment Rober expressed in [1] - the >> patch needs to be as small as possible, not adding "nice to have" >> features (like support for parallel queries - I very much doubt just >> using shared instead of local buffers is enough to make it work.) >> >> regards >> >> -- >> Tomas Vondra http://www.2ndQuadrant.com <http://www.2ndquadrant.com/; >> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-14 13:20 Pavel Stehule <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 0 siblings, 2 replies; 1038+ messages in thread From: Pavel Stehule @ 2020-01-14 13:20 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> út 14. 1. 2020 v 14:09 odesílatel 曾文旌(义从) <[email protected]> napsal: > Thank you for review my patch. > > > 2020年1月12日 上午4:27,Pavel Stehule <[email protected]> 写道: > > Hi > > so 11. 1. 2020 v 15:00 odesílatel 曾文旌(义从) <[email protected]> > napsal: > >> Hi all >> >> This is the latest patch >> >> The updates are as follows: >> 1. Support global temp Inherit table global temp partition table >> 2. Support serial column in GTT >> 3. Provide views pg_gtt_relstats pg_gtt_stats for GTT’s statistics >> 4. Provide view pg_gtt_attached_pids to manage GTT >> 5. Provide function pg_list_gtt_relfrozenxids() to manage GTT >> 6. Alter GTT or rename GTT is allowed under some conditions >> >> >> Please give me feedback. >> > > I tested the functionality > > 1. i think so "ON COMMIT PRESERVE ROWS" should be default mode (like local > temp tables). > > makes sense, I will fix it. > > > I tested some simple scripts > > test01.sql > > CREATE TEMP TABLE foo(a int, b int); > INSERT INTO foo SELECT random()*100, random()*1000 FROM > generate_series(1,1000); > ANALYZE foo; > SELECT sum(a), sum(b) FROM foo; > DROP TABLE foo; -- simulate disconnect > > > after 100 sec, the table pg_attribute has 3.2MB > and 64 tps, 6446 transaction > > test02.sql > > INSERT INTO foo SELECT random()*100, random()*1000 FROM > generate_series(1,1000); > ANALYZE foo; > SELECT sum(a), sum(b) FROM foo; > DELETE FROM foo; -- simulate disconnect > > > after 100 sec, 1688 tps, 168830 transactions > > So performance is absolutely different as we expected. > > From my perspective, this functionality is great. > > Yes, frequent ddl causes catalog bloat, GTT avoids this problem. > > > Todo: > > pg_table_size function doesn't work > > Do you mean that function pg_table_size() need get the storage space used > by the one GTT in the entire db(include all session) . > It's question how much GTT tables should be similar to classic tables. But the reporting in psql should to work \dt+, \l+, \di+ > > Regards > > Pavel > > >> Wenjing >> >> >> >> >> >> 2020年1月6日 上午4:06,Tomas Vondra <[email protected]> 写道: >> >> Hi, >> >> I think we need to do something with having two patches aiming to add >> global temporary tables: >> >> [1] https://commitfest.postgresql.org/26/2349/ >> >> [2] https://commitfest.postgresql.org/26/2233/ >> >> As a reviewer I have no idea which of the threads to look at - certainly >> not without reading both threads, which I doubt anyone will really do. >> The reviews and discussions are somewhat intermixed between those two >> threads, which makes it even more confusing. >> >> I think we should agree on a minimal patch combining the necessary/good >> bits from the various patches, and terminate one of the threads (i.e. >> mark it as rejected or RWF). And we need to do that now, otherwise >> there's about 0% chance of getting this into v13. >> >> In general, I agree with the sentiment Rober expressed in [1] - the >> patch needs to be as small as possible, not adding "nice to have" >> features (like support for parallel queries - I very much doubt just >> using shared instead of local buffers is enough to make it work.) >> >> regards >> >> -- >> Tomas Vondra http://www.2ndQuadrant.com >> <http://www.2ndquadrant.com/; >> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services >> >> >> > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-14 14:15 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Tomas Vondra <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-14 14:15 UTC (permalink / raw) To: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月12日 上午9:14,Tomas Vondra <[email protected]> 写道: > > On Fri, Jan 10, 2020 at 03:24:34PM +0300, Konstantin Knizhnik wrote: >> >> >> On 09.01.2020 19:30, Tomas Vondra wrote: >> >> >>> >>>> >>>>> >>>>>> 3 Still no one commented on GTT's transaction information processing, they include >>>>>> 3.1 Should gtt's frozenxid need to be care? >>>>>> 3.2 gtt’s clog clean >>>>>> 3.3 How to deal with "too old" gtt data >>>>>> >>>>> >>>>> No idea what to do about this. >>>>> >>>> >>>> I wonder what is the specific of GTT here? >>>> The same problem takes place for normal (local) temp tables, doesn't it? >>>> >>> >>> Not sure. TBH I'm not sure I understand what the issue actually is. >> >> Just open session, create temporary table and insert some data in it. >> Then in other session run 2^31 transactions (at my desktop it takes about 2 hours). >> As far as temp tables are not proceeded by vacuum, database is stalled: >> >> ERROR: database is not accepting commands to avoid wraparound data loss in database "postgres" >> >> It seems to be quite dubious behavior and it is strange to me that nobody complains about it. >> We discuss many issues related with temp tables (statistic, parallel queries,...) which seems to be less critical. >> >> But this problem is not specific to GTT - it can be reproduced with normal (local) temp tables. >> This is why I wonder why do we need to solve it in GTT patch. >> > > Yeah, I think that's out of scope for GTT patch. Once we solve it for > plain temporary tables, we'll solve it for GTT too. 1. The core problem is that the data contains transaction information (xid), which needs to be vacuum(freeze) regularly to avoid running out of xid. The autovacuum supports vacuum regular table but local temp does not. autovacuum also does not support GTT. 2. However, the difference between the local temp table and the global temp table(GTT) is that a) For local temp table: one table hava one piece of data. the frozenxid of one local temp table is store in the catalog(pg_class). b) For global temp table: each session has a separate copy of data, one GTT may contain maxbackend frozenxid. and I don't think it's a good idea to keep frozenxid of GTT in the catalog(pg_class). It becomes a question: how to handle GTT transaction information? I agree that problem 1 should be completely solved by a some feature, such as local transactions. It is definitely not included in the GTT patch. But, I think we need to ensure the durability of GTT data. For example, data in GTT cannot be lost due to the clog being cleaned up. It belongs to problem 2. Wenjing > > regards > > -- > Tomas Vondra http://www.2ndQuadrant.com > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-14 14:16 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Pavel Stehule <[email protected]> 1 sibling, 0 replies; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-14 14:16 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月14日 下午9:20,Pavel Stehule <[email protected]> 写道: > > > > út 14. 1. 2020 v 14:09 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: > Thank you for review my patch. > > >> 2020年1月12日 上午4:27,Pavel Stehule <[email protected] <mailto:[email protected]>> 写道: >> >> Hi >> >> so 11. 1. 2020 v 15:00 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: >> Hi all >> >> This is the latest patch >> >> The updates are as follows: >> 1. Support global temp Inherit table global temp partition table >> 2. Support serial column in GTT >> 3. Provide views pg_gtt_relstats pg_gtt_stats for GTT’s statistics >> 4. Provide view pg_gtt_attached_pids to manage GTT >> 5. Provide function pg_list_gtt_relfrozenxids() to manage GTT >> 6. Alter GTT or rename GTT is allowed under some conditions >> >> >> Please give me feedback. >> >> I tested the functionality >> >> 1. i think so "ON COMMIT PRESERVE ROWS" should be default mode (like local temp tables). > makes sense, I will fix it. > >> >> I tested some simple scripts >> >> test01.sql >> >> CREATE TEMP TABLE foo(a int, b int); >> INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); >> ANALYZE foo; >> SELECT sum(a), sum(b) FROM foo; >> DROP TABLE foo; -- simulate disconnect >> >> >> after 100 sec, the table pg_attribute has 3.2MB >> and 64 tps, 6446 transaction >> >> test02.sql >> >> INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); >> ANALYZE foo; >> SELECT sum(a), sum(b) FROM foo; >> DELETE FROM foo; -- simulate disconnect >> >> >> after 100 sec, 1688 tps, 168830 transactions >> >> So performance is absolutely different as we expected. >> >> From my perspective, this functionality is great. > Yes, frequent ddl causes catalog bloat, GTT avoids this problem. > >> >> Todo: >> >> pg_table_size function doesn't work > Do you mean that function pg_table_size() need get the storage space used by the one GTT in the entire db(include all session) . > > It's question how much GTT tables should be similar to classic tables. But the reporting in psql should to work \dt+, \l+, \di+ Get it, I will fix it. > > > >> >> Regards >> >> Pavel >> >> >> Wenjing >> >> >> >> >> >>> 2020年1月6日 上午4:06,Tomas Vondra <[email protected] <mailto:[email protected]>> 写道: >>> >>> Hi, >>> >>> I think we need to do something with having two patches aiming to add >>> global temporary tables: >>> >>> [1] https://commitfest.postgresql.org/26/2349/ <https://commitfest.postgresql.org/26/2349/; >>> >>> [2] https://commitfest.postgresql.org/26/2233/ <https://commitfest.postgresql.org/26/2233/; >>> >>> As a reviewer I have no idea which of the threads to look at - certainly >>> not without reading both threads, which I doubt anyone will really do. >>> The reviews and discussions are somewhat intermixed between those two >>> threads, which makes it even more confusing. >>> >>> I think we should agree on a minimal patch combining the necessary/good >>> bits from the various patches, and terminate one of the threads (i.e. >>> mark it as rejected or RWF). And we need to do that now, otherwise >>> there's about 0% chance of getting this into v13. >>> >>> In general, I agree with the sentiment Rober expressed in [1] - the >>> patch needs to be as small as possible, not adding "nice to have" >>> features (like support for parallel queries - I very much doubt just >>> using shared instead of local buffers is enough to make it work.) >>> >>> regards >>> >>> -- >>> Tomas Vondra http://www.2ndQuadrant.com <http://www.2ndquadrant.com/; >>> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services >> > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-15 13:10 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Konstantin Knizhnik <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-15 13:10 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; Tomas Vondra <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月13日 下午4:08,Konstantin Knizhnik <[email protected]> 写道: > > > > On 12.01.2020 4:51, Tomas Vondra wrote: >> On Fri, Jan 10, 2020 at 11:47:42AM +0300, Konstantin Knizhnik wrote: >>> >>> >>> On 09.01.2020 19:48, Tomas Vondra wrote: >>>> >>>>> The most complex and challenged task is to support GTT for all kind of indexes. Unfortunately I can not proposed some good universal solution for it. >>>>> Just patching all existed indexes implementation seems to be the only choice. >>>>> >>>> >>>> I haven't looked at the indexing issue closely, but IMO we need to >>>> ensure that every session sees/uses only indexes on GTT that were >>>> defined before the seesion started using the table. >>> >>> Why? It contradicts with behavior of normal tables. >>> Assume that you have active clients and at some point of time DBA recognizes that them are spending to much time in scanning some GTT. >>> It cab create index for this GTT but if existed client will not be able to use this index, then we need somehow make this clients to restart their sessions? >>> In my patch I have implemented building indexes for GTT on demand: if accessed index on GTT is not yet initialized, then it is filled with local data. >> >> Yes, I know the behavior would be different from behavior for regular >> tables. And yes, it would not allow fixing slow queries in sessions >> without interrupting those sessions. >> >> I proposed just ignoring those new indexes because it seems much simpler >> than alternative solutions that I can think of, and it's not like those >> other solutions don't have other issues. > > Quit opposite: prohibiting sessions to see indexes created before session start to use GTT requires more efforts. We need to somehow maintain and check GTT first access time. > >> >> For example, I've looked at the "on demand" building as implemented in >> global_private_temp-8.patch, I kinda doubt adding a bunch of index build >> calls into various places in index code seems somewht suspicious. > > We in any case has to initialize GTT indexes on demand even if we prohibit usages of indexes created after first access by session to GTT. > So the difference is only in one thing: should we just initialize empty index or populate it with local data (if rules for index usability are the same for GTT as for normal tables). > From implementation point of view there is no big difference. Actually building index in standard way is even simpler than constructing empty index. Originally I have implemented > first approach (I just forgot to consider case when GTT was already user by a session). Then I rewrited it using second approach and patch even became simpler. > >> >> * brinbuild is added to brinRevmapInitialize, which is meant to >> initialize state for scanning. It seems wrong to build the index we're >> scanning from this function (layering and all that). >> >> * btbuild is called from _bt_getbuf. That seems a bit ... suspicious? > > > As I already mentioned - support of indexes for GTT is one of the most challenged things in my patch. > I didn't find good and universal solution. So I agreed that call of btbuild from _bt_getbuf may be considered as suspicious. > I will be pleased if you or sombody else can propose better elternative and not only for B-Tree, but for all other indexes. > > But as I already wrote above, prohibiting session to used indexes created after first access to GTT doesn't solve the problem. > For normal tables (and for local temp tables) indexes are initialized at the time of their creation. > With GTT it doesn't work, because each session has its own local data of GTT. > We should either initialize/build index on demand (when it is first accessed), either at the moment of session start initialize indexes for all existed GTTs. > Last options seem to be much worser from my point of view: there may me huge number of GTT and session may not need to access GTT at all. >> >> ... and so on for other index types. Also, what about custom indexes >> implemented in extensions? It seems a bit strange each of them has to >> support this separately. > > I have already complained about it: my patch supports GTT for all built-in indexes, but custom indexes has to handle it themselves. > Looks like to provide some generic solution we need to extend index API, providing two diffrent operations: creation and initialization. > But extending index API is very critical change... And also it doesn't solve the problem with all existed extensions: them in any case have > to be rewritten to implement new API version in order to support GTT. >> >> IMHO if this really is the right solution, we need to make it work for >> existing indexes without having to tweak them individually. Why don't we >> track a flag whether an index on GTT was initialized in a given session, >> and if it was not then call the build function before calling any other >> function from the index AM? >> But let's talk about other issues caused by "on demand" build. Imagine >> you have 50 sessions, each using the same GTT with a GB of per-session >> data. Now you create a new index on the GTT, which forces the sessions >> to build it's "local" index. Those builds will use maintenance_work_mem >> each, so 50 * m_w_m. I doubt that's expected/sensible. > > I do not see principle difference here with scenario when 50 sessions create (local) temp table, > populate it with GB of data and create index for it. I think the problem is that when one session completes the creation of the index on GTT, it will trigger the other sessions build own local index of GTT in a centralized time. This will consume a lot of hardware resources (cpu io memory) in a short time, and even the database service becomes slow, because 50 sessions are building index. I think this is not what we expected. > >> >> So I suggest we start by just ignoring the *new* indexes, and improve >> this in the future (by building the indexes on demand or whatever). > > Sorry, but still do not agree with this suggestions: > - it doesn't simplify things > - it makes behavior of GTT incompatible with normal tables. > - it doesn't prevent some bad or unexpected behavior which can't be currently reproduced with normal (local) temp tables. From a user perspective, this proposal is reasonable. From an implementation perspective, the same GTT index needs to maintain different states (valid or invalid) in different sessions, which seems difficult to do in the current framework. So in my first version, I chose to complete all index creation before using GTT. I think this will satisfy most use cases. > >> >>>> >>>> I think someone pointed out pushing stuff directly into the cache is >>>> rather problematic, but I don't recall the details. >>>> >>> I have not encountered any problems, so if you can point me on what is wrong with this approach, I will think about alternative solution. >>> >> >> I meant this comment by Robert: >> >> https://www.postgresql.org/message-id/CA%2BTgmoZFWaND4PpT_CJbeu6VZGZKi2rrTuSTL-Ykd97fexTN-w%40mail.g... >> > "if any code tried to access the statistics directly from the table, rather than via the caches". > > Currently optimizer is accessing statistic though caches. So this approach works. If somebody will rewrite optimizer or provide own custom optimizer in extension which access statistic directly > then it we really be a problem. But I wonder why bypassing catalog cache may be needed. > > Moreover, if we implement alternative solution - for example make pg_statistic a view which combines results for normal tables and GTT, then existed optimizer has to be rewritten > because it can not access statistic in the way it is doing now. And there will be all problem with all existed extensions which are accessing statistic in most natural way - through system cache. > > > > -- > Konstantin Knizhnik > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-16 07:23 Konstantin Knizhnik <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-16 07:23 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; Tomas Vondra <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Robert Haas <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 15.01.2020 16:10, 曾文旌(义从) wrote: > >> I do not see principle difference here with scenario when 50 sessions create (local) temp table, >> populate it with GB of data and create index for it. > I think the problem is that when one session completes the creation of the index on GTT, > it will trigger the other sessions build own local index of GTT in a centralized time. > This will consume a lot of hardware resources (cpu io memory) in a short time, > and even the database service becomes slow, because 50 sessions are building index. > I think this is not what we expected. First of all creating index for GTT ni one session doesn't immediately initiate building indexes in all other sessions. Indexes are built on demand. If session is not using this GTT any more, then index for it will not build at all. And if GTT is really are actively used by all sessions, then building index and using it for constructing optimal execution plan is better, then continue to use sequential scan and read all GTT data from the disk. And as I already mentioned I do not see some principle difference in aspect of resource consumptions comparing with current usage of local temp tables. If we have have many sessions, each creating temp table, populating it with data and building index for it, then we will observe the same CPU utilization and memory resource consumption as in case of using GTT and creating index for it. Sorry, but I still not convinced by your and Tomas arguments. Yes, building GTT index may cause high memory consumption (maintenance_work_mem * n_backends). But such consumption can be observed also without GTT and it has to be taken in account when choosing value for maintenance_work_mem. But from my point of view it is much more important to make behavior of GTT as much compatible with normal tables as possible. Also from database administration point of view, necessity to restart sessions to make then use new indexes seems to be very strange and inconvenient. Alternatively DBA can address the problem with high memory consumption by adjusting maintenance_work_mem, so this solution is more flexible. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-19 17:04 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Pavel Stehule <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-19 17:04 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; +Cc: Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月14日 下午9:20,Pavel Stehule <[email protected]> 写道: > > > > út 14. 1. 2020 v 14:09 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: > Thank you for review my patch. > > >> 2020年1月12日 上午4:27,Pavel Stehule <[email protected] <mailto:[email protected]>> 写道: >> >> Hi >> >> so 11. 1. 2020 v 15:00 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: >> Hi all >> >> This is the latest patch >> >> The updates are as follows: >> 1. Support global temp Inherit table global temp partition table >> 2. Support serial column in GTT >> 3. Provide views pg_gtt_relstats pg_gtt_stats for GTT’s statistics >> 4. Provide view pg_gtt_attached_pids to manage GTT >> 5. Provide function pg_list_gtt_relfrozenxids() to manage GTT >> 6. Alter GTT or rename GTT is allowed under some conditions >> >> >> Please give me feedback. >> >> I tested the functionality >> >> 1. i think so "ON COMMIT PRESERVE ROWS" should be default mode (like local temp tables). > makes sense, I will fix it. > >> >> I tested some simple scripts >> >> test01.sql >> >> CREATE TEMP TABLE foo(a int, b int); >> INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); >> ANALYZE foo; >> SELECT sum(a), sum(b) FROM foo; >> DROP TABLE foo; -- simulate disconnect >> >> >> after 100 sec, the table pg_attribute has 3.2MB >> and 64 tps, 6446 transaction >> >> test02.sql >> >> INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); >> ANALYZE foo; >> SELECT sum(a), sum(b) FROM foo; >> DELETE FROM foo; -- simulate disconnect >> >> >> after 100 sec, 1688 tps, 168830 transactions >> >> So performance is absolutely different as we expected. >> >> From my perspective, this functionality is great. > Yes, frequent ddl causes catalog bloat, GTT avoids this problem. > >> >> Todo: >> >> pg_table_size function doesn't work > Do you mean that function pg_table_size() need get the storage space used by the one GTT in the entire db(include all session) . > > It's question how much GTT tables should be similar to classic tables. But the reporting in psql should to work \dt+, \l+, \di+ I have fixed this problem. Please let me know where I need to improve. Thanks Wenjing > > > >> >> Regards >> >> Pavel >> >> >> Wenjing >> >> >> >> >> >>> 2020年1月6日 上午4:06,Tomas Vondra <[email protected] <mailto:[email protected]>> 写道: >>> >>> Hi, >>> >>> I think we need to do something with having two patches aiming to add >>> global temporary tables: >>> >>> [1] https://commitfest.postgresql.org/26/2349/ <https://commitfest.postgresql.org/26/2349/; >>> >>> [2] https://commitfest.postgresql.org/26/2233/ <https://commitfest.postgresql.org/26/2233/; >>> >>> As a reviewer I have no idea which of the threads to look at - certainly >>> not without reading both threads, which I doubt anyone will really do. >>> The reviews and discussions are somewhat intermixed between those two >>> threads, which makes it even more confusing. >>> >>> I think we should agree on a minimal patch combining the necessary/good >>> bits from the various patches, and terminate one of the threads (i.e. >>> mark it as rejected or RWF). And we need to do that now, otherwise >>> there's about 0% chance of getting this into v13. >>> >>> In general, I agree with the sentiment Rober expressed in [1] - the >>> patch needs to be as small as possible, not adding "nice to have" >>> features (like support for parallel queries - I very much doubt just >>> using shared instead of local buffers is enough to make it work.) >>> >>> regards >>> >>> -- >>> Tomas Vondra http://www.2ndQuadrant.com <http://www.2ndquadrant.com/; >>> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services >> > Attachments: [application/octet-stream] global_temporary_table_v4-pg13.patch (159.2K, ../../[email protected]/3-global_temporary_table_v4-pg13.patch) download | inline diff: diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 79430d2..b7173c7 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -158,6 +158,19 @@ static relopt_bool boolRelOpts[] = }, true }, + /* + * For global temp table only + * use AccessExclusiveLock for ensure safety + */ + { + { + "on_commit_delete_rows", + "global temp table on commit options", + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, + ShareUpdateExclusiveLock + }, + true + }, /* list terminator */ {{NULL}} }; @@ -1486,6 +1499,8 @@ bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind) { static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)}, {"fillfactor", RELOPT_TYPE_INT, offsetof(StdRdOptions, fillfactor)}, {"autovacuum_enabled", RELOPT_TYPE_BOOL, offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, enabled)}, @@ -1586,13 +1601,18 @@ build_reloptions(Datum reloptions, bool validate, bytea * partitioned_table_reloptions(Datum reloptions, bool validate) { + static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)} + }; + /* * There are no options for partitioned tables yet, but this is able to do * some validation. */ return (bytea *) build_reloptions(reloptions, validate, RELOPT_KIND_PARTITIONED, - 0, NULL, 0); + sizeof(StdRdOptions), tab, lengthof(tab)); } /* diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index dd975b1..1610e7d 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -1013,7 +1013,9 @@ gistGetFakeLSN(Relation rel) { static XLogRecPtr counter = FirstNormalUnloggedLSN; - if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + /* global temp is same as local temp table */ + if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + rel->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { /* * Temporary relations are only accessible in our session, so a simple diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 4bb6efc..8dc8b03 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -146,7 +146,9 @@ hashbuild(Relation heap, Relation index, IndexInfo *indexInfo) * metapage, nor the first bitmap page. */ sort_threshold = (maintenance_work_mem * 1024L) / BLCKSZ; - if (index->rd_rel->relpersistence != RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + if (!(index->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + index->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) sort_threshold = Min(sort_threshold, NBuffers); else sort_threshold = Min(sort_threshold, NLocBuffer); diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index a6c369e..675c2b8 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -598,7 +598,7 @@ heapam_relation_set_new_filenode(Relation rel, */ *minmulti = GetOldestMultiXactId(); - srel = RelationCreateStorage(*newrnode, persistence); + srel = RelationCreateStorage(*newrnode, persistence, rel); /* * If required, set up an init fork for an unlogged table so that it can @@ -651,7 +651,7 @@ heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index a5fe904..be6fc5f 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -60,6 +60,7 @@ #include "utils/pg_rusage.h" #include "utils/timestamp.h" +#include "catalog/storage_gtt.h" /* * Space/time tradeoff parameters: do these need to be user-tunable? @@ -217,8 +218,10 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, Assert(params->truncate != VACOPT_TERNARY_DEFAULT); /* not every AM requires these to be valid, but heap does */ - Assert(TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); - Assert(MultiXactIdIsValid(onerel->rd_rel->relminmxid)); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relfrozenxid == InvalidTransactionId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && TransactionIdIsNormal(onerel->rd_rel->relfrozenxid))); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relminmxid == InvalidMultiXactId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && MultiXactIdIsValid(onerel->rd_rel->relminmxid))); /* measure elapsed time iff autovacuum logging requires it */ if (IsAutoVacuumWorkerProcess() && params->log_min_duration >= 0) @@ -277,8 +280,19 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, vacrelstats = (LVRelStats *) palloc0(sizeof(LVRelStats)); - vacrelstats->old_rel_pages = onerel->rd_rel->relpages; - vacrelstats->old_live_tuples = onerel->rd_rel->reltuples; + /* get relstat from gtt localhash */ + if (RELATION_IS_GLOBAL_TEMP(onerel)) + { + get_gtt_relstats(RelationGetRelid(onerel), + &vacrelstats->old_rel_pages, + &vacrelstats->old_live_tuples, + NULL, NULL, NULL); + } + else + { + vacrelstats->old_rel_pages = onerel->rd_rel->relpages; + vacrelstats->old_live_tuples = onerel->rd_rel->reltuples; + } vacrelstats->num_index_scans = 0; vacrelstats->pages_removed = 0; vacrelstats->lock_waiter_detected = false; diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index f05cbe7..946c9d2 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -763,7 +763,14 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access) /* Read an existing block of the relation */ buf = ReadBuffer(rel, blkno); LockBuffer(buf, access); - _bt_checkpage(rel, buf); + + /* global temp table may be not yet initialized for this backend. */ + if (RELATION_IS_GLOBAL_TEMP(rel) && + blkno == BTREE_METAPAGE && + PageIsNew(BufferGetPage(buf))) + _bt_initmetapage(BufferGetPage(buf), P_NONE, 0); + else + _bt_checkpage(rel, buf); } else { diff --git a/src/backend/access/table/tableam.c b/src/backend/access/table/tableam.c index c814733..ff51840 100644 --- a/src/backend/access/table/tableam.c +++ b/src/backend/access/table/tableam.c @@ -24,6 +24,7 @@ #include "access/heapam.h" /* for ss_* */ #include "access/tableam.h" #include "access/xact.h" +#include "catalog/storage_gtt.h" #include "optimizer/plancat.h" #include "storage/bufmgr.h" #include "storage/shmem.h" @@ -560,10 +561,20 @@ table_block_relation_estimate_size(Relation rel, int32 *attr_widths, /* it should have storage, so we can call the smgr */ curpages = RelationGetNumberOfBlocks(rel); - /* coerce values in pg_class to more desirable types */ - relpages = (BlockNumber) rel->rd_rel->relpages; - reltuples = (double) rel->rd_rel->reltuples; - relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + /* global temp table get relstats from localhash */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + get_gtt_relstats(RelationGetRelid(rel), + &relpages, &reltuples, &relallvisible, + NULL, NULL); + } + else + { + /* coerce values in pg_class to more desirable types */ + relpages = (BlockNumber) rel->rd_rel->relpages; + reltuples = (double) rel->rd_rel->reltuples; + relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + } /* * HACK: if the relation has never yet been vacuumed, use a minimum size diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 7f4f784..aba8a9f 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6327,6 +6327,10 @@ StartupXLOG(void) else recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID; + /* clean temp relation files */ + if (max_active_gtt > 0) + RemovePgTempFiles(); + /* * Check for signal files, and if so set up state for offline recovery */ diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index 61db650..fb87816 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -44,6 +44,8 @@ OBJS = \ storage.o \ toasting.o +OBJS += storage_gtt.o + BKIFILES = postgres.bki postgres.description postgres.shdescription include $(top_srcdir)/src/backend/common.mk diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c index 16cb6d8..f28f2c2 100644 --- a/src/backend/catalog/catalog.c +++ b/src/backend/catalog/catalog.c @@ -398,7 +398,9 @@ GetNewRelFileNode(Oid reltablespace, Relation pg_class, char relpersistence) switch (relpersistence) { + /* global temp table is same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); break; case RELPERSISTENCE_UNLOGGED: diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 0fdff29..54a5243 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -61,6 +61,7 @@ #include "catalog/pg_type.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "commands/tablecmds.h" #include "commands/typecmds.h" #include "executor/executor.h" @@ -99,6 +100,7 @@ static void AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -404,6 +406,10 @@ heap_create(const char *relname, relpersistence, relkind); + /* global temp table not create storage file when catalog create */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + create_storage = false; + /* * Have the storage manager create the relation's disk file, if needed. * @@ -427,7 +433,7 @@ heap_create(const char *relname, case RELKIND_INDEX: case RELKIND_SEQUENCE: - RelationCreateStorage(rel->rd_node, relpersistence); + RelationCreateStorage(rel->rd_node, relpersistence, rel); break; case RELKIND_RELATION: @@ -956,6 +962,7 @@ AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -994,8 +1001,18 @@ AddNewRelationTuple(Relation pg_class_desc, break; } - new_rel_reltup->relfrozenxid = relfrozenxid; - new_rel_reltup->relminmxid = relminmxid; + /* global temp table not remember transaction info in catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + new_rel_reltup->relfrozenxid = InvalidTransactionId; + new_rel_reltup->relminmxid = InvalidMultiXactId; + } + else + { + new_rel_reltup->relfrozenxid = relfrozenxid; + new_rel_reltup->relminmxid = relminmxid; + } + new_rel_reltup->relowner = relowner; new_rel_reltup->reltype = new_type_oid; new_rel_reltup->reloftype = reloftype; @@ -1357,6 +1374,7 @@ heap_create_with_catalog(const char *relname, reloftypeid, ownerid, relkind, + relpersistence, relfrozenxid, relminmxid, PointerGetDatum(relacl), @@ -1441,11 +1459,15 @@ heap_create_with_catalog(const char *relname, */ StoreConstraints(new_rel_desc, cooked_constraints, is_internal); - /* - * If there's a special on-commit action, remember it - */ - if (oncommit != ONCOMMIT_NOOP) - register_on_commit_action(relid, oncommit); + /* global temp table register action when storage init */ + if (relpersistence != RELPERSISTENCE_GLOBAL_TEMP) + { + /* + * If there's a special on-commit action, remember it + */ + if (oncommit != ONCOMMIT_NOOP) + register_on_commit_action(relid, oncommit); + } /* * ok, the relation has been cataloged, so close our relations and return @@ -1937,6 +1959,13 @@ heap_drop_with_catalog(Oid relid) if (relid == defaultPartOid) update_default_partition_oid(parentOid, InvalidOid); + /* We allow to drop global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not drop relation when other backend attached this global temp table"); + } + /* * Schedule unlinking of the relation's physical files at commit. */ @@ -3163,9 +3192,10 @@ RemoveStatistics(Oid relid, AttrNumber attnum) * * The routine will truncate and then reconstruct the indexes on * the specified relation. Caller must hold exclusive lock on rel. + * */ static void -RelationTruncateIndexes(Relation heapRelation) +RelationTruncateIndexes(Relation heapRelation, LOCKMODE lockmode) { ListCell *indlist; @@ -3177,7 +3207,7 @@ RelationTruncateIndexes(Relation heapRelation) IndexInfo *indexInfo; /* Open the index relation; use exclusive lock, just to be sure */ - currentIndex = index_open(indexId, AccessExclusiveLock); + currentIndex = index_open(indexId, lockmode); /* * Fetch info needed for index_build. Since we know there are no @@ -3223,8 +3253,13 @@ heap_truncate(List *relids) { Oid rid = lfirst_oid(cell); Relation rel; + LOCKMODE lockmode = AccessExclusiveLock; - rel = table_open(rid, AccessExclusiveLock); + /* truncate global temp table only need RowExclusiveLock */ + if (get_rel_persistence(rid) == RELPERSISTENCE_GLOBAL_TEMP) + lockmode = RowExclusiveLock; + + rel = table_open(rid, lockmode); relations = lappend(relations, rel); } @@ -3257,6 +3292,8 @@ void heap_truncate_one_rel(Relation rel) { Oid toastrelid; + LOCKMODE lockmode = AccessExclusiveLock; + bool truncate_toastrel = false; /* * Truncate the relation. Partitioned tables have no storage, so there is @@ -3265,23 +3302,40 @@ heap_truncate_one_rel(Relation rel) if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) return; + toastrelid = rel->rd_rel->reltoastrelid; + + /* + * Truncate global temp table only need RowExclusiveLock + */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + lockmode = RowExclusiveLock; + if (OidIsValid(toastrelid) && + gtt_storage_attached(toastrelid)) + truncate_toastrel = true; + } + else if (OidIsValid(toastrelid)) + truncate_toastrel = true; + /* Truncate the underlying relation */ table_relation_nontransactional_truncate(rel); /* If the relation has indexes, truncate the indexes too */ - RelationTruncateIndexes(rel); + RelationTruncateIndexes(rel, lockmode); /* If there is a toast table, truncate that too */ - toastrelid = rel->rd_rel->reltoastrelid; - if (OidIsValid(toastrelid)) + if (truncate_toastrel) { - Relation toastrel = table_open(toastrelid, AccessExclusiveLock); + Relation toastrel = table_open(toastrelid, lockmode); table_relation_nontransactional_truncate(toastrel); - RelationTruncateIndexes(toastrel); + RelationTruncateIndexes(toastrel, lockmode); /* keep the lock... */ table_close(toastrel, NoLock); } + + if (RELATION_IS_GLOBAL_TEMP(rel)) + up_gtt_relstats(rel, 0, 0, 0, RecentXmin, InvalidMultiXactId); } /* diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 3e59e64..9867d6f 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -52,6 +52,7 @@ #include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/event_trigger.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -877,6 +878,26 @@ index_create(Relation heapRelation, indexRelationName, RelationGetRelationName(heapRelation)))); } + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + if (accessMethodObjectId != BTREE_AM_OID) + elog(ERROR, "only support btree index on global temp table"); + + /* We allow to create index on global temp table only this session use it */ + if (is_other_backend_use_gtt(heapRelation->rd_node)) + elog(ERROR, "can not create index when have other backend attached this global temp table"); + + /* No support create index on global temp table use concurrent mode yet */ + if (concurrent) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot create indexes on global temporary tables using concurrent mode"))); + + /* if global temp table not init storage, then skip build index */ + if (!gtt_storage_attached(heapRelation->rd_node.relNode)) + flags |= INDEX_CREATE_SKIP_BUILD; + } + /* * construct tuple descriptor for index tuples */ @@ -2045,6 +2066,13 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) */ CheckTableNotInUse(userIndexRelation, "DROP INDEX"); + /* We allow to drop index on global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(userHeapRelation)) + { + if (is_other_backend_use_gtt(userHeapRelation->rd_node)) + elog(ERROR, "can not drop index when other backend attached this global temp table"); + } + /* * Drop Index Concurrently is more or less the reverse process of Create * Index Concurrently. @@ -2736,20 +2764,29 @@ index_update_stats(Relation rel, else /* don't bother for indexes */ relallvisible = 0; - if (rd_rel->relpages != (int32) relpages) + /* update index stats into localhash for global temp table */ + if (RELATION_IS_GLOBAL_TEMP(rel)) { - rd_rel->relpages = (int32) relpages; - dirty = true; + up_gtt_relstats(rel, relpages, reltuples, relallvisible, + InvalidTransactionId, InvalidMultiXactId); } - if (rd_rel->reltuples != (float4) reltuples) - { - rd_rel->reltuples = (float4) reltuples; - dirty = true; - } - if (rd_rel->relallvisible != (int32) relallvisible) + else { - rd_rel->relallvisible = (int32) relallvisible; - dirty = true; + if (rd_rel->relpages != (int32) relpages) + { + rd_rel->relpages = (int32) relpages; + dirty = true; + } + if (rd_rel->reltuples != (float4) reltuples) + { + rd_rel->reltuples = (float4) reltuples; + dirty = true; + } + if (rd_rel->relallvisible != (int32) relallvisible) + { + rd_rel->relallvisible = (int32) relallvisible; + dirty = true; + } } } @@ -2864,6 +2901,12 @@ index_build(Relation heapRelation, pgstat_progress_update_multi_param(6, index, val); } + if (RELATION_IS_GLOBAL_TEMP(indexRelation)) + { + if (!gtt_storage_attached(indexRelation->rd_node.relNode)) + RelationCreateStorage(indexRelation->rd_node, RELPERSISTENCE_GLOBAL_TEMP, indexRelation); + } + /* * Call the access method's build procedure */ @@ -3196,12 +3239,22 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot) /* * Scan the index and gather up all the TIDs into a tuplesort object. */ + memset(&ivinfo, 0, sizeof(IndexVacuumInfo)); ivinfo.index = indexRelation; ivinfo.analyze_only = false; ivinfo.report_progress = true; ivinfo.estimated_count = true; ivinfo.message_level = DEBUG2; - ivinfo.num_heap_tuples = heapRelation->rd_rel->reltuples; + + /* get relstats abort global temp table from hashtable, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + get_gtt_relstats(RelationGetRelid(heapRelation), + NULL, &ivinfo.num_heap_tuples, NULL, + NULL, NULL); + } + else + ivinfo.num_heap_tuples = heapRelation->rd_rel->reltuples; ivinfo.strategy = NULL; /* @@ -3459,6 +3512,15 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence, errmsg("cannot reindex temporary tables of other sessions"))); /* + * Because global temp table cannot change relfilenode + * no support reindex on global temp table yet. + */ + if (RELATION_IS_GLOBAL_TEMP(iRel)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot reindex global temporary tables"))); + + /* * Also check for active uses of the index in the current transaction; we * don't want to reindex underneath an open indexscan. */ diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index c82f9fc..8248109 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -647,6 +647,13 @@ RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid) errmsg("cannot create temporary relation in non-temporary schema"))); } break; + /* global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + if (isAnyTempNamespace(nspid)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("cannot create global temp relations in temporary schemas"))); + break; case RELPERSISTENCE_PERMANENT: if (isTempOrTempToastNamespace(nspid)) newRelation->relpersistence = RELPERSISTENCE_TEMP; diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index fddfbf1..03806ae 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -26,6 +26,7 @@ #include "access/xlogutils.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "storage/freespace.h" #include "storage/smgr.h" @@ -73,9 +74,10 @@ static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */ * * This function is transactional. The creation is WAL-logged, and if the * transaction aborts later on, the storage will be destroyed. + * */ SMgrRelation -RelationCreateStorage(RelFileNode rnode, char relpersistence) +RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel) { PendingRelDelete *pending; SMgrRelation srel; @@ -85,6 +87,8 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) switch (relpersistence) { case RELPERSISTENCE_TEMP: + /* global temp table use same storage strategy as local temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); needs_wal = false; break; @@ -117,6 +121,10 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) pending->next = pendingDeletes; pendingDeletes = pending; + /* remember global temp table storage info to localhash */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && rel) + remember_gtt_storage_info(rnode, rel); + return srel; } @@ -486,8 +494,15 @@ smgrDoPendingDeletes(bool isCommit) smgrdounlinkall(srels, nrels, false); for (i = 0; i < nrels; i++) + { smgrclose(srels[i]); + /* clean global temp table flags when transaction commit or rollback */ + if (SmgrIsTemp(srels[i]) && + gtt_storage_attached(srels[i]->smgr_rnode.node.relNode)) + forget_gtt_storage_info(srels[i]->smgr_rnode.node.relNode); + } + pfree(srels); } } diff --git a/src/backend/catalog/storage_gtt.c b/src/backend/catalog/storage_gtt.c new file mode 100644 index 0000000..f489cd3 --- /dev/null +++ b/src/backend/catalog/storage_gtt.c @@ -0,0 +1,1129 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.c + * code to create and destroy physical storage for global temparary table + * + * IDENTIFICATION + * src/backend/catalog/storage_gtt.c + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "access/table.h" +#include "access/visibilitymap.h" +#include "access/xact.h" +#include "access/xlog.h" +#include "access/xloginsert.h" +#include "access/xlogutils.h" +#include "access/htup_details.h" +#include "access/multixact.h" +#include "catalog/storage.h" +#include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" +#include "catalog/heap.h" +#include "catalog/namespace.h" +#include "catalog/pg_type.h" +#include "catalog/pg_statistic.h" +#include "commands/tablecmds.h" +#include "funcapi.h" +#include "nodes/primnodes.h" +#include "nodes/pg_list.h" +#include "nodes/execnodes.h" +#include "miscadmin.h" +#include "storage/freespace.h" +#include "storage/smgr.h" +#include "storage/ipc.h" +#include "storage/proc.h" +#include "storage/procarray.h" +#include "storage/lwlock.h" +#include "storage/shmem.h" +#include "storage/sinvaladt.h" +#include "utils/memutils.h" +#include "utils/rel.h" +#include "utils/hsearch.h" +#include "utils/catcache.h" +#include "utils/lsyscache.h" +#include <utils/relcache.h> +#include "utils/inval.h" +#include "utils/guc.h" + + +/* Copy from bitmapset.c, because gtt used the function in bitmapset.c */ +#define WORDNUM(x) ((x) / BITS_PER_BITMAPWORD) +#define BITNUM(x) ((x) % BITS_PER_BITMAPWORD) + +#define BITMAPSET_SIZE(nwords) \ + (offsetof(Bitmapset, words) + (nwords) * sizeof(bitmapword)) + +static bool gtt_cleaner_exit_registered = false; +static HTAB *gtt_storage_local_hash = NULL; +static HTAB *active_gtt_shared_hash = NULL; +static MemoryContext gtt_relstats_context = NULL; + +/* relfrozenxid of all gtts in the current session */ +static List *gtt_session_relfrozenxid_list = NIL; +static TransactionId gtt_session_frozenxid = InvalidTransactionId; + +typedef struct gtt_ctl_data +{ + LWLock lock; + int max_entry; + int entry_size; +}gtt_ctl_data; + +static gtt_ctl_data *gtt_shared_ctl = NULL; + +typedef struct +{ + RelFileNode rnode; + Bitmapset *map; + /* bitmap data */ +} gtt_shared_hash_entry; + +typedef struct +{ + Oid relid; + + Oid spcnode; + /* pg_class stat */ + int32 relpages; + float4 reltuples; + int32 relallvisible; + TransactionId relfrozenxid; + TransactionId relminmxid; + char relkind; + bool on_commit_delete; + + /* pg_statistic */ + int natts; + int *attnum; + HeapTuple *att_stat_tups; +} gtt_local_hash_entry; + +static Size action_gtt_shared_hash_entry_size(void); +static void gtt_storage_checkin(RelFileNode rnode); +static void gtt_storage_checkout(RelFileNode rnode, bool skiplock); +static void gtt_storage_removeall(int code, Datum arg); +static void insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid); +static void remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid); +static void set_gtt_session_relfrozenxid(void); + +Datum pg_get_gtt_statistics(PG_FUNCTION_ARGS); +Datum pg_get_gtt_relstats(PG_FUNCTION_ARGS); +Datum pg_gtt_attached_pid(PG_FUNCTION_ARGS); +Datum pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS); + + +static Size +action_gtt_shared_hash_entry_size(void) +{ + int wordnum; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + wordnum = WORDNUM(MaxBackends + 1); + hash_entry_size += MAXALIGN(sizeof(gtt_shared_hash_entry)); + hash_entry_size += MAXALIGN(BITMAPSET_SIZE(wordnum + 1)); + + return hash_entry_size; +} + +Size +active_gtt_shared_hash_size(void) +{ + Size size = 0; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + size = MAXALIGN(sizeof(gtt_ctl_data)); + hash_entry_size = action_gtt_shared_hash_entry_size(); + size += hash_estimate_size(max_active_gtt, hash_entry_size); + + return size; +} + +void +active_gtt_shared_hash_init(void) +{ + HASHCTL info; + bool found; + + if (max_active_gtt <= 0) + return; + + gtt_shared_ctl = + ShmemInitStruct("gtt_shared_ctl", + sizeof(gtt_ctl_data), + &found); + + if (!found) + { + LWLockRegisterTranche(LWTRANCHE_GTT_CTL, "gtt_shared_ctl"); + LWLockInitialize(>t_shared_ctl->lock, LWTRANCHE_GTT_CTL); + gtt_shared_ctl->max_entry = max_active_gtt; + gtt_shared_ctl->entry_size = action_gtt_shared_hash_entry_size(); + } + + info.keysize = sizeof(RelFileNode); + info.entrysize = gtt_shared_ctl->entry_size; + active_gtt_shared_hash = + ShmemInitHash("active gtt shared hash", + gtt_shared_ctl->max_entry, + gtt_shared_ctl->max_entry, + &info, HASH_ELEM | HASH_BLOBS | HASH_FIXED_SIZE); +} + +static void +gtt_storage_checkin(RelFileNode rnode) +{ + gtt_shared_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + entry = (gtt_shared_hash_entry *) hash_search(active_gtt_shared_hash, + &rnode, HASH_ENTER_NULL, &found); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of shared memory"), + errhint("You might need to increase max_active_gtt."))); + } + + if (found == false) + { + int wordnum; + + entry->map = (Bitmapset *)((char *)entry + MAXALIGN(sizeof(gtt_shared_hash_entry))); + wordnum = WORDNUM(MaxBackends + 1); + memset(entry->map, 0, BITMAPSET_SIZE(wordnum + 1)); + entry->map->nwords = wordnum + 1; + } + + bms_add_member(entry->map, MyBackendId); + LWLockRelease(>t_shared_ctl->lock); +} + +static void +gtt_storage_checkout(RelFileNode rnode, bool skiplock) +{ + gtt_shared_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (!skiplock) + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + + entry = hash_search(active_gtt_shared_hash, + (void *) &(rnode), HASH_FIND, NULL); + + if (entry == NULL) + { + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + elog(WARNING, "relfilenode %u/%u/%u not exist in gtt shared hash when forget", + rnode.dbNode, rnode.spcNode, rnode.relNode); + return; + } + + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + bms_del_member(entry->map, MyBackendId); + + if (bms_is_empty(entry->map)) + { + if (!hash_search(active_gtt_shared_hash, &rnode, HASH_REMOVE, NULL)) + elog(PANIC, "gtt shared hash table corrupted"); + } + + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + return; +} + +Bitmapset * +copy_active_gtt_bitmap(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + Bitmapset *map_copy = NULL; + + if (max_active_gtt <= 0) + return NULL; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return NULL; + } + + Assert(entry->map); + if (!bms_is_empty(entry->map)) + map_copy = bms_copy(entry->map); + + LWLockRelease(>t_shared_ctl->lock); + + return map_copy; +} + +bool +is_other_backend_use_gtt(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + bool in_use = false; + int num_use = 0; + + if (max_active_gtt <= 0) + return false; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return false; + } + + Assert(entry->map); + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + + num_use = bms_num_members(entry->map); + if (num_use == 0) + in_use = false; + else if (num_use == 1) + { + if(bms_is_member(MyBackendId, entry->map)) + in_use = false; + else + in_use = true; + } + else + in_use = true; + + LWLockRelease(>t_shared_ctl->lock); + + return in_use; +} + +void +remember_gtt_storage_info(RelFileNode rnode, Relation rel) +{ + gtt_local_hash_entry *entry; + MemoryContext oldcontext; + Oid relid = rnode.relNode; + bool found; + + if (max_active_gtt <= 0) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Global temporary table feature is disable"), + errhint("You might need to increase max_active_gtt to enable this feature."))); + + if (RecoveryInProgress()) + elog(ERROR, "readonly mode not support access global temp table yet"); + + if (gtt_storage_local_hash == NULL) + { +#define GTT_LOCAL_HASH_SIZE 1024 + /* First time through: initialize the hash table */ + HASHCTL ctl; + + MemSet(&ctl, 0, sizeof(ctl)); + ctl.keysize = sizeof(Oid); + ctl.entrysize = sizeof(gtt_local_hash_entry); + gtt_storage_local_hash = + hash_create("global temp relation table", + GTT_LOCAL_HASH_SIZE, + &ctl, HASH_ELEM | HASH_BLOBS); + + if (!CacheMemoryContext) + CreateCacheMemoryContext(); + + gtt_relstats_context = + AllocSetContextCreate(CacheMemoryContext, + "gtt relstats context", + ALLOCSET_DEFAULT_SIZES); + } + + /* Look up or create an entry */ + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_ENTER, &found); + + if (found) + { + elog(ERROR, "backend %d relid %u already exists in global temp table local hash", + MyBackendId, relid); + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + + entry->spcnode = rnode.spcNode; + entry->relpages = 0; + entry->reltuples = 0; + entry->relallvisible = 0; + entry->relkind = rel->rd_rel->relkind; + /* only heap contain transaction information */ + if (entry->relkind == RELKIND_RELATION || entry->relkind == RELKIND_PARTITIONED_TABLE) + { + int natts = RelationGetNumberOfAttributes(rel); + entry->natts = natts; + entry->attnum = palloc0(sizeof(int) * natts); + entry->att_stat_tups = palloc0(sizeof(HeapTuple) * natts); + + if (RELATION_GTT_ON_COMMIT_DELETE(rel)) + { + entry->on_commit_delete = true; + register_on_commit_action(rel->rd_node.relNode, ONCOMMIT_DELETE_ROWS); + } + + entry->relfrozenxid = RecentXmin; + entry->relminmxid = GetOldestMultiXactId(); + insert_gtt_relfrozenxid_to_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + gtt_storage_checkin(rnode); + } + else + { + entry->natts = 0; + entry->attnum = 0; + entry->att_stat_tups = NULL; + entry->on_commit_delete = false; + entry->relfrozenxid = 0; + entry->relminmxid = 0; + } + + MemoryContextSwitchTo(oldcontext); + + if (!gtt_cleaner_exit_registered) + { + before_shmem_exit(gtt_storage_removeall, 0); + gtt_cleaner_exit_registered = true; + } + + return; +} + +void +forget_gtt_storage_info(Oid relid) +{ + gtt_local_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, NULL); + + if (entry && entry->relkind == RELKIND_RELATION) + { + RelFileNode rnode; + int i; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + gtt_storage_checkout(rnode, false); + + Assert(TransactionIdIsNormal(entry->relfrozenxid)); + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + + for (i = 0; i < entry->natts; i++) + { + if (entry->att_stat_tups[i]) + { + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + } + } + } + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_REMOVE, NULL); + + return; +} + +/* is the storage file was created in this backend */ +bool +gtt_storage_attached(Oid relid) +{ + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, &found); + + return found; +} + +static void +gtt_storage_removeall(int code, Datum arg) +{ + HASH_SEQ_STATUS status; + gtt_local_hash_entry *entry; + int nrels = 0, + maxrels = 0; + SMgrRelation *srels = NULL; + RelFileNode *rnodes = NULL; + char *relkinds = NULL; + + if (gtt_storage_local_hash == NULL) + return; + + hash_seq_init(&status, gtt_storage_local_hash); + while ((entry = (gtt_local_hash_entry *) hash_seq_search(&status)) != NULL) + { + SMgrRelation srel; + RelFileNode rnode; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + srel = smgropen(rnode, MyBackendId); + + /* allocate the initial array, or extend it, if needed */ + if (maxrels == 0) + { + maxrels = 32; + srels = palloc(sizeof(SMgrRelation) * maxrels); + rnodes = palloc(sizeof(RelFileNode) * maxrels); + relkinds = palloc(sizeof(char) * maxrels); + } + else if (maxrels <= nrels) + { + maxrels *= 2; + srels = repalloc(srels, sizeof(SMgrRelation) * maxrels); + rnodes = repalloc(rnodes, sizeof(RelFileNode) * maxrels); + relkinds = repalloc(relkinds, sizeof(char) * maxrels); + } + + srels[nrels] = srel; + rnodes[nrels] = rnode; + relkinds[nrels] = entry->relkind; + nrels++; + } + + if (nrels > 0) + { + int i; + + smgrdounlinkall(srels, nrels, false); + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + for (i = 0; i < nrels; i++) + { + smgrclose(srels[i]); + if (relkinds[i] == RELKIND_RELATION) + gtt_storage_checkout(rnodes[i], true); + } + LWLockRelease(>t_shared_ctl->lock); + + pfree(srels); + pfree(rnodes); + pfree(relkinds); + } + + MyProc->session_gtt_frozenxid = InvalidTransactionId; + + return; +} + +/* + * Update global temp table relstats(relpage/reltuple/relallvisible) + * to local hashtable + */ +void +up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid) +{ + Oid relid = RelationGetRelid(relation); + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return; + + Assert(entry->spcnode); + + if (num_pages >= 0 && + entry->relpages != (int32)num_pages) + entry->relpages = (int32)num_pages; + + if (num_tuples >= 0 && + num_tuples != (float4)entry->reltuples) + entry->reltuples = (float4)num_tuples; + + /* only heap contain transaction information and relallvisible */ + if (entry->relkind == RELKIND_RELATION) + { + if (entry->relallvisible >= 0 && + entry->relallvisible != (int32)num_all_visible_pages) + { + entry->relallvisible = (int32)num_all_visible_pages; + } + + if (TransactionIdIsNormal(relfrozenxid) && + entry->relfrozenxid != relfrozenxid && + (TransactionIdPrecedes(entry->relfrozenxid, relfrozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), entry->relfrozenxid))) + { + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + entry->relfrozenxid = relfrozenxid; + insert_gtt_relfrozenxid_to_ordered_list(relfrozenxid); + set_gtt_session_relfrozenxid(); + } + + if (MultiXactIdIsValid(relminmxid) && + entry->relminmxid != relminmxid && + (MultiXactIdPrecedes(entry->relminmxid, relminmxid) || + MultiXactIdPrecedes(ReadNextMultiXactId(), entry->relminmxid))) + { + entry->relminmxid = relminmxid; + } + } + + return; +} + +/* + * Search global temp table relstats(relpage/reltuple/relallvisible) + * from local hashtable. + */ +bool +get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid) +{ + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return false; + + Assert(entry->relid == relid); + + if (relpages) + *relpages = entry->relpages; + + if (reltuples) + *reltuples = entry->reltuples; + + if (relallvisible) + *relallvisible = entry->relallvisible; + + if (relfrozenxid) + *relfrozenxid = entry->relfrozenxid; + + if (relminmxid) + *relminmxid = entry->relminmxid; + + return true; +} + +/* + * Update global temp table statistic info(definition is same as pg_statistic) + * to local hashtable where ananyze global temp table + */ +void +up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull) +{ + gtt_local_hash_entry *entry; + bool found; + MemoryContext oldcontext; + int i = 0; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return; + + if (entry->relkind != RELKIND_RELATION) + { + elog(WARNING, "oid %u not a relation", reloid); + return; + } + + /* todo */ + if (entry->natts < natts) + { + elog(WARNING, "reloid %u not support update attstat after add colunm", reloid); + return; + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + Assert(entry->relid == reloid); + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == 0) + { + entry->attnum[i] = attnum; + break; + } + else if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + break; + } + } + + Assert(i < entry->natts); + Assert(entry->att_stat_tups[i] == NULL); + entry->att_stat_tups[i] = heap_form_tuple(tupleDescriptor, values, isnull); + MemoryContextSwitchTo(oldcontext); + + return; +} + +/* + * Search global temp table statistic info(definition is same as pg_statistic) + * from local hashtable. + */ +HeapTuple +get_gtt_att_statistic(Oid reloid, int attnum, bool inh) +{ + gtt_local_hash_entry *entry; + bool found; + int i = 0; + + if (max_active_gtt <= 0) + return NULL; + + if (gtt_storage_local_hash == NULL) + return NULL; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return NULL; + + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + return entry->att_stat_tups[i]; + } + } + + return NULL; +} + +void +release_gtt_statistic_cache(HeapTuple tup) +{ + /* do nothing */ + return; +} + +static void +insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid) +{ + MemoryContext oldcontext; + ListCell *cell; + int i; + + Assert(TransactionIdIsNormal(relfrozenxid)); + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + /* Does the datum belong at the front? */ + if (gtt_session_relfrozenxid_list == NIL || + TransactionIdFollowsOrEquals(relfrozenxid, + linitial_oid(gtt_session_relfrozenxid_list))) + { + gtt_session_relfrozenxid_list = + lcons_oid(relfrozenxid, gtt_session_relfrozenxid_list); + MemoryContextSwitchTo(oldcontext); + + return; + } + + /* No, so find the entry it belongs after */ + i = 0; + foreach (cell, gtt_session_relfrozenxid_list) + { + if (TransactionIdFollowsOrEquals(relfrozenxid, lfirst_oid(cell))) + break; + + i++; + } + gtt_session_relfrozenxid_list = + list_insert_nth_oid(gtt_session_relfrozenxid_list, i, relfrozenxid); + MemoryContextSwitchTo(oldcontext); + + return; +} + +static void +remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid) +{ + gtt_session_relfrozenxid_list = + list_delete_oid(gtt_session_relfrozenxid_list, relfrozenxid); +} + +static void +set_gtt_session_relfrozenxid(void) +{ + TransactionId gtt_frozenxid = InvalidTransactionId; + + if (gtt_session_relfrozenxid_list) + gtt_frozenxid = llast_oid(gtt_session_relfrozenxid_list); + + gtt_session_frozenxid = gtt_frozenxid; + if (MyProc->session_gtt_frozenxid != gtt_frozenxid) + MyProc->session_gtt_frozenxid = gtt_frozenxid; +} + +Datum +pg_get_gtt_statistics(PG_FUNCTION_ARGS) +{ + HeapTuple tuple; + Relation rel = NULL; + int attnum = PG_GETARG_INT32(1); + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + MemoryContext oldcontext; + Tuplestorestate *tupstore; + Relation pg_tatistic = NULL; + TupleDesc sd; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not " \ + "allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + pg_tatistic = table_open(StatisticRelationId, AccessShareLock); + sd = RelationGetDescr(pg_tatistic); + + tuple = get_gtt_att_statistic(reloid, attnum, false); + if (tuple) + { + Datum values[31]; + bool isnull[31]; + HeapTuple res = NULL; + + memset(&values, 0, sizeof(values)); + memset(&isnull, 0, sizeof(isnull)); + heap_deform_tuple(tuple, sd, values, isnull); + res = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, res); + } + + table_close(rel, NoLock); + table_close(pg_tatistic, AccessShareLock); + tuplestore_donestoring(tupstore); + + return (Datum) 0; +} + +Datum +pg_get_gtt_relstats(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + uint32 relfrozenxid = 0; + uint32 relminmxid = 0; + Relation rel = NULL; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + if (get_gtt_relstats(reloid, + &relpages, &reltuples, &relallvisible, + &relfrozenxid, &relminmxid)) + { + Datum values[5]; + bool isnull[5]; + + memset(isnull, 0, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(relpages); + values[1] = Float4GetDatum((float4)reltuples); + values[2] = Int32GetDatum(relallvisible); + values[3] = UInt32GetDatum(relfrozenxid); + values[4] = UInt32GetDatum(relminmxid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_gtt_attached_pid(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + Relation rel = NULL; + PGPROC *proc = NULL; + Bitmapset *map = NULL; + pid_t pid = 0; + int backendid = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + map = copy_active_gtt_bitmap(rel->rd_node); + if (map) + { + backendid = bms_first_member(map); + + do + { + proc = BackendIdGetProc(backendid); + pid = proc->pid; + if (pid > 0) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = UInt32GetDatum(reloid); + values[1] = Int32GetDatum(pid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + backendid = bms_next_member(map, backendid); + } while (backendid > 0); + + pfree(map); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + int num_xid = MaxBackends + 1; + int *pids = NULL; + uint32 *xids = NULL; + int i = 0; + int j = 0; + uint32 oldest = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + if (max_active_gtt <= 0) + return (Datum) 0; + + if (RecoveryInProgress()) + return (Datum) 0; + + pids = palloc0(sizeof(int) * num_xid); + xids = palloc0(sizeof(int) * num_xid); + oldest = list_all_session_gtt_frozenxids(num_xid, pids, xids, &i); + if (i > 0) + { + if (i > 0) + { + pids[i] = 0; + xids[i] = oldest; + i++; + } + + for(j = 0; j < i; j++) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(pids[j]); + values[1] = UInt32GetDatum(xids[j]); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + } + tuplestore_donestoring(tupstore); + pfree(pids); + pfree(xids); + + return (Datum) 0; +} + diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index 2fc3e3f..d0efd18 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -186,6 +186,91 @@ CREATE OR REPLACE VIEW pg_sequences AS WHERE NOT pg_is_other_temp_schema(N.oid) AND relkind = 'S'; +-- For global temporary table +CREATE VIEW pg_gtt_relstats WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_relstats(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_attached_pids WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_gtt_attached_pid(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_stats WITH (security_barrier) AS +SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN s.stakind1 = 1 THEN s.stavalues1 + WHEN s.stakind2 = 1 THEN s.stavalues2 + WHEN s.stakind3 = 1 THEN s.stavalues3 + WHEN s.stakind4 = 1 THEN s.stavalues4 + WHEN s.stakind5 = 1 THEN s.stavalues5 + END AS most_common_vals, + CASE + WHEN s.stakind1 = 1 THEN s.stanumbers1 + WHEN s.stakind2 = 1 THEN s.stanumbers2 + WHEN s.stakind3 = 1 THEN s.stanumbers3 + WHEN s.stakind4 = 1 THEN s.stanumbers4 + WHEN s.stakind5 = 1 THEN s.stanumbers5 + END AS most_common_freqs, + CASE + WHEN s.stakind1 = 2 THEN s.stavalues1 + WHEN s.stakind2 = 2 THEN s.stavalues2 + WHEN s.stakind3 = 2 THEN s.stavalues3 + WHEN s.stakind4 = 2 THEN s.stavalues4 + WHEN s.stakind5 = 2 THEN s.stavalues5 + END AS histogram_bounds, + CASE + WHEN s.stakind1 = 3 THEN s.stanumbers1[1] + WHEN s.stakind2 = 3 THEN s.stanumbers2[1] + WHEN s.stakind3 = 3 THEN s.stanumbers3[1] + WHEN s.stakind4 = 3 THEN s.stanumbers4[1] + WHEN s.stakind5 = 3 THEN s.stanumbers5[1] + END AS correlation, + CASE + WHEN s.stakind1 = 4 THEN s.stavalues1 + WHEN s.stakind2 = 4 THEN s.stavalues2 + WHEN s.stakind3 = 4 THEN s.stavalues3 + WHEN s.stakind4 = 4 THEN s.stavalues4 + WHEN s.stakind5 = 4 THEN s.stavalues5 + END AS most_common_elems, + CASE + WHEN s.stakind1 = 4 THEN s.stanumbers1 + WHEN s.stakind2 = 4 THEN s.stanumbers2 + WHEN s.stakind3 = 4 THEN s.stanumbers3 + WHEN s.stakind4 = 4 THEN s.stanumbers4 + WHEN s.stakind5 = 4 THEN s.stanumbers5 + END AS most_common_elem_freqs, + CASE + WHEN s.stakind1 = 5 THEN s.stanumbers1 + WHEN s.stakind2 = 5 THEN s.stanumbers2 + WHEN s.stakind3 = 5 THEN s.stanumbers3 + WHEN s.stakind4 = 5 THEN s.stanumbers4 + WHEN s.stakind5 = 5 THEN s.stanumbers5 + END AS elem_count_histogram + FROM + pg_class c + JOIN pg_attribute a ON c.oid = a.attrelid + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_statistics(c.oid, a.attnum, ''::text) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') and NOT a.attisdropped AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + CREATE VIEW pg_stats WITH (security_barrier) AS SELECT nspname AS schemaname, diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 53b11d7..104d6ce 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -65,6 +65,7 @@ #include "utils/syscache.h" #include "utils/timestamp.h" +#include "catalog/storage_gtt.h" /* Per-index data for ANALYZE */ typedef struct AnlIndexData @@ -102,7 +103,7 @@ static int acquire_inherited_sample_rows(Relation onerel, int elevel, HeapTuple *rows, int targrows, double *totalrows, double *totaldeadrows); static void update_attstats(Oid relid, bool inh, - int natts, VacAttrStats **vacattrstats); + int natts, VacAttrStats **vacattrstats, char relpersistence); static Datum std_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); @@ -575,14 +576,15 @@ do_analyze_rel(Relation onerel, VacuumParams *params, * pg_statistic for columns we didn't process, we leave them alone.) */ update_attstats(RelationGetRelid(onerel), inh, - attr_cnt, vacattrstats); + attr_cnt, vacattrstats, RelationGetRelPersistence(onerel)); for (ind = 0; ind < nindexes; ind++) { AnlIndexData *thisdata = &indexdata[ind]; update_attstats(RelationGetRelid(Irel[ind]), false, - thisdata->attr_cnt, thisdata->vacattrstats); + thisdata->attr_cnt, thisdata->vacattrstats, + RelationGetRelPersistence(Irel[ind])); } /* @@ -659,11 +661,20 @@ do_analyze_rel(Relation onerel, VacuumParams *params, IndexBulkDeleteResult *stats; IndexVacuumInfo ivinfo; + memset(&ivinfo, 0, sizeof(IndexVacuumInfo)); ivinfo.index = Irel[ind]; ivinfo.analyze_only = true; ivinfo.estimated_count = true; ivinfo.message_level = elevel; - ivinfo.num_heap_tuples = onerel->rd_rel->reltuples; + /* get global temp relstats from localhash, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(onerel)) + { + get_gtt_relstats(RelationGetRelid(onerel), + NULL, &ivinfo.num_heap_tuples, NULL, + NULL, NULL); + } + else + ivinfo.num_heap_tuples = onerel->rd_rel->reltuples; ivinfo.strategy = vac_strategy; stats = index_vacuum_cleanup(&ivinfo, NULL); @@ -1425,7 +1436,7 @@ acquire_inherited_sample_rows(Relation onerel, int elevel, * by taking a self-exclusive lock on the relation in analyze_rel(). */ static void -update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) +update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats, char relpersistence) { Relation sd; int attno; @@ -1527,31 +1538,45 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) } } - /* Is there already a pg_statistic tuple for this attribute? */ - oldtup = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(relid), - Int16GetDatum(stats->attr->attnum), - BoolGetDatum(inh)); - - if (HeapTupleIsValid(oldtup)) + /* Update column statistic to localhash, not catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { - /* Yes, replace it */ - stup = heap_modify_tuple(oldtup, - RelationGetDescr(sd), - values, - nulls, - replaces); - ReleaseSysCache(oldtup); - CatalogTupleUpdate(sd, &stup->t_self, stup); + up_gtt_att_statistic(relid, + stats->attr->attnum, + inh, + natts, + RelationGetDescr(sd), + values, + nulls); } else { - /* No, insert new tuple */ - stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); - CatalogTupleInsert(sd, stup); - } + /* Is there already a pg_statistic tuple for this attribute? */ + oldtup = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(relid), + Int16GetDatum(stats->attr->attnum), + BoolGetDatum(inh)); + + if (HeapTupleIsValid(oldtup)) + { + /* Yes, replace it */ + stup = heap_modify_tuple(oldtup, + RelationGetDescr(sd), + values, + nulls, + replaces); + ReleaseSysCache(oldtup); + CatalogTupleUpdate(sd, &stup->t_self, stup); + } + else + { + /* No, insert new tuple */ + stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); + CatalogTupleInsert(sd, stup); + } - heap_freetuple(stup); + heap_freetuple(stup); + } } table_close(sd, RowExclusiveLock); diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index e9d7a7f..3088e26 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -391,6 +391,12 @@ cluster_rel(Oid tableOid, Oid indexOid, int options) errmsg("cannot vacuum temporary tables of other sessions"))); } + /* not support cluster global temp table yet */ + if (RELATION_IS_GLOBAL_TEMP(OldHeap)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("not support cluster global temporary tables yet"))); + /* * Also check for active uses of the relation in the current transaction, * including open scans and pending AFTER trigger events. diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 52ce02f..3d3f7dc 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2583,6 +2583,16 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind, !isTempNamespace(classtuple->relnamespace)) continue; + /* not support reindex on global temp table, so skip it */ + if (classtuple->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + ereport(WARNING, + (errmsg("global temp table \"%s.%s\" skip reindexed", + get_namespace_name(get_rel_namespace(relid)), + get_rel_name(relid)))); + continue; + } + /* Check user/system classification, and optionally skip */ if (objectKind == REINDEX_OBJECT_SYSTEM && !IsSystemClass(relid, classtuple)) diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c index 75410f0..eb1acea 100644 --- a/src/backend/commands/lockcmds.c +++ b/src/backend/commands/lockcmds.c @@ -107,7 +107,8 @@ RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, * transaction. */ relpersistence = get_rel_persistence(relid); - if (relpersistence == RELPERSISTENCE_TEMP) + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPNAMESPACE; /* Check permissions. */ diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 6aab73b..44f350d 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -94,7 +94,7 @@ static HTAB *seqhashtab = NULL; /* hash table for SeqTable items */ */ static SeqTableData *last_used_seq = NULL; -static void fill_seq_with_data(Relation rel, HeapTuple tuple); +static void fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf); static Relation lock_and_open_sequence(SeqTable seq); static void create_seq_hashtable(void); static void init_sequence(Oid relid, SeqTable *p_elm, Relation *p_rel); @@ -108,6 +108,7 @@ static void init_params(ParseState *pstate, List *options, bool for_identity, List **owned_by); static void do_setval(Oid relid, int64 next, bool iscalled); static void process_owned_by(Relation seqrel, List *owned_by, bool for_identity); +int64 get_seqence_start_value(Oid seqid); /* @@ -222,7 +223,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq) /* now initialize the sequence's data */ tuple = heap_form_tuple(tupDesc, value, null); - fill_seq_with_data(rel, tuple); + fill_seq_with_data(rel, tuple, InvalidBuffer); /* process OWNED BY if given */ if (owned_by) @@ -327,7 +328,7 @@ ResetSequence(Oid seq_relid) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seq_rel, tuple); + fill_seq_with_data(seq_rel, tuple, InvalidBuffer); /* Clear local cache so that we don't think we have cached numbers */ /* Note that we do not change the currval() state */ @@ -340,17 +341,21 @@ ResetSequence(Oid seq_relid) * Initialize a sequence's relation with the specified tuple as content */ static void -fill_seq_with_data(Relation rel, HeapTuple tuple) +fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf) { - Buffer buf; Page page; sequence_magic *sm; OffsetNumber offnum; + bool lockBuffer = false; /* Initialize first page of relation with special magic number */ - buf = ReadBuffer(rel, P_NEW); - Assert(BufferGetBlockNumber(buf) == 0); + if (buf == InvalidBuffer) + { + buf = ReadBuffer(rel, P_NEW); + Assert(BufferGetBlockNumber(buf) == 0); + lockBuffer = true; + } page = BufferGetPage(buf); @@ -360,7 +365,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) /* Now insert sequence tuple */ - LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); + if (lockBuffer) + LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); /* * Since VACUUM does not process sequences, we have to force the tuple to @@ -410,7 +416,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) END_CRIT_SECTION(); - UnlockReleaseBuffer(buf); + if (lockBuffer) + UnlockReleaseBuffer(buf); } /* @@ -502,7 +509,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seqrel, newdatatuple); + fill_seq_with_data(seqrel, newdatatuple, InvalidBuffer); } /* process OWNED BY if given */ @@ -1178,6 +1185,25 @@ read_seq_tuple(Relation rel, Buffer *buf, HeapTuple seqdatatuple) LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); page = BufferGetPage(*buf); + if (GlobalTempRelationPageIsNotInitialized(rel, page)) + { + /* Initialize sequence for global temporary tables */ + Datum value[SEQ_COL_LASTCOL] = {0}; + bool null[SEQ_COL_LASTCOL] = {false}; + HeapTuple tuple; + int64 startv = get_seqence_start_value(RelationGetRelid(rel)); + + /* + * last_value from pg_sequence.seqstart + * log_cnt = 0 + * is_called = false + */ + value[SEQ_COL_LASTVAL-1] = Int64GetDatumFast(startv); /* start sequence with 1 */ + + tuple = heap_form_tuple(RelationGetDescr(rel), value, null); + fill_seq_with_data(rel, tuple, *buf); + heap_freetuple(tuple); + } sm = (sequence_magic *) PageGetSpecialPointer(page); if (sm->magic != SEQ_MAGIC) @@ -1954,3 +1980,23 @@ seq_mask(char *page, BlockNumber blkno) mask_unused_space(page); } + +int64 +get_seqence_start_value(Oid seqid) +{ + HeapTuple seqtuple; + Form_pg_sequence seqform; + int64 start; + + seqtuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(seqid)); + if (!HeapTupleIsValid(seqtuple)) + elog(ERROR, "cache lookup failed for sequence %u", + seqid); + + seqform = (Form_pg_sequence) GETSTRUCT(seqtuple); + start = seqform->seqstart; + ReleaseSysCache(seqtuple); + + return start; +} + diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 1c4394a..84bc81e 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -47,6 +47,7 @@ #include "catalog/storage.h" #include "catalog/storage_xlog.h" #include "catalog/toasting.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/comment.h" #include "commands/defrem.h" @@ -527,6 +528,7 @@ static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTbl); static List *GetParentedForeignKeyRefs(Relation partition); static void ATDetachCheckNoForeignKeyRefs(Relation partition); +static bool has_oncommit_option(List *options); /* ---------------------------------------------------------------- @@ -572,6 +574,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, LOCKMODE parentLockmode; const char *accessMethod = NULL; Oid accessMethodId = InvalidOid; + bool has_oncommit_clause = false; /* * Truncate relname to appropriate length (probably a waste of time, as @@ -582,8 +585,10 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Check consistency of arguments */ + /* global temp table same as local temp table */ if (stmt->oncommit != ONCOMMIT_NOOP - && stmt->relation->relpersistence != RELPERSISTENCE_TEMP) + && !(stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("ON COMMIT can only be used on temporary tables"))); @@ -613,7 +618,9 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, * code. This is needed because calling code might not expect untrusted * tables to appear in pg_temp at the front of its search path. */ - if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP + /* global temp table same as local temp table */ + if ((stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) && InSecurityRestrictedOperation()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -714,6 +721,57 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Parse and validate reloptions, if any. */ + /* global temp table */ + has_oncommit_clause = has_oncommit_option(stmt->options); + if (stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (relkind == RELKIND_RELATION || relkind == RELKIND_PARTITIONED_TABLE)) + { + /* inherit table or parition table inherit on commit property from parent table*/ + if (inheritOids && stmt->oncommit == ONCOMMIT_NOOP && !has_oncommit_clause) + { + Oid parent = linitial_oid(inheritOids); + Relation relation = table_open(parent, NoLock); + + if (!RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "The parent table must be global temporary table"); + + if (RELATION_GTT_ON_COMMIT_DELETE(relation)) + stmt->oncommit = ONCOMMIT_DELETE_ROWS; + else + stmt->oncommit = ONCOMMIT_PRESERVE_ROWS; + table_close(relation, NoLock); + } + + if (has_oncommit_clause) + { + if (stmt->oncommit != ONCOMMIT_NOOP) + elog(ERROR, "can not defeine global temp table with on commit and with clause at same time"); + } + else + { + DefElem *opt = makeNode(DefElem); + + opt->type = T_DefElem; + opt->defnamespace = NULL; + opt->defname = "on_commit_delete_rows"; + opt->defaction = DEFELEM_UNSPEC; + + /* use reloptions to remember on commit clause */ + if (stmt->oncommit == ONCOMMIT_DELETE_ROWS) + opt->arg = (Node *)makeString("true"); + else if (stmt->oncommit == ONCOMMIT_PRESERVE_ROWS) + opt->arg = (Node *)makeString("false"); + else if (stmt->oncommit == ONCOMMIT_NOOP) + opt->arg = (Node *)makeString("true"); + else + elog(ERROR, "global temp table not support on commit drop clause"); + + stmt->options = lappend(stmt->options, opt); + } + } + else if (has_oncommit_clause) + elog(ERROR, "regular table cannot specifie on_commit_delete_rows"); + reloptions = transformRelOptions((Datum) 0, stmt->options, NULL, validnsps, true, false); @@ -1775,7 +1833,8 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged, * table or the current physical file to be thrown away anyway. */ if (rel->rd_createSubid == mySubid || - rel->rd_newRelfilenodeSubid == mySubid) + rel->rd_newRelfilenodeSubid == mySubid || + RELATION_IS_GLOBAL_TEMP(rel)) { /* Immediate, non-rollbackable truncation is OK */ heap_truncate_one_rel(rel); @@ -3334,6 +3393,13 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo * specially. */ targetrelation = relation_open(myrelid, is_index ? ShareUpdateExclusiveLock : AccessExclusiveLock); + + if (RELATION_IS_GLOBAL_TEMP(targetrelation)) + { + if (is_other_backend_use_gtt(targetrelation->rd_node)) + elog(ERROR, "can not rename relation when other backend attached this global temp table"); + } + namespaceId = RelationGetNamespace(targetrelation); /* @@ -3503,6 +3569,13 @@ AlterTable(Oid relid, LOCKMODE lockmode, AlterTableStmt *stmt) /* Caller is required to provide an adequate lock. */ rel = relation_open(relid, NoLock); + /* We allow to alter global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not alter relation when other backend attached this global temp table"); + } + CheckTableNotInUse(rel, "ALTER TABLE"); ATController(stmt, rel, stmt->cmds, stmt->relation->inh, lockmode); @@ -7656,6 +7729,13 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, errmsg("referenced relation \"%s\" is not a table", RelationGetRelationName(pkrel)))); + /* global temp table not support foreign key constraint yet */ + if (RELATION_IS_GLOBAL_TEMP(pkrel)) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("referenced relation \"%s\" is not a global temp table", + RelationGetRelationName(pkrel)))); + if (!allowSystemTableMods && IsSystemRelation(pkrel)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -7695,6 +7775,12 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("constraints on temporary tables must involve temporary tables of this session"))); break; + /* global temp table not support foreign key constraint yet */ + case RELPERSISTENCE_GLOBAL_TEMP: + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("not support foreign key constraints on global temp table yet"))); + break; } /* @@ -12706,7 +12792,7 @@ index_copy_data(Relation rel, RelFileNode newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, @@ -14113,7 +14199,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged) */ switch (rel->rd_rel->relpersistence) { + /* global temp table same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("cannot change logged status of table \"%s\" because it is temporary", @@ -16753,3 +16841,20 @@ ATDetachCheckNoForeignKeyRefs(Relation partition) table_close(rel, NoLock); } } + +static bool +has_oncommit_option(List *options) +{ + ListCell *listptr; + + foreach(listptr, options) + { + DefElem *def = (DefElem *) lfirst(listptr); + + if (pg_strcasecmp(def->defname, "on_commit_delete_rows") == 0) + return true; + } + + return false; +} + diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index bb34e25..6e1896f 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -35,6 +35,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/defrem.h" #include "commands/vacuum.h" @@ -1070,12 +1071,25 @@ vac_estimate_reltuples(Relation relation, BlockNumber scanned_pages, double scanned_tuples) { - BlockNumber old_rel_pages = relation->rd_rel->relpages; - double old_rel_tuples = relation->rd_rel->reltuples; + BlockNumber old_rel_pages = 0; + double old_rel_tuples = 0; double old_density; double unscanned_pages; double total_tuples; + /* get relstat from gtt local hash */ + if (RELATION_IS_GLOBAL_TEMP(relation)) + { + get_gtt_relstats(RelationGetRelid(relation), + &old_rel_pages, &old_rel_tuples, NULL, + NULL, NULL); + } + else + { + old_rel_pages = relation->rd_rel->relpages; + old_rel_tuples = relation->rd_rel->reltuples; + } + /* If we did scan the whole table, just use the count as-is */ if (scanned_pages >= total_pages) return scanned_tuples; @@ -1175,24 +1189,8 @@ vac_update_relstats(Relation relation, /* Apply statistical updates, if any, to copied tuple */ dirty = false; - if (pgcform->relpages != (int32) num_pages) - { - pgcform->relpages = (int32) num_pages; - dirty = true; - } - if (pgcform->reltuples != (float4) num_tuples) - { - pgcform->reltuples = (float4) num_tuples; - dirty = true; - } - if (pgcform->relallvisible != (int32) num_all_visible_pages) - { - pgcform->relallvisible = (int32) num_all_visible_pages; - dirty = true; - } /* Apply DDL updates, but not inside an outer transaction (see above) */ - if (!in_outer_xact) { /* @@ -1217,37 +1215,64 @@ vac_update_relstats(Relation relation, } } - /* - * Update relfrozenxid, unless caller passed InvalidTransactionId - * indicating it has no new data. - * - * Ordinarily, we don't let relfrozenxid go backwards: if things are - * working correctly, the only way the new frozenxid could be older would - * be if a previous VACUUM was done with a tighter freeze_min_age, in - * which case we don't want to forget the work it already did. However, - * if the stored relfrozenxid is "in the future", then it must be corrupt - * and it seems best to overwrite it with the cutoff we used this time. - * This should match vac_update_datfrozenxid() concerning what we consider - * to be "in the future". - */ - if (TransactionIdIsNormal(frozenxid) && - pgcform->relfrozenxid != frozenxid && - (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || - TransactionIdPrecedes(ReadNewTransactionId(), - pgcform->relfrozenxid))) + /* global temp table remember relstats to localhash not catalog */ + if (RELATION_IS_GLOBAL_TEMP(relation)) { - pgcform->relfrozenxid = frozenxid; - dirty = true; + up_gtt_relstats(relation, + num_pages, num_tuples, + num_all_visible_pages, + frozenxid, minmulti); } - - /* Similarly for relminmxid */ - if (MultiXactIdIsValid(minmulti) && - pgcform->relminmxid != minmulti && - (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || - MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) + else { - pgcform->relminmxid = minmulti; - dirty = true; + if (pgcform->relpages != (int32) num_pages) + { + pgcform->relpages = (int32) num_pages; + dirty = true; + } + if (pgcform->reltuples != (float4) num_tuples) + { + pgcform->reltuples = (float4) num_tuples; + dirty = true; + } + if (pgcform->relallvisible != (int32) num_all_visible_pages) + { + pgcform->relallvisible = (int32) num_all_visible_pages; + dirty = true; + } + + /* + * Update relfrozenxid, unless caller passed InvalidTransactionId + * indicating it has no new data. + * + * Ordinarily, we don't let relfrozenxid go backwards: if things are + * working correctly, the only way the new frozenxid could be older would + * be if a previous VACUUM was done with a tighter freeze_min_age, in + * which case we don't want to forget the work it already did. However, + * if the stored relfrozenxid is "in the future", then it must be corrupt + * and it seems best to overwrite it with the cutoff we used this time. + * This should match vac_update_datfrozenxid() concerning what we consider + * to be "in the future". + */ + if (TransactionIdIsNormal(frozenxid) && + pgcform->relfrozenxid != frozenxid && + (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), + pgcform->relfrozenxid))) + { + pgcform->relfrozenxid = frozenxid; + dirty = true; + } + + /* Similarly for relminmxid */ + if (MultiXactIdIsValid(minmulti) && + pgcform->relminmxid != minmulti && + (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || + MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) + { + pgcform->relminmxid = minmulti; + dirty = true; + } } /* If anything changed, write out the tuple. */ @@ -1339,6 +1364,10 @@ vac_update_datfrozenxid(void) continue; } + /* global temp table relstats not in pg_class */ + if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + continue; + /* * Some table AMs might not need per-relation xid / multixid horizons. * It therefore seems reasonable to allow relfrozenxid and relminmxid @@ -1396,6 +1425,25 @@ vac_update_datfrozenxid(void) Assert(TransactionIdIsNormal(newFrozenXid)); Assert(MultiXactIdIsValid(newMinMulti)); + /* + * Global temp table get frozenxid from MyProc + * to avoid the vacuum truncate clog that gtt need. + */ + if (max_active_gtt > 0) + { + TransactionId oldest_gtt_frozenxid = + list_all_session_gtt_frozenxids(0, NULL, NULL, NULL); + + if (TransactionIdIsNormal(oldest_gtt_frozenxid) && + TransactionIdPrecedes(oldest_gtt_frozenxid, newFrozenXid)) + { + ereport(WARNING, + (errmsg("global temp table oldest FrozenXid is far in the past"), + errhint("please truncate them or kill those sessions that use them."))); + newFrozenXid = oldest_gtt_frozenxid; + } + } + /* Now fetch the pg_database tuple we need to update. */ relation = table_open(DatabaseRelationId, RowExclusiveLock); diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 8286d9c..c3992a4 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -591,6 +591,8 @@ static void set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) { + char relpersistence; + /* * The flag has previously been initialized to false, so we can just * return if it becomes clear that we can't safely set it. @@ -618,7 +620,11 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, * the rest of the necessary infrastructure right now anyway. So * for now, bail out if we see a temporary table. */ - if (get_rel_persistence(rte->relid) == RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + relpersistence = get_rel_persistence(rte->relid); + + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) return; /* diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index d6f2153..310a9e2 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -6312,7 +6312,9 @@ plan_create_index_workers(Oid tableOid, Oid indexOid) * Furthermore, any index predicate or index expressions must be parallel * safe. */ + /* global temp table is same as local temp table */ if (heap->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + heap->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP || !is_parallel_safe(root, (Node *) RelationGetIndexExpressions(index)) || !is_parallel_safe(root, (Node *) RelationGetIndexPredicate(index))) { diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index d82fc5a..189286b 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -31,6 +31,7 @@ #include "catalog/pg_am.h" #include "catalog/pg_proc.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "foreign/fdwapi.h" #include "miscadmin.h" #include "nodes/makefuncs.h" @@ -53,6 +54,7 @@ #include "utils/snapmgr.h" #include "utils/syscache.h" + /* GUC parameter */ int constraint_exclusion = CONSTRAINT_EXCLUSION_PARTITION; @@ -946,10 +948,10 @@ void estimate_rel_size(Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac) { - BlockNumber curpages; - BlockNumber relpages; - double reltuples; - BlockNumber relallvisible; + BlockNumber curpages = 0; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; double density; switch (rel->rd_rel->relkind) @@ -963,6 +965,21 @@ estimate_rel_size(Relation rel, int32 *attr_widths, case RELKIND_INDEX: + /* global temp table get relstats from localhash */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + get_gtt_relstats(RelationGetRelid(rel), + &relpages, &reltuples, &relallvisible, + NULL, NULL); + } + else + { + /* coerce values in pg_class to more desirable types */ + relpages = (BlockNumber) rel->rd_rel->relpages; + reltuples = (double) rel->rd_rel->reltuples; + relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + } + /* * XXX: It'd probably be good to move this into a callback, * individual index types e.g. know if they have a metapage. @@ -971,11 +988,6 @@ estimate_rel_size(Relation rel, int32 *attr_widths, /* it has storage, ok to call the smgr */ curpages = RelationGetNumberOfBlocks(rel); - /* coerce values in pg_class to more desirable types */ - relpages = (BlockNumber) rel->rd_rel->relpages; - reltuples = (double) rel->rd_rel->reltuples; - relallvisible = (BlockNumber) rel->rd_rel->relallvisible; - /* report estimated # pages */ *pages = curpages; /* quick exit if rel is clearly empty */ @@ -985,10 +997,6 @@ estimate_rel_size(Relation rel, int32 *attr_widths, *allvisfrac = 0; break; } - /* coerce values in pg_class to more desirable types */ - relpages = (BlockNumber) rel->rd_rel->relpages; - reltuples = (double) rel->rd_rel->reltuples; - relallvisible = (BlockNumber) rel->rd_rel->relallvisible; /* * Discount the metapage while estimating the number of tuples. diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 447a61e..a27f57f 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2576,6 +2576,11 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("materialized views must not use temporary tables or views"))); + if (is_query_using_gtt(query)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialized views must not use global temporary tables or views"))); + /* * A materialized view would either need to save parameters for use in * maintaining/loading the data or prohibit them entirely. The latter diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index ad5be90..dff21e0 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3270,17 +3270,11 @@ OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; } | LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; } | GLOBAL TEMPORARY { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; } | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; } @@ -11568,19 +11562,13 @@ OptTempTableName: } | GLOBAL TEMPORARY opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED opt_table qualified_name { diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index ceed0ce..cd1ca50 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -81,6 +81,7 @@ static void expandTupleDesc(TupleDesc tupdesc, Alias *eref, List **colnames, List **colvars); static int specialAttNum(const char *attname); static bool isQueryUsingTempRelation_walker(Node *node, void *context); +static bool is_query_using_gtt_walker(Node *node, void *context); /* @@ -3564,3 +3565,49 @@ isQueryUsingTempRelation_walker(Node *node, void *context) isQueryUsingTempRelation_walker, context); } + +/* check if the query uses global temp table */ +static bool +is_query_using_gtt_walker(Node *node, void *context) +{ + if (node == NULL) + return false; + + if (IsA(node, Query)) + { + Query *query = (Query *) node; + ListCell *rtable; + + foreach(rtable, query->rtable) + { + RangeTblEntry *rte = lfirst(rtable); + + if (rte->rtekind == RTE_RELATION) + { + Relation rel = relation_open(rte->relid, AccessShareLock); + char relpersistence = rel->rd_rel->relpersistence; + + relation_close(rel, AccessShareLock); + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + return true; + } + } + + return query_tree_walker(query, + is_query_using_gtt_walker, + context, + QTW_IGNORE_JOINALIASES); + } + + return expression_tree_walker(node, + is_query_using_gtt_walker, + context); +} + +/* check if the query uses global temp table */ +bool +is_query_using_gtt(Query *query) +{ + return is_query_using_gtt_walker((Node *) query, NULL); +} + diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 42095ab..d5fcbed 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -436,6 +436,9 @@ generateSerialExtraStmts(CreateStmtContext *cxt, ColumnDef *column, seqstmt->sequence = makeRangeVar(snamespace, sname, -1); seqstmt->options = seqoptions; + if (cxt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + seqstmt->sequence->relpersistence = cxt->relation->relpersistence; + /* * If a sequence data type was specified, add it to the options. Prepend * to the list rather than append; in case a user supplied their own AS diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index f0e40e3..bb60926 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2086,6 +2086,11 @@ do_autovacuum(void) } continue; } + else if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + /* autovacuum skip vacuum global temp table */ + continue; + } /* Fetch reloptions and the pgstat entry for this table */ relopts = extract_autovac_opts(tuple, pg_class_desc); @@ -2152,7 +2157,9 @@ do_autovacuum(void) /* * We cannot safely process other backends' temp tables, so skip 'em. */ - if (classForm->relpersistence == RELPERSISTENCE_TEMP) + /* autovacuum skip vacuum global temp table */ + if (classForm->relpersistence == RELPERSISTENCE_TEMP || + classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) continue; relid = classForm->oid; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index aba3960..68adcd5 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -53,6 +53,8 @@ #include "utils/resowner_private.h" #include "utils/timestamp.h" +#include "utils/guc.h" +#include "catalog/storage_gtt.h" /* Note: these two macros only work on shared buffers, not local ones! */ #define BufHdrGetBlock(bufHdr) ((Block) (BufferBlocks + ((Size) (bufHdr)->buf_id) * BLCKSZ)) @@ -432,7 +434,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref) static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, - bool *hit); + bool *hit, Relation rel); static bool PinBuffer(BufferDesc *buf, BufferAccessStrategy strategy); static void PinBuffer_Locked(BufferDesc *buf); static void UnpinBuffer(BufferDesc *buf, bool fixOwner); @@ -664,7 +666,8 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, */ pgstat_count_buffer_read(reln); buf = ReadBuffer_common(reln->rd_smgr, reln->rd_rel->relpersistence, - forkNum, blockNum, mode, strategy, &hit); + forkNum, blockNum, mode, strategy, &hit, + reln); if (hit) pgstat_count_buffer_hit(reln); return buf; @@ -692,7 +695,7 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, Assert(InRecovery); return ReadBuffer_common(smgr, RELPERSISTENCE_PERMANENT, forkNum, blockNum, - mode, strategy, &hit); + mode, strategy, &hit, NULL); } @@ -704,7 +707,8 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, - BufferAccessStrategy strategy, bool *hit) + BufferAccessStrategy strategy, bool *hit, + Relation rel) { BufferDesc *bufHdr; Block bufBlock; @@ -719,6 +723,15 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, isExtend = (blockNum == P_NEW); + /* create storage when first read data page for gtt */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (isExtend || blockNum == 0) && + forkNum == MAIN_FORKNUM && + !gtt_storage_attached(smgr->smgr_rnode.node.relNode)) + { + RelationCreateStorage(smgr->smgr_rnode.node, relpersistence, rel); + } + TRACE_POSTGRESQL_BUFFER_READ_START(forkNum, blockNum, smgr->smgr_rnode.node.spcNode, smgr->smgr_rnode.node.dbNode, @@ -2809,6 +2822,16 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln) BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum) { + /* + * When this backend not init gtt storage + * return 0 + */ + if (RELATION_IS_GLOBAL_TEMP(relation) && + !gtt_storage_attached(relation->rd_node.relNode)) + { + return 0; + } + switch (relation->rd_rel->relkind) { case RELKIND_SEQUENCE: diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c index 427b0d5..7adb969 100644 --- a/src/backend/storage/ipc/ipci.c +++ b/src/backend/storage/ipc/ipci.c @@ -21,6 +21,7 @@ #include "access/nbtree.h" #include "access/subtrans.h" #include "access/twophase.h" +#include "catalog/storage_gtt.h" #include "commands/async.h" #include "miscadmin.h" #include "pgstat.h" @@ -147,6 +148,7 @@ CreateSharedMemoryAndSemaphores(void) size = add_size(size, BTreeShmemSize()); size = add_size(size, SyncScanShmemSize()); size = add_size(size, AsyncShmemSize()); + size = add_size(size, active_gtt_shared_hash_size()); #ifdef EXEC_BACKEND size = add_size(size, ShmemBackendArraySize()); #endif @@ -217,6 +219,8 @@ CreateSharedMemoryAndSemaphores(void) SUBTRANSShmemInit(); MultiXactShmemInit(); InitBufferPool(); + /* global temporary table */ + active_gtt_shared_hash_init(); /* * Set up lock manager diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index c3adb2e..eb95e5f 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -62,6 +62,7 @@ #include "utils/builtins.h" #include "utils/rel.h" #include "utils/snapmgr.h" +#include "utils/guc.h" #define UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) @@ -4087,3 +4088,77 @@ KnownAssignedXidsReset(void) LWLockRelease(ProcArrayLock); } + +/* + * search all active backend to get oldest frozenxid + * for global temp table. + */ +int +list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n) +{ + ProcArrayStruct *arrayP = procArray; + TransactionId result = InvalidTransactionId; + int index; + int flags = 0; + int i = 0; + + if (max_active_gtt <= 0) + return 0; + + if (max_size > 0) + { + Assert(pids); + Assert(xids); + Assert(n); + *n = 0; + } + + if (max_active_gtt <= 0) + return InvalidTransactionId; + + if (RecoveryInProgress()) + return InvalidTransactionId; + + flags |= PROC_IS_AUTOVACUUM; + flags |= PROC_IN_LOGICAL_DECODING; + + LWLockAcquire(ProcArrayLock, LW_SHARED); + if (max_size > 0 && max_size < arrayP->numProcs) + { + LWLockRelease(ProcArrayLock); + elog(ERROR, "list_all_gtt_frozenxids require more array"); + } + + for (index = 0; index < arrayP->numProcs; index++) + { + int pgprocno = arrayP->pgprocnos[index]; + volatile PGPROC *proc = &allProcs[pgprocno]; + volatile PGXACT *pgxact = &allPgXact[pgprocno]; + + if (pgxact->vacuumFlags & flags) + continue; + + if (proc->databaseId == MyDatabaseId && + TransactionIdIsNormal(proc->session_gtt_frozenxid)) + { + if (result == InvalidTransactionId) + result = proc->session_gtt_frozenxid; + else if (TransactionIdPrecedes(proc->session_gtt_frozenxid, result)) + result = proc->session_gtt_frozenxid; + + if (max_size > 0) + { + pids[i] = proc->pid; + xids[i] = proc->session_gtt_frozenxid; + i++; + } + } + } + LWLockRelease(ProcArrayLock); + + if (max_size > 0) + *n = i; + + return result; +} + diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 99e5221..d3a0a18 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -395,6 +395,7 @@ InitProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; @@ -577,6 +578,7 @@ InitAuxiliaryProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index 199c722..92aefd0 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -654,6 +654,12 @@ mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, */ if (zero_damaged_pages || InRecovery) MemSet(buffer, 0, BLCKSZ); + else if(SmgrIsTemp(reln) && blocknum == 0 && forknum == MAIN_FORKNUM) + { + /* global temp table init btree meta page */ + MemSet(buffer, 0, BLCKSZ); + mdwrite(reln, forknum, blocknum, buffer, true); + } else ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c index 8406644..92f028e 100644 --- a/src/backend/utils/adt/dbsize.c +++ b/src/backend/utils/adt/dbsize.c @@ -19,6 +19,8 @@ #include "catalog/namespace.h" #include "catalog/pg_authid.h" #include "catalog/pg_tablespace.h" +#include "catalog/storage_gtt.h" +#include "catalog/index.h" #include "commands/dbcommands.h" #include "commands/tablespace.h" #include "miscadmin.h" @@ -262,7 +264,6 @@ pg_tablespace_size_name(PG_FUNCTION_ARGS) PG_RETURN_INT64(size); } - /* * calculate size of (one fork of) a relation * @@ -307,6 +308,41 @@ calculate_relation_size(RelFileNode *rfn, BackendId backend, ForkNumber forknum) return totalsize; } +static int64 +calculate_relation_size_all_file(Relation rel, const Bitmapset *gtt_map) +{ + int64 size = 0; + ForkNumber forkNum; + BackendId backendid; + + /* For global temp table */ + if (gtt_map) + { + Bitmapset *map_copy = bms_copy(gtt_map); + + backendid = bms_first_member(map_copy); + + do + { + for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) + size += calculate_relation_size(&(rel->rd_node), + backendid, + forkNum); + backendid = bms_next_member(map_copy, backendid); + } while (backendid > 0); + + pfree(map_copy); + } + else + { + for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) + size += calculate_relation_size(&(rel->rd_node), + rel->rd_backend, forkNum); + } + + return size; +} + Datum pg_relation_size(PG_FUNCTION_ARGS) { @@ -340,20 +376,17 @@ pg_relation_size(PG_FUNCTION_ARGS) * Must not be applied to non-TOAST relations. */ static int64 -calculate_toast_table_size(Oid toastrelid) +calculate_toast_table_size(Oid toastrelid, Bitmapset *gtt_map) { int64 size = 0; Relation toastRel; - ForkNumber forkNum; ListCell *lc; List *indexlist; toastRel = relation_open(toastrelid, AccessShareLock); /* toast heap size, including FSM and VM size */ - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - size += calculate_relation_size(&(toastRel->rd_node), - toastRel->rd_backend, forkNum); + size += calculate_relation_size_all_file(toastRel, gtt_map); /* toast index size, including FSM and VM size */ indexlist = RelationGetIndexList(toastRel); @@ -365,9 +398,8 @@ calculate_toast_table_size(Oid toastrelid) toastIdxRel = relation_open(lfirst_oid(lc), AccessShareLock); - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - size += calculate_relation_size(&(toastIdxRel->rd_node), - toastIdxRel->rd_backend, forkNum); + + size += calculate_relation_size_all_file(toastIdxRel, gtt_map); relation_close(toastIdxRel, AccessShareLock); } @@ -386,23 +418,20 @@ calculate_toast_table_size(Oid toastrelid) * those won't have attached toast tables, but they can have multiple forks. */ static int64 -calculate_table_size(Relation rel) +calculate_table_size(Relation rel, Bitmapset *gtt_map) { int64 size = 0; - ForkNumber forkNum; /* * heap size, including FSM and VM */ - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - size += calculate_relation_size(&(rel->rd_node), rel->rd_backend, - forkNum); + size += calculate_relation_size_all_file(rel, gtt_map); /* * Size of toast relation */ if (OidIsValid(rel->rd_rel->reltoastrelid)) - size += calculate_toast_table_size(rel->rd_rel->reltoastrelid); + size += calculate_toast_table_size(rel->rd_rel->reltoastrelid, gtt_map); return size; } @@ -413,7 +442,7 @@ calculate_table_size(Relation rel) * Can be applied safely to an index, but you'll just get zero. */ static int64 -calculate_indexes_size(Relation rel) +calculate_indexes_size(Relation rel, Bitmapset *gtt_map) { int64 size = 0; @@ -429,14 +458,10 @@ calculate_indexes_size(Relation rel) { Oid idxOid = lfirst_oid(cell); Relation idxRel; - ForkNumber forkNum; idxRel = relation_open(idxOid, AccessShareLock); - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - size += calculate_relation_size(&(idxRel->rd_node), - idxRel->rd_backend, - forkNum); + size += calculate_relation_size_all_file(idxRel, gtt_map); relation_close(idxRel, AccessShareLock); } @@ -453,16 +478,40 @@ pg_table_size(PG_FUNCTION_ARGS) Oid relOid = PG_GETARG_OID(0); Relation rel; int64 size; + Bitmapset *gtt_map = NULL; rel = try_relation_open(relOid, AccessShareLock); if (rel == NULL) PG_RETURN_NULL(); - size = calculate_table_size(rel); + /* For GTT, calculate the size of the data file in the session where the GTT has been initialized */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (rel->rd_rel->relkind == RELKIND_INDEX) + { + Relation relation; + Oid relid; + + relid = IndexGetRelation(RelationGetRelid(rel), false); + relation = try_relation_open(relid, AccessShareLock); + if (relation) + { + gtt_map = copy_active_gtt_bitmap(relation->rd_node); + relation_close(relation, AccessShareLock); + } + } + else + gtt_map = copy_active_gtt_bitmap(rel->rd_node); + } + + size = calculate_table_size(rel, gtt_map); relation_close(rel, AccessShareLock); + if(gtt_map) + pfree(gtt_map); + PG_RETURN_INT64(size); } @@ -472,16 +521,24 @@ pg_indexes_size(PG_FUNCTION_ARGS) Oid relOid = PG_GETARG_OID(0); Relation rel; int64 size; + Bitmapset *gtt_map = NULL; rel = try_relation_open(relOid, AccessShareLock); if (rel == NULL) PG_RETURN_NULL(); - size = calculate_indexes_size(rel); + /* For GTT, calculate the size of the data file in the session where the GTT has been initialized */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + gtt_map = copy_active_gtt_bitmap(rel->rd_node); + + size = calculate_indexes_size(rel, gtt_map); relation_close(rel, AccessShareLock); + if (gtt_map) + pfree(gtt_map); + PG_RETURN_INT64(size); } @@ -493,17 +550,25 @@ static int64 calculate_total_relation_size(Relation rel) { int64 size; + Bitmapset *gtt_map = NULL; + + /* For GTT, calculate the size of the data file in the session where the GTT has been initialized */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + gtt_map = copy_active_gtt_bitmap(rel->rd_node); /* * Aggregate the table size, this includes size of the heap, toast and * toast index with free space and visibility map */ - size = calculate_table_size(rel); + size = calculate_table_size(rel, gtt_map); /* * Add size of all attached indexes as well */ - size += calculate_indexes_size(rel); + size += calculate_indexes_size(rel, gtt_map); + + if (gtt_map) + pfree(gtt_map); return size; } @@ -1008,6 +1073,10 @@ pg_relation_filepath(PG_FUNCTION_ARGS) Assert(backend != InvalidBackendId); } break; + /* For global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + backend = BackendIdForTempRelations(); + break; default: elog(ERROR, "invalid relpersistence: %c", relform->relpersistence); backend = InvalidBackendId; /* placate compiler */ diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 18d77ac..eaeebfe 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -142,6 +142,7 @@ #include "utils/timestamp.h" #include "utils/typcache.h" +#include "catalog/storage_gtt.h" /* Hooks for plugins to get control when we ask for stats */ get_relation_stats_hook_type get_relation_stats_hook = NULL; @@ -4578,12 +4579,25 @@ examine_variable(PlannerInfo *root, Node *node, int varRelid, } else if (index->indpred == NIL) { - vardata->statsTuple = - SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(index->indexoid), - Int16GetDatum(pos + 1), - BoolGetDatum(false)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(index->indexoid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = + get_gtt_att_statistic(index->indexoid, + Int16GetDatum(pos + 1), + false); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + vardata->statsTuple = + SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(index->indexoid), + Int16GetDatum(pos + 1), + BoolGetDatum(false)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -4708,15 +4722,27 @@ examine_simple_variable(PlannerInfo *root, Var *var, } else if (rte->rtekind == RTE_RELATION) { - /* - * Plain table or parent of an inheritance appendrel, so look up the - * column in pg_statistic - */ - vardata->statsTuple = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(rte->relid), - Int16GetDatum(var->varattno), - BoolGetDatum(rte->inh)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(rte->relid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = get_gtt_att_statistic(rte->relid, + var->varattno, + rte->inh); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + /* + * Plain table or parent of an inheritance appendrel, so look up the + * column in pg_statistic + */ + vardata->statsTuple = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(rte->relid), + Int16GetDatum(var->varattno), + BoolGetDatum(rte->inh)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -6098,6 +6124,7 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, { /* Simple variable --- look to stats for the underlying table */ RangeTblEntry *rte = planner_rt_fetch(index->rel->relid, root); + char rel_persistence = get_rel_persistence(rte->relid); Assert(rte->rtekind == RTE_RELATION); relid = rte->relid; @@ -6115,6 +6142,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + rte->inh); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -6126,6 +6160,8 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* Expression --- maybe there are stats for the index itself */ relid = index->indexoid; colnum = 1; @@ -6141,6 +6177,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -7029,6 +7072,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, /* attempt to lookup stats in relation for this index column */ if (attnum != 0) { + char rel_persistence = get_rel_persistence(rte->relid); + /* Simple variable -- look to stats for the underlying table */ if (get_relation_stats_hook && (*get_relation_stats_hook) (root, rte, attnum, &vardata)) @@ -7041,6 +7086,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(rte->relid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = @@ -7053,6 +7106,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* * Looks like we've found an expression column in the index. Let's * see if there's any stats for it. @@ -7072,6 +7127,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(index->indexoid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 1e3e6d3..44686ce 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -34,6 +34,7 @@ #include "catalog/pg_statistic.h" #include "catalog/pg_transform.h" #include "catalog/pg_type.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "utils/array.h" @@ -46,6 +47,7 @@ #include "utils/syscache.h" #include "utils/typcache.h" + /* Hook for plugins to get control in get_attavgwidth() */ get_attavgwidth_hook_type get_attavgwidth_hook = NULL; @@ -2878,6 +2880,18 @@ get_attavgwidth(Oid relid, AttrNumber attnum) if (stawidth > 0) return stawidth; } + if (get_rel_persistence(relid) == RELPERSISTENCE_GLOBAL_TEMP) + { + tp = get_gtt_att_statistic(relid, attnum, false); + if (!HeapTupleIsValid(tp)) + return 0; + + stawidth = ((Form_pg_statistic) GETSTRUCT(tp))->stawidth; + if (stawidth > 0) + return stawidth; + else + return 0; + } tp = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(relid), Int16GetDatum(attnum), diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index df025a5..1c30d86 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -1124,6 +1124,16 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) relation->rd_islocaltemp = false; } break; + case RELPERSISTENCE_GLOBAL_TEMP: + { + relation->rd_backend = BackendIdForTempRelations(); + /* + * For global temp table, all backend can use + * this relation, so rd_islocaltemp always true. + */ + relation->rd_islocaltemp = true; + } + break; default: elog(ERROR, "invalid relpersistence: %c", relation->rd_rel->relpersistence); @@ -3313,6 +3323,10 @@ RelationBuildLocalRelation(const char *relname, rel->rd_backend = BackendIdForTempRelations(); rel->rd_islocaltemp = true; break; + case RELPERSISTENCE_GLOBAL_TEMP: + rel->rd_backend = BackendIdForTempRelations(); + rel->rd_islocaltemp = true; + break; default: elog(ERROR, "invalid relpersistence: %c", relpersistence); break; @@ -3427,6 +3441,9 @@ RelationSetNewRelfilenode(Relation relation, char persistence) TransactionId freezeXid = InvalidTransactionId; RelFileNode newrnode; + if (RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "global temp table does not allow setting new relfilenode"); + /* Allocate a new relfilenode */ newrelfilenode = GetNewRelFileNode(relation->rd_rel->reltablespace, NULL, persistence); @@ -3467,7 +3484,7 @@ RelationSetNewRelfilenode(Relation relation, char persistence) /* handle these directly, at least for now */ SMgrRelation srel; - srel = RelationCreateStorage(newrnode, persistence); + srel = RelationCreateStorage(newrnode, persistence, relation); smgrclose(srel); } break; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index a4e5d08..37ce83d 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -139,6 +139,18 @@ char *GUC_check_errmsg_string; char *GUC_check_errdetail_string; char *GUC_check_errhint_string; +/* + * num = 0 means disable global temp table feature. + * global temp table define can still storage in catalog + * just can not use. + * num > 0 means database can management num active global temp table. + */ +#define MIN_NUM_ACTIVE_GTT 0 +#define DEFAULT_NUM_ACTIVE_GTT 1000 +#define MAX_NUM_ACTIVE_GTT 1000000 + +int max_active_gtt = MIN_NUM_ACTIVE_GTT; + static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3, 4); static void set_config_sourcefile(const char *name, char *sourcefile, @@ -1979,6 +1991,15 @@ static struct config_bool ConfigureNamesBool[] = static struct config_int ConfigureNamesInt[] = { { + {"max_active_global_temporary_table", PGC_POSTMASTER, UNGROUPED, + gettext_noop("max active global temporary table."), + NULL + }, + &max_active_gtt, + DEFAULT_NUM_ACTIVE_GTT, MIN_NUM_ACTIVE_GTT, MAX_NUM_ACTIVE_GTT, + NULL, NULL, NULL + }, + { {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Forces a switch to the next WAL file if a " "new file has not been started within N seconds."), diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 799b698..b98d396 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15583,6 +15583,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) { char *ftoptions = NULL; char *srvname = NULL; + char *table_type = NULL; switch (tbinfo->relkind) { @@ -15634,9 +15635,15 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) binary_upgrade_set_pg_class_oids(fout, q, tbinfo->dobj.catId.oid, false); + if (tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED) + table_type = "UNLOGGED "; + else if (tbinfo->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + table_type = "GLOBAL TEMPORARY "; + else + table_type = ""; + appendPQExpBuffer(q, "CREATE %s%s %s", - tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ? - "UNLOGGED " : "", + table_type, reltypename, qualrelname); diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index f3c7eb9..28134e2 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3723,7 +3723,8 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys if (pset.sversion >= 90100) { appendPQExpBuffer(&buf, - ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + ",\n CASE c.relpersistence WHEN 'g' THEN '%s' WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + gettext_noop("session"), gettext_noop("permanent"), gettext_noop("temporary"), gettext_noop("unlogged"), diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index a12fc1f..78958e4 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -165,6 +165,7 @@ typedef FormData_pg_class *Form_pg_class; #define RELPERSISTENCE_PERMANENT 'p' /* regular table */ #define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */ #define RELPERSISTENCE_TEMP 't' /* temporary table */ +#define RELPERSISTENCE_GLOBAL_TEMP 'g' /* global temporary table */ /* default selection for replica identity (primary key or nothing) */ #define REPLICA_IDENTITY_DEFAULT 'd' diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 0b6045a..6bc884e 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5477,6 +5477,40 @@ proparallel => 'r', prorettype => 'float8', proargtypes => 'oid', prosrc => 'pg_stat_get_xact_function_self_time' }, +# For global temporary table +{ oid => '4191', + descr => 'List local statistics for global temporary table', + proname => 'pg_get_gtt_statistics', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid int4 anyelement', + proallargtypes => '{oid,int4,anyelement,oid,int2,bool,float4,int4,float4,int2,int2,int2,int2,int2,oid,oid,oid,oid,oid,oid,oid,oid,oid,oid,_float4,_float4,_float4,_float4,_float4,anyarray,anyarray,anyarray,anyarray,anyarray}', + proargmodes => '{i,i,i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}', + proargnames => '{relid,att,x,starelid,staattnum,stainherit,stanullfrac,stawidth,stadistinct,stakind1,stakind2,stakind3,stakind4,stakind5,staop1,staop2,staop3,staop4,staop5,stacoll1,stacoll2,stacoll3,stacoll4,stacoll5,stanumbers1,stanumbers2,stanumbers3,stanumbers4,stanumbers5,stavalues1,stavalues2,stavalues3,stavalues4,stavalues5}', + prosrc => 'pg_get_gtt_statistics' }, +{ oid => '4192', + descr => 'List local relstats for global temporary table', + proname => 'pg_get_gtt_relstats', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,int4,float4,int4,xid,xid}', + proargmodes => '{i,o,o,o,o,o}', + proargnames => '{relid,relpages,reltuples,relallvisible,relfrozenxid,relminmxid}', + prosrc => 'pg_get_gtt_relstats' }, +{ oid => '4193', + descr => 'List attached pid for one global temporary table', + proname => 'pg_gtt_attached_pid', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,oid,int4}', + proargmodes => '{i,o,o}', + proargnames => '{relid,relid,pid}', + prosrc => 'pg_gtt_attached_pid' }, +{ oid => '4194', + descr => 'List those backends that have used global temporary table', + proname => 'pg_list_gtt_relfrozenxids', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => '', + proallargtypes => '{int4,xid}', + proargmodes => '{o,o}', + proargnames => '{pid,relfrozenxid}', + prosrc => 'pg_list_gtt_relfrozenxids' }, + { oid => '3788', descr => 'statistics: timestamp of the current statistics snapshot', proname => 'pg_stat_get_snapshot_timestamp', provolatile => 's', diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h index 048003c..af48cdf 100644 --- a/src/include/catalog/storage.h +++ b/src/include/catalog/storage.h @@ -19,7 +19,7 @@ #include "storage/smgr.h" #include "utils/relcache.h" -extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence); +extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel); extern void RelationDropStorage(Relation rel); extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit); extern void RelationTruncate(Relation rel, BlockNumber nblocks); diff --git a/src/include/catalog/storage_gtt.h b/src/include/catalog/storage_gtt.h new file mode 100644 index 0000000..eacc214 --- /dev/null +++ b/src/include/catalog/storage_gtt.h @@ -0,0 +1,39 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.h + * prototypes for functions in backend/catalog/storage_gtt.c + * + * src/include/catalog/storage_gtt.h + * + *------------------------------------------------------------------------- + */ +#ifndef STORAGE_GTT_H +#define STORAGE_GTT_H + +#include "access/htup.h" +#include "storage/block.h" +#include "storage/relfilenode.h" +#include "utils/relcache.h" + +extern Size active_gtt_shared_hash_size(void); +extern void active_gtt_shared_hash_init(void); +extern void remember_gtt_storage_info(RelFileNode rnode, Relation rel); +extern void forget_gtt_storage_info(Oid relid); +extern bool is_other_backend_use_gtt(RelFileNode node); +extern bool gtt_storage_attached(Oid relid); +extern Bitmapset *copy_active_gtt_bitmap(RelFileNode node); +extern void up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull); +extern HeapTuple get_gtt_att_statistic(Oid reloid, int attnum, bool inh); +extern void release_gtt_statistic_cache(HeapTuple tup); +extern void up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid); +extern bool get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid); + +#endif /* STORAGE_H */ diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index b8bff23..70c01f7 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -117,4 +117,7 @@ extern Oid attnumTypeId(Relation rd, int attid); extern Oid attnumCollationId(Relation rd, int attid); extern bool isQueryUsingTempRelation(Query *query); +/* global temp table check */ +extern bool is_query_using_gtt(Query *query); + #endif /* PARSE_RELATION_H */ diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 870ecb5..92c590e 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -405,6 +405,8 @@ do { \ #define PageClearPrunable(page) \ (((PageHeader) (page))->pd_prune_xid = InvalidTransactionId) +#define GlobalTempRelationPageIsNotInitialized(rel, page) \ + ((rel)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && PageIsNew(page)) /* ---------------------------------------------------------------- * extern declarations diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 8fda8e4..172eae9 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -220,6 +220,7 @@ typedef enum BuiltinTrancheIds LWTRANCHE_TBM, LWTRANCHE_PARALLEL_APPEND, LWTRANCHE_SXACT, + LWTRANCHE_GTT_CTL, LWTRANCHE_FIRST_USER_DEFINED } BuiltinTrancheIds; diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 5b407e6..f13250a 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -117,6 +117,8 @@ struct PGPROC Oid tempNamespaceId; /* OID of temp schema this backend is * using */ + TransactionId session_gtt_frozenxid; /* session level global temp table relfrozenxid */ + bool isBackgroundWorker; /* true if background worker. */ /* diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index a5c7d0c..a86f61f 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -125,4 +125,6 @@ extern void ProcArraySetReplicationSlotXmin(TransactionId xmin, extern void ProcArrayGetReplicationSlotXmin(TransactionId *xmin, TransactionId *catalog_xmin); +extern int list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n); + #endif /* PROCARRAY_H */ diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index ce93ace..0f7262e 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -281,6 +281,10 @@ extern int tcp_user_timeout; extern bool trace_sort; #endif +/* global temporary table */ +extern int max_active_gtt; +/* end */ + /* * Functions exported by guc.c */ diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 44ed04d..3f9720d 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -277,6 +277,7 @@ typedef struct StdRdOptions int parallel_workers; /* max number of parallel workers */ bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */ bool vacuum_truncate; /* enables vacuum to truncate a relation */ + bool on_commit_delete_rows; /* global temp table */ } StdRdOptions; #define HEAP_MIN_FILLFACTOR 10 @@ -535,7 +536,8 @@ typedef struct ViewOptions * True if relation's pages are stored in local buffers. */ #define RelationUsesLocalBuffers(relation) \ - ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP || \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) /* * RELATION_IS_LOCAL @@ -602,6 +604,17 @@ typedef struct ViewOptions RelationNeedsWAL(relation) && \ !IsCatalogRelation(relation)) +/* global temp table implementations */ +#define RELATION_IS_GLOBAL_TEMP(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + +#define RELATION_GTT_ON_COMMIT_DELETE(relation) \ + ((relation)->rd_options && \ + ((relation)->rd_rel->relkind == RELKIND_RELATION || (relation)->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) && \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP ? \ + ((StdRdOptions *) (relation)->rd_options)->on_commit_delete_rows : false) + +#define RelationGetRelPersistence(relation) ((relation)->rd_rel->relpersistence) + /* routines in utils/cache/relcache.c */ extern void RelationIncrementReferenceCount(Relation rel); extern void RelationDecrementReferenceCount(Relation rel); diff --git a/src/test/regress/expected/gtt_clean.out b/src/test/regress/expected/gtt_clean.out new file mode 100644 index 0000000..50ca9ac --- /dev/null +++ b/src/test/regress/expected/gtt_clean.out @@ -0,0 +1,7 @@ +reset search_path; +drop schema gtt cascade; +NOTICE: drop cascades to 4 other objects +DETAIL: drop cascades to table gtt.gtt1 +drop cascades to table gtt.gtt2 +drop cascades to table gtt.gtt3 +drop cascades to table gtt.gtt_t_kenyon diff --git a/src/test/regress/expected/gtt_function.out b/src/test/regress/expected/gtt_function.out new file mode 100644 index 0000000..2c69f14 --- /dev/null +++ b/src/test/regress/expected/gtt_function.out @@ -0,0 +1,197 @@ +CREATE SCHEMA IF NOT EXISTS gtt_function; +set search_path=gtt_function,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt_test_rename(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); +ERROR: cannot create indexes on global temporary tables using concurrent mode +-- ERROR +cluster gtt1 using gtt1_pkey; +ERROR: not support cluster global temporary tables yet +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; +ERROR: ON COMMIT can only be used on temporary tables +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); +ERROR: regular table cannot specifie on_commit_delete_rows +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +); + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; + count +------- + 2 +(1 row) + +commit; +select count(*) from p_table01; + count +------- + 0 +(1 row) + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +ERROR: The parent table must be global temporary table +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp); +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + relname | relkind | relpersistence | reloptions +---------------------------------+---------+----------------+------------------------------- + p_table01 | p | g | {on_commit_delete_rows=true} + p_table01_2017 | r | g | {on_commit_delete_rows=true} + p_table01_2018 | r | g | {on_commit_delete_rows=true} + p_table01_id_seq | S | g | + p_table02 | p | g | {on_commit_delete_rows=false} + p_table02_2017 | r | g | {on_commit_delete_rows=false} + p_table02_2018 | r | g | {on_commit_delete_rows=false} + p_table02_id_seq | S | g | + tbl_inherits_parent | r | p | + tbl_inherits_parent_global_temp | r | g | {on_commit_delete_rows=true} + tbl_inherits_partition | r | g | {on_commit_delete_rows=true} +(11 rows) + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; +ERROR: global temp table not support on commit drop clause +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; +ERROR: can not defeine global temp table with on commit and with clause at same time +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); +--ok +alter table gtt_test_rename rename to gtt_test; +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; + id | a +----+--- + 2 | 1 + 3 | 2 +(2 rows) + +truncate gtt_seq; +select * from gtt_seq order by id; + id | a +----+--- +(0 rows) + +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + id | a +----+--- + 4 | 3 +(1 row) + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; +ERROR: materialized views must not use global temporary tables or views +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +ERROR: only support btree index on global temp table +create index idx_err on gtt1 using gist (a); +ERROR: data type integer has no default operator class for access method "gist" +HINT: You must specify an operator class for the index or define a default operator class for the data type. +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +ERROR: only support btree index on global temp table +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); +ERROR: only support btree index on global temp table +reset search_path; +drop schema gtt_function cascade; +NOTICE: drop cascades to 15 other objects +DETAIL: drop cascades to table gtt_function.gtt1 +drop cascades to table gtt_function.gtt_test +drop cascades to table gtt_function.gtt2 +drop cascades to table gtt_function.gtt3 +drop cascades to table gtt_function.tmp_t0 +drop cascades to table gtt_function.tbl_inherits_parent +drop cascades to table gtt_function.tbl_inherits_parent_global_temp +drop cascades to table gtt_function.products +drop cascades to table gtt_function.measurement +drop cascades to table gtt_function.p_table01 +drop cascades to table gtt_function.p_table02 +drop cascades to table gtt_function.tbl_inherits_partition +drop cascades to table gtt_function.gtt5 +drop cascades to table gtt_function.mytable +drop cascades to table gtt_function.gtt_seq diff --git a/src/test/regress/expected/gtt_parallel_1.out b/src/test/regress/expected/gtt_parallel_1.out new file mode 100644 index 0000000..30d8a7b --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_1.out @@ -0,0 +1,84 @@ +set search_path=gtt,sys; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_parallel_2.out b/src/test/regress/expected/gtt_parallel_2.out new file mode 100644 index 0000000..850ef3e --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_2.out @@ -0,0 +1,161 @@ +set search_path=gtt,sys; +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +commit; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 + 3 | test1 +(3 rows) + +rollback; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test2 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; + a | b +---+------- + 3 | test3 +(1 row) + +rollback; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; + a | b +---+------- + 5 | test5 +(1 row) + +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + a | b +---+------- + 6 | test6 +(1 row) + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; + count +-------- + 100000 +(1 row) + +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + QUERY PLAN +------------------------------------ + Index Scan using gtt3_pkey on gtt3 + Index Cond: (a = 300) +(2 rows) + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; + relname | pg_relation_size | pg_relation_size | pg_table_size | pg_indexes_size | pg_total_relation_size +--------------+------------------+------------------+---------------+-----------------+------------------------ + gtt_t_kenyon | 450560 | 8192 | 499712 | 475136 | 974848 +(1 row) + +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + relname +-------------- + gtt_t_kenyon +(1 row) + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + relname | pg_relation_size | pg_table_size | pg_total_relation_size +--------------------+------------------+---------------+------------------------ + idx_gtt_t_kenyon_1 | 65536 | 65536 | 65536 + idx_gtt_t_kenyon_2 | 409600 | 409600 | 409600 +(2 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_prepare.out b/src/test/regress/expected/gtt_prepare.out new file mode 100644 index 0000000..9735a93 --- /dev/null +++ b/src/test/regress/expected/gtt_prepare.out @@ -0,0 +1,9 @@ +CREATE SCHEMA IF NOT EXISTS gtt; +set search_path=gtt,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; diff --git a/src/test/regress/expected/gtt_stats.out b/src/test/regress/expected/gtt_stats.out new file mode 100644 index 0000000..b258b7c --- /dev/null +++ b/src/test/regress/expected/gtt_stats.out @@ -0,0 +1,76 @@ +CREATE SCHEMA IF NOT EXISTS gtt_stats; +set search_path=gtt_stats,sys; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +insert into gtt values(generate_series(1,10000),'test'); +-- expect 1 +select count(*) from pg_gtt_attached_pids; + count +------- + 1 +(1 row) + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 2 +(1 row) + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 0 | 0 | 0 +(1 row) + +-- expect 0 +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+------------------+-------------+-------------------+------------------------+---------------------- +(0 rows) + +analyze gtt; +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 55 | 10000 | 0 +(1 row) + +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------------------+------------------------+---------------------- + gtt_stats | gtt | a | f | 0 | 4 | -1 | | | {1,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,8700,8800,8900,9000,9100,9200,9300,9400,9500,9600,9700,9800,9900,10000} | 1 | | | + gtt_stats | gtt | b | f | 0 | 5 | 1 | {test} | {1} | | 1 | | | +(2 rows) + +reset search_path; +drop schema gtt_stats cascade; +NOTICE: drop cascades to table gtt_stats.gtt diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 80a0782..d3d9927 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1348,6 +1348,93 @@ pg_group| SELECT pg_authid.rolname AS groname, WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin); +pg_gtt_attached_pids| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relid, + s.pid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_gtt_attached_pid(c.oid) s(relid, pid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_relstats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relpages, + s.reltuples, + s.relallvisible, + s.relfrozenxid, + s.relminmxid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_relstats(c.oid) s(relpages, reltuples, relallvisible, relfrozenxid, relminmxid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_stats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN (s.stakind1 = 1) THEN s.stavalues1 + WHEN (s.stakind2 = 1) THEN s.stavalues2 + WHEN (s.stakind3 = 1) THEN s.stavalues3 + WHEN (s.stakind4 = 1) THEN s.stavalues4 + WHEN (s.stakind5 = 1) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_vals, + CASE + WHEN (s.stakind1 = 1) THEN s.stanumbers1 + WHEN (s.stakind2 = 1) THEN s.stanumbers2 + WHEN (s.stakind3 = 1) THEN s.stanumbers3 + WHEN (s.stakind4 = 1) THEN s.stanumbers4 + WHEN (s.stakind5 = 1) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_freqs, + CASE + WHEN (s.stakind1 = 2) THEN s.stavalues1 + WHEN (s.stakind2 = 2) THEN s.stavalues2 + WHEN (s.stakind3 = 2) THEN s.stavalues3 + WHEN (s.stakind4 = 2) THEN s.stavalues4 + WHEN (s.stakind5 = 2) THEN s.stavalues5 + ELSE NULL::text[] + END AS histogram_bounds, + CASE + WHEN (s.stakind1 = 3) THEN s.stanumbers1[1] + WHEN (s.stakind2 = 3) THEN s.stanumbers2[1] + WHEN (s.stakind3 = 3) THEN s.stanumbers3[1] + WHEN (s.stakind4 = 3) THEN s.stanumbers4[1] + WHEN (s.stakind5 = 3) THEN s.stanumbers5[1] + ELSE NULL::real + END AS correlation, + CASE + WHEN (s.stakind1 = 4) THEN s.stavalues1 + WHEN (s.stakind2 = 4) THEN s.stavalues2 + WHEN (s.stakind3 = 4) THEN s.stavalues3 + WHEN (s.stakind4 = 4) THEN s.stavalues4 + WHEN (s.stakind5 = 4) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_elems, + CASE + WHEN (s.stakind1 = 4) THEN s.stanumbers1 + WHEN (s.stakind2 = 4) THEN s.stanumbers2 + WHEN (s.stakind3 = 4) THEN s.stanumbers3 + WHEN (s.stakind4 = 4) THEN s.stanumbers4 + WHEN (s.stakind5 = 4) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_elem_freqs, + CASE + WHEN (s.stakind1 = 5) THEN s.stanumbers1 + WHEN (s.stakind2 = 5) THEN s.stanumbers2 + WHEN (s.stakind3 = 5) THEN s.stanumbers3 + WHEN (s.stakind4 = 5) THEN s.stanumbers4 + WHEN (s.stakind5 = 5) THEN s.stanumbers5 + ELSE NULL::real[] + END AS elem_count_histogram + FROM ((pg_class c + JOIN pg_attribute a ON ((c.oid = a.attrelid))) + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_statistics(c.oid, (a.attnum)::integer, ''::text) s(starelid, staattnum, stainherit, stanullfrac, stawidth, stadistinct, stakind1, stakind2, stakind3, stakind4, stakind5, staop1, staop2, staop3, staop4, staop5, stacoll1, stacoll2, stacoll3, stacoll4, stacoll5, stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5, stavalues1, stavalues2, stavalues3, stavalues4, stavalues5) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND (NOT a.attisdropped) AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); pg_hba_file_rules| SELECT a.line_number, a.type, a.database, diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index d33a4e1..643afe4 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -121,3 +121,10 @@ test: fast_default # run stats by itself because its delay may be insufficient under heavy load test: stats + +# global temp table test +test: gtt_stats +test: gtt_function +test: gtt_prepare +test: gtt_parallel_1 gtt_parallel_2 +test: gtt_clean diff --git a/src/test/regress/sql/gtt_clean.sql b/src/test/regress/sql/gtt_clean.sql new file mode 100644 index 0000000..f3cf710 --- /dev/null +++ b/src/test/regress/sql/gtt_clean.sql @@ -0,0 +1,6 @@ + + +reset search_path; + +drop schema gtt cascade; + diff --git a/src/test/regress/sql/gtt_function.sql b/src/test/regress/sql/gtt_function.sql new file mode 100644 index 0000000..49c3f11 --- /dev/null +++ b/src/test/regress/sql/gtt_function.sql @@ -0,0 +1,163 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_function; + +set search_path=gtt_function,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt_test_rename(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); + +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); + +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); + +-- ERROR +cluster gtt1 using gtt1_pkey; + +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; + +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); + +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); + +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +); + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; +commit; + +select count(*) from p_table01; + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; + +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp); + +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; + +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; + +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); + +--ok +alter table gtt_test_rename rename to gtt_test; + +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); + +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; + +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; +truncate gtt_seq; +select * from gtt_seq order by id; +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; + +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +create index idx_err on gtt1 using gist (a); +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); + +reset search_path; + +drop schema gtt_function cascade; + diff --git a/src/test/regress/sql/gtt_parallel_1.sql b/src/test/regress/sql/gtt_parallel_1.sql new file mode 100644 index 0000000..d7d81de --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_1.sql @@ -0,0 +1,42 @@ + + +set search_path=gtt,sys; + +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +commit; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +rollback; +select * from gtt1 order by a; + +truncate gtt1; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +select * from gtt1 order by a; +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + +begin; +select * from gtt1 order by a; +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +commit; +select * from gtt1 order by a; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_parallel_2.sql b/src/test/regress/sql/gtt_parallel_2.sql new file mode 100644 index 0000000..5203c2b --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_2.sql @@ -0,0 +1,76 @@ + + +set search_path=gtt,sys; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; +commit; +select * from gtt3 order by a; + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +truncate gtt3; +select * from gtt3 order by a; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; +truncate gtt3; +select * from gtt3 order by a; +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +begin; +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_prepare.sql b/src/test/regress/sql/gtt_prepare.sql new file mode 100644 index 0000000..1e4cf27 --- /dev/null +++ b/src/test/regress/sql/gtt_prepare.sql @@ -0,0 +1,16 @@ + +CREATE SCHEMA IF NOT EXISTS gtt; + +set search_path=gtt,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; + diff --git a/src/test/regress/sql/gtt_stats.sql b/src/test/regress/sql/gtt_stats.sql new file mode 100644 index 0000000..f041892 --- /dev/null +++ b/src/test/regress/sql/gtt_stats.sql @@ -0,0 +1,42 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_stats; + +set search_path=gtt_stats,sys; + +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +insert into gtt values(generate_series(1,10000),'test'); + +-- expect 1 +select count(*) from pg_gtt_attached_pids; + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +-- expect 0 +select * from pg_gtt_stats order by tablename; + +analyze gtt; + +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +select * from pg_gtt_stats order by tablename; + +reset search_path; + +drop schema gtt_stats cascade; + ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-19 17:32 Erik Rijkers <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Erik Rijkers @ 2020-01-19 17:32 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 2020-01-19 18:04, 曾文旌(义从) wrote: >> 2020年1月14日 下午9:20,Pavel Stehule <[email protected]> 写道: >> út 14. 1. 2020 v 14:09 odesílatel 曾文旌(义从) <[email protected] >> <mailto:[email protected]>> napsal: >> [global_temporary_table_v4-pg13.patch ] Hi, This patch doesn't quiet apply for me: patching file src/backend/access/common/reloptions.c patching file src/backend/access/gist/gistutil.c patching file src/backend/access/hash/hash.c Hunk #1 succeeded at 149 (offset 3 lines). patching file src/backend/access/heap/heapam_handler.c patching file src/backend/access/heap/vacuumlazy.c patching file src/backend/access/nbtree/nbtpage.c patching file src/backend/access/table/tableam.c patching file src/backend/access/transam/xlog.c patching file src/backend/catalog/Makefile Hunk #1 FAILED at 44. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/catalog/Makefile.rej [...] (The rest applies without errors) src/backend/catalog/Makefile.rej contains: ------------------------ --- src/backend/catalog/Makefile +++ src/backend/catalog/Makefile @@ -44,6 +44,8 @@ OBJS = \ storage.o \ toasting.o +OBJS += storage_gtt.o + BKIFILES = postgres.bki postgres.description postgres.shdescription include $(top_srcdir)/src/backend/common.mk ------------------------ Can you have a look? thanks, Erik Rijkers ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-20 16:27 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Erik Rijkers <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-20 16:27 UTC (permalink / raw) To: Erik Rijkers <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月20日 上午1:32,Erik Rijkers <[email protected]> 写道: > > On 2020-01-19 18:04, 曾文旌(义从) wrote: >>> 2020年1月14日 下午9:20,Pavel Stehule <[email protected]> 写道: >>> út 14. 1. 2020 v 14:09 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: > >>> [global_temporary_table_v4-pg13.patch ] > > Hi, > > This patch doesn't quiet apply for me: > > patching file src/backend/access/common/reloptions.c > patching file src/backend/access/gist/gistutil.c > patching file src/backend/access/hash/hash.c > Hunk #1 succeeded at 149 (offset 3 lines). > patching file src/backend/access/heap/heapam_handler.c > patching file src/backend/access/heap/vacuumlazy.c > patching file src/backend/access/nbtree/nbtpage.c > patching file src/backend/access/table/tableam.c > patching file src/backend/access/transam/xlog.c > patching file src/backend/catalog/Makefile > Hunk #1 FAILED at 44. > 1 out of 1 hunk FAILED -- saving rejects to file src/backend/catalog/Makefile.rej > [...] > (The rest applies without errors) > > src/backend/catalog/Makefile.rej contains: > > ------------------------ > --- src/backend/catalog/Makefile > +++ src/backend/catalog/Makefile > @@ -44,6 +44,8 @@ OBJS = \ > storage.o \ > toasting.o > > +OBJS += storage_gtt.o > + > BKIFILES = postgres.bki postgres.description postgres.shdescription > > include $(top_srcdir)/src/backend/common.mk > ------------------------ > > Can you have a look? I updated the code and remade the patch. Please give me feedback if you have any more questions. > > > thanks, > > Erik Rijkers > > > > > Attachments: [application/octet-stream] global_temporary_table_v5-pg13.patch (159.2K, ../../[email protected]/2-global_temporary_table_v5-pg13.patch) download | inline diff: diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 79430d2..b7173c7 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -158,6 +158,19 @@ static relopt_bool boolRelOpts[] = }, true }, + /* + * For global temp table only + * use AccessExclusiveLock for ensure safety + */ + { + { + "on_commit_delete_rows", + "global temp table on commit options", + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, + ShareUpdateExclusiveLock + }, + true + }, /* list terminator */ {{NULL}} }; @@ -1486,6 +1499,8 @@ bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind) { static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)}, {"fillfactor", RELOPT_TYPE_INT, offsetof(StdRdOptions, fillfactor)}, {"autovacuum_enabled", RELOPT_TYPE_BOOL, offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, enabled)}, @@ -1586,13 +1601,18 @@ build_reloptions(Datum reloptions, bool validate, bytea * partitioned_table_reloptions(Datum reloptions, bool validate) { + static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)} + }; + /* * There are no options for partitioned tables yet, but this is able to do * some validation. */ return (bytea *) build_reloptions(reloptions, validate, RELOPT_KIND_PARTITIONED, - 0, NULL, 0); + sizeof(StdRdOptions), tab, lengthof(tab)); } /* diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index dd975b1..1610e7d 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -1013,7 +1013,9 @@ gistGetFakeLSN(Relation rel) { static XLogRecPtr counter = FirstNormalUnloggedLSN; - if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + /* global temp is same as local temp table */ + if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + rel->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { /* * Temporary relations are only accessible in our session, so a simple diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 4871b7f..16b00c9 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -149,7 +149,9 @@ hashbuild(Relation heap, Relation index, IndexInfo *indexInfo) * metapage, nor the first bitmap page. */ sort_threshold = (maintenance_work_mem * 1024L) / BLCKSZ; - if (index->rd_rel->relpersistence != RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + if (!(index->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + index->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) sort_threshold = Min(sort_threshold, NBuffers); else sort_threshold = Min(sort_threshold, NLocBuffer); diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index 1f6f6d0..5727ccd 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -598,7 +598,7 @@ heapam_relation_set_new_filenode(Relation rel, */ *minmulti = GetOldestMultiXactId(); - srel = RelationCreateStorage(*newrnode, persistence); + srel = RelationCreateStorage(*newrnode, persistence, rel); /* * If required, set up an init fork for an unlogged table so that it can @@ -651,7 +651,7 @@ heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index b331f4c..5bd681f 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -79,6 +79,7 @@ #include "utils/pg_rusage.h" #include "utils/timestamp.h" +#include "catalog/storage_gtt.h" /* * Space/time tradeoff parameters: do these need to be user-tunable? @@ -397,8 +398,10 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, Assert(params->truncate != VACOPT_TERNARY_DEFAULT); /* not every AM requires these to be valid, but heap does */ - Assert(TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); - Assert(MultiXactIdIsValid(onerel->rd_rel->relminmxid)); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relfrozenxid == InvalidTransactionId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && TransactionIdIsNormal(onerel->rd_rel->relfrozenxid))); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relminmxid == InvalidMultiXactId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && MultiXactIdIsValid(onerel->rd_rel->relminmxid))); /* measure elapsed time iff autovacuum logging requires it */ if (IsAutoVacuumWorkerProcess() && params->log_min_duration >= 0) @@ -457,8 +460,19 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, vacrelstats = (LVRelStats *) palloc0(sizeof(LVRelStats)); - vacrelstats->old_rel_pages = onerel->rd_rel->relpages; - vacrelstats->old_live_tuples = onerel->rd_rel->reltuples; + /* get relstat from gtt localhash */ + if (RELATION_IS_GLOBAL_TEMP(onerel)) + { + get_gtt_relstats(RelationGetRelid(onerel), + &vacrelstats->old_rel_pages, + &vacrelstats->old_live_tuples, + NULL, NULL, NULL); + } + else + { + vacrelstats->old_rel_pages = onerel->rd_rel->relpages; + vacrelstats->old_live_tuples = onerel->rd_rel->reltuples; + } vacrelstats->num_index_scans = 0; vacrelstats->pages_removed = 0; vacrelstats->lock_waiter_detected = false; diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index f05cbe7..946c9d2 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -763,7 +763,14 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access) /* Read an existing block of the relation */ buf = ReadBuffer(rel, blkno); LockBuffer(buf, access); - _bt_checkpage(rel, buf); + + /* global temp table may be not yet initialized for this backend. */ + if (RELATION_IS_GLOBAL_TEMP(rel) && + blkno == BTREE_METAPAGE && + PageIsNew(BufferGetPage(buf))) + _bt_initmetapage(BufferGetPage(buf), P_NONE, 0); + else + _bt_checkpage(rel, buf); } else { diff --git a/src/backend/access/table/tableam.c b/src/backend/access/table/tableam.c index c814733..ff51840 100644 --- a/src/backend/access/table/tableam.c +++ b/src/backend/access/table/tableam.c @@ -24,6 +24,7 @@ #include "access/heapam.h" /* for ss_* */ #include "access/tableam.h" #include "access/xact.h" +#include "catalog/storage_gtt.h" #include "optimizer/plancat.h" #include "storage/bufmgr.h" #include "storage/shmem.h" @@ -560,10 +561,20 @@ table_block_relation_estimate_size(Relation rel, int32 *attr_widths, /* it should have storage, so we can call the smgr */ curpages = RelationGetNumberOfBlocks(rel); - /* coerce values in pg_class to more desirable types */ - relpages = (BlockNumber) rel->rd_rel->relpages; - reltuples = (double) rel->rd_rel->reltuples; - relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + /* global temp table get relstats from localhash */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + get_gtt_relstats(RelationGetRelid(rel), + &relpages, &reltuples, &relallvisible, + NULL, NULL); + } + else + { + /* coerce values in pg_class to more desirable types */ + relpages = (BlockNumber) rel->rd_rel->relpages; + reltuples = (double) rel->rd_rel->reltuples; + relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + } /* * HACK: if the relation has never yet been vacuumed, use a minimum size diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 7f4f784..aba8a9f 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6327,6 +6327,10 @@ StartupXLOG(void) else recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID; + /* clean temp relation files */ + if (max_active_gtt > 0) + RemovePgTempFiles(); + /* * Check for signal files, and if so set up state for offline recovery */ diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index d5da81c..c753b0e 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -42,6 +42,7 @@ OBJS = \ pg_subscription.o \ pg_type.o \ storage.o \ + storage_gtt.o \ toasting.o include $(top_srcdir)/src/backend/common.mk diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c index 16cb6d8..f28f2c2 100644 --- a/src/backend/catalog/catalog.c +++ b/src/backend/catalog/catalog.c @@ -398,7 +398,9 @@ GetNewRelFileNode(Oid reltablespace, Relation pg_class, char relpersistence) switch (relpersistence) { + /* global temp table is same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); break; case RELPERSISTENCE_UNLOGGED: diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 0fdff29..54a5243 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -61,6 +61,7 @@ #include "catalog/pg_type.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "commands/tablecmds.h" #include "commands/typecmds.h" #include "executor/executor.h" @@ -99,6 +100,7 @@ static void AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -404,6 +406,10 @@ heap_create(const char *relname, relpersistence, relkind); + /* global temp table not create storage file when catalog create */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + create_storage = false; + /* * Have the storage manager create the relation's disk file, if needed. * @@ -427,7 +433,7 @@ heap_create(const char *relname, case RELKIND_INDEX: case RELKIND_SEQUENCE: - RelationCreateStorage(rel->rd_node, relpersistence); + RelationCreateStorage(rel->rd_node, relpersistence, rel); break; case RELKIND_RELATION: @@ -956,6 +962,7 @@ AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -994,8 +1001,18 @@ AddNewRelationTuple(Relation pg_class_desc, break; } - new_rel_reltup->relfrozenxid = relfrozenxid; - new_rel_reltup->relminmxid = relminmxid; + /* global temp table not remember transaction info in catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + new_rel_reltup->relfrozenxid = InvalidTransactionId; + new_rel_reltup->relminmxid = InvalidMultiXactId; + } + else + { + new_rel_reltup->relfrozenxid = relfrozenxid; + new_rel_reltup->relminmxid = relminmxid; + } + new_rel_reltup->relowner = relowner; new_rel_reltup->reltype = new_type_oid; new_rel_reltup->reloftype = reloftype; @@ -1357,6 +1374,7 @@ heap_create_with_catalog(const char *relname, reloftypeid, ownerid, relkind, + relpersistence, relfrozenxid, relminmxid, PointerGetDatum(relacl), @@ -1441,11 +1459,15 @@ heap_create_with_catalog(const char *relname, */ StoreConstraints(new_rel_desc, cooked_constraints, is_internal); - /* - * If there's a special on-commit action, remember it - */ - if (oncommit != ONCOMMIT_NOOP) - register_on_commit_action(relid, oncommit); + /* global temp table register action when storage init */ + if (relpersistence != RELPERSISTENCE_GLOBAL_TEMP) + { + /* + * If there's a special on-commit action, remember it + */ + if (oncommit != ONCOMMIT_NOOP) + register_on_commit_action(relid, oncommit); + } /* * ok, the relation has been cataloged, so close our relations and return @@ -1937,6 +1959,13 @@ heap_drop_with_catalog(Oid relid) if (relid == defaultPartOid) update_default_partition_oid(parentOid, InvalidOid); + /* We allow to drop global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not drop relation when other backend attached this global temp table"); + } + /* * Schedule unlinking of the relation's physical files at commit. */ @@ -3163,9 +3192,10 @@ RemoveStatistics(Oid relid, AttrNumber attnum) * * The routine will truncate and then reconstruct the indexes on * the specified relation. Caller must hold exclusive lock on rel. + * */ static void -RelationTruncateIndexes(Relation heapRelation) +RelationTruncateIndexes(Relation heapRelation, LOCKMODE lockmode) { ListCell *indlist; @@ -3177,7 +3207,7 @@ RelationTruncateIndexes(Relation heapRelation) IndexInfo *indexInfo; /* Open the index relation; use exclusive lock, just to be sure */ - currentIndex = index_open(indexId, AccessExclusiveLock); + currentIndex = index_open(indexId, lockmode); /* * Fetch info needed for index_build. Since we know there are no @@ -3223,8 +3253,13 @@ heap_truncate(List *relids) { Oid rid = lfirst_oid(cell); Relation rel; + LOCKMODE lockmode = AccessExclusiveLock; - rel = table_open(rid, AccessExclusiveLock); + /* truncate global temp table only need RowExclusiveLock */ + if (get_rel_persistence(rid) == RELPERSISTENCE_GLOBAL_TEMP) + lockmode = RowExclusiveLock; + + rel = table_open(rid, lockmode); relations = lappend(relations, rel); } @@ -3257,6 +3292,8 @@ void heap_truncate_one_rel(Relation rel) { Oid toastrelid; + LOCKMODE lockmode = AccessExclusiveLock; + bool truncate_toastrel = false; /* * Truncate the relation. Partitioned tables have no storage, so there is @@ -3265,23 +3302,40 @@ heap_truncate_one_rel(Relation rel) if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) return; + toastrelid = rel->rd_rel->reltoastrelid; + + /* + * Truncate global temp table only need RowExclusiveLock + */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + lockmode = RowExclusiveLock; + if (OidIsValid(toastrelid) && + gtt_storage_attached(toastrelid)) + truncate_toastrel = true; + } + else if (OidIsValid(toastrelid)) + truncate_toastrel = true; + /* Truncate the underlying relation */ table_relation_nontransactional_truncate(rel); /* If the relation has indexes, truncate the indexes too */ - RelationTruncateIndexes(rel); + RelationTruncateIndexes(rel, lockmode); /* If there is a toast table, truncate that too */ - toastrelid = rel->rd_rel->reltoastrelid; - if (OidIsValid(toastrelid)) + if (truncate_toastrel) { - Relation toastrel = table_open(toastrelid, AccessExclusiveLock); + Relation toastrel = table_open(toastrelid, lockmode); table_relation_nontransactional_truncate(toastrel); - RelationTruncateIndexes(toastrel); + RelationTruncateIndexes(toastrel, lockmode); /* keep the lock... */ table_close(toastrel, NoLock); } + + if (RELATION_IS_GLOBAL_TEMP(rel)) + up_gtt_relstats(rel, 0, 0, 0, RecentXmin, InvalidMultiXactId); } /* diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 3e59e64..9867d6f 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -52,6 +52,7 @@ #include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/event_trigger.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -877,6 +878,26 @@ index_create(Relation heapRelation, indexRelationName, RelationGetRelationName(heapRelation)))); } + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + if (accessMethodObjectId != BTREE_AM_OID) + elog(ERROR, "only support btree index on global temp table"); + + /* We allow to create index on global temp table only this session use it */ + if (is_other_backend_use_gtt(heapRelation->rd_node)) + elog(ERROR, "can not create index when have other backend attached this global temp table"); + + /* No support create index on global temp table use concurrent mode yet */ + if (concurrent) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot create indexes on global temporary tables using concurrent mode"))); + + /* if global temp table not init storage, then skip build index */ + if (!gtt_storage_attached(heapRelation->rd_node.relNode)) + flags |= INDEX_CREATE_SKIP_BUILD; + } + /* * construct tuple descriptor for index tuples */ @@ -2045,6 +2066,13 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) */ CheckTableNotInUse(userIndexRelation, "DROP INDEX"); + /* We allow to drop index on global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(userHeapRelation)) + { + if (is_other_backend_use_gtt(userHeapRelation->rd_node)) + elog(ERROR, "can not drop index when other backend attached this global temp table"); + } + /* * Drop Index Concurrently is more or less the reverse process of Create * Index Concurrently. @@ -2736,20 +2764,29 @@ index_update_stats(Relation rel, else /* don't bother for indexes */ relallvisible = 0; - if (rd_rel->relpages != (int32) relpages) + /* update index stats into localhash for global temp table */ + if (RELATION_IS_GLOBAL_TEMP(rel)) { - rd_rel->relpages = (int32) relpages; - dirty = true; + up_gtt_relstats(rel, relpages, reltuples, relallvisible, + InvalidTransactionId, InvalidMultiXactId); } - if (rd_rel->reltuples != (float4) reltuples) - { - rd_rel->reltuples = (float4) reltuples; - dirty = true; - } - if (rd_rel->relallvisible != (int32) relallvisible) + else { - rd_rel->relallvisible = (int32) relallvisible; - dirty = true; + if (rd_rel->relpages != (int32) relpages) + { + rd_rel->relpages = (int32) relpages; + dirty = true; + } + if (rd_rel->reltuples != (float4) reltuples) + { + rd_rel->reltuples = (float4) reltuples; + dirty = true; + } + if (rd_rel->relallvisible != (int32) relallvisible) + { + rd_rel->relallvisible = (int32) relallvisible; + dirty = true; + } } } @@ -2864,6 +2901,12 @@ index_build(Relation heapRelation, pgstat_progress_update_multi_param(6, index, val); } + if (RELATION_IS_GLOBAL_TEMP(indexRelation)) + { + if (!gtt_storage_attached(indexRelation->rd_node.relNode)) + RelationCreateStorage(indexRelation->rd_node, RELPERSISTENCE_GLOBAL_TEMP, indexRelation); + } + /* * Call the access method's build procedure */ @@ -3196,12 +3239,22 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot) /* * Scan the index and gather up all the TIDs into a tuplesort object. */ + memset(&ivinfo, 0, sizeof(IndexVacuumInfo)); ivinfo.index = indexRelation; ivinfo.analyze_only = false; ivinfo.report_progress = true; ivinfo.estimated_count = true; ivinfo.message_level = DEBUG2; - ivinfo.num_heap_tuples = heapRelation->rd_rel->reltuples; + + /* get relstats abort global temp table from hashtable, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + get_gtt_relstats(RelationGetRelid(heapRelation), + NULL, &ivinfo.num_heap_tuples, NULL, + NULL, NULL); + } + else + ivinfo.num_heap_tuples = heapRelation->rd_rel->reltuples; ivinfo.strategy = NULL; /* @@ -3459,6 +3512,15 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence, errmsg("cannot reindex temporary tables of other sessions"))); /* + * Because global temp table cannot change relfilenode + * no support reindex on global temp table yet. + */ + if (RELATION_IS_GLOBAL_TEMP(iRel)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot reindex global temporary tables"))); + + /* * Also check for active uses of the index in the current transaction; we * don't want to reindex underneath an open indexscan. */ diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index e70243a..301da79 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -647,6 +647,13 @@ RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid) errmsg("cannot create temporary relation in non-temporary schema"))); } break; + /* global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + if (isAnyTempNamespace(nspid)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("cannot create global temp relations in temporary schemas"))); + break; case RELPERSISTENCE_PERMANENT: if (isTempOrTempToastNamespace(nspid)) newRelation->relpersistence = RELPERSISTENCE_TEMP; diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index fddfbf1..03806ae 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -26,6 +26,7 @@ #include "access/xlogutils.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "storage/freespace.h" #include "storage/smgr.h" @@ -73,9 +74,10 @@ static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */ * * This function is transactional. The creation is WAL-logged, and if the * transaction aborts later on, the storage will be destroyed. + * */ SMgrRelation -RelationCreateStorage(RelFileNode rnode, char relpersistence) +RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel) { PendingRelDelete *pending; SMgrRelation srel; @@ -85,6 +87,8 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) switch (relpersistence) { case RELPERSISTENCE_TEMP: + /* global temp table use same storage strategy as local temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); needs_wal = false; break; @@ -117,6 +121,10 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) pending->next = pendingDeletes; pendingDeletes = pending; + /* remember global temp table storage info to localhash */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && rel) + remember_gtt_storage_info(rnode, rel); + return srel; } @@ -486,8 +494,15 @@ smgrDoPendingDeletes(bool isCommit) smgrdounlinkall(srels, nrels, false); for (i = 0; i < nrels; i++) + { smgrclose(srels[i]); + /* clean global temp table flags when transaction commit or rollback */ + if (SmgrIsTemp(srels[i]) && + gtt_storage_attached(srels[i]->smgr_rnode.node.relNode)) + forget_gtt_storage_info(srels[i]->smgr_rnode.node.relNode); + } + pfree(srels); } } diff --git a/src/backend/catalog/storage_gtt.c b/src/backend/catalog/storage_gtt.c new file mode 100644 index 0000000..f489cd3 --- /dev/null +++ b/src/backend/catalog/storage_gtt.c @@ -0,0 +1,1129 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.c + * code to create and destroy physical storage for global temparary table + * + * IDENTIFICATION + * src/backend/catalog/storage_gtt.c + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "access/table.h" +#include "access/visibilitymap.h" +#include "access/xact.h" +#include "access/xlog.h" +#include "access/xloginsert.h" +#include "access/xlogutils.h" +#include "access/htup_details.h" +#include "access/multixact.h" +#include "catalog/storage.h" +#include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" +#include "catalog/heap.h" +#include "catalog/namespace.h" +#include "catalog/pg_type.h" +#include "catalog/pg_statistic.h" +#include "commands/tablecmds.h" +#include "funcapi.h" +#include "nodes/primnodes.h" +#include "nodes/pg_list.h" +#include "nodes/execnodes.h" +#include "miscadmin.h" +#include "storage/freespace.h" +#include "storage/smgr.h" +#include "storage/ipc.h" +#include "storage/proc.h" +#include "storage/procarray.h" +#include "storage/lwlock.h" +#include "storage/shmem.h" +#include "storage/sinvaladt.h" +#include "utils/memutils.h" +#include "utils/rel.h" +#include "utils/hsearch.h" +#include "utils/catcache.h" +#include "utils/lsyscache.h" +#include <utils/relcache.h> +#include "utils/inval.h" +#include "utils/guc.h" + + +/* Copy from bitmapset.c, because gtt used the function in bitmapset.c */ +#define WORDNUM(x) ((x) / BITS_PER_BITMAPWORD) +#define BITNUM(x) ((x) % BITS_PER_BITMAPWORD) + +#define BITMAPSET_SIZE(nwords) \ + (offsetof(Bitmapset, words) + (nwords) * sizeof(bitmapword)) + +static bool gtt_cleaner_exit_registered = false; +static HTAB *gtt_storage_local_hash = NULL; +static HTAB *active_gtt_shared_hash = NULL; +static MemoryContext gtt_relstats_context = NULL; + +/* relfrozenxid of all gtts in the current session */ +static List *gtt_session_relfrozenxid_list = NIL; +static TransactionId gtt_session_frozenxid = InvalidTransactionId; + +typedef struct gtt_ctl_data +{ + LWLock lock; + int max_entry; + int entry_size; +}gtt_ctl_data; + +static gtt_ctl_data *gtt_shared_ctl = NULL; + +typedef struct +{ + RelFileNode rnode; + Bitmapset *map; + /* bitmap data */ +} gtt_shared_hash_entry; + +typedef struct +{ + Oid relid; + + Oid spcnode; + /* pg_class stat */ + int32 relpages; + float4 reltuples; + int32 relallvisible; + TransactionId relfrozenxid; + TransactionId relminmxid; + char relkind; + bool on_commit_delete; + + /* pg_statistic */ + int natts; + int *attnum; + HeapTuple *att_stat_tups; +} gtt_local_hash_entry; + +static Size action_gtt_shared_hash_entry_size(void); +static void gtt_storage_checkin(RelFileNode rnode); +static void gtt_storage_checkout(RelFileNode rnode, bool skiplock); +static void gtt_storage_removeall(int code, Datum arg); +static void insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid); +static void remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid); +static void set_gtt_session_relfrozenxid(void); + +Datum pg_get_gtt_statistics(PG_FUNCTION_ARGS); +Datum pg_get_gtt_relstats(PG_FUNCTION_ARGS); +Datum pg_gtt_attached_pid(PG_FUNCTION_ARGS); +Datum pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS); + + +static Size +action_gtt_shared_hash_entry_size(void) +{ + int wordnum; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + wordnum = WORDNUM(MaxBackends + 1); + hash_entry_size += MAXALIGN(sizeof(gtt_shared_hash_entry)); + hash_entry_size += MAXALIGN(BITMAPSET_SIZE(wordnum + 1)); + + return hash_entry_size; +} + +Size +active_gtt_shared_hash_size(void) +{ + Size size = 0; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + size = MAXALIGN(sizeof(gtt_ctl_data)); + hash_entry_size = action_gtt_shared_hash_entry_size(); + size += hash_estimate_size(max_active_gtt, hash_entry_size); + + return size; +} + +void +active_gtt_shared_hash_init(void) +{ + HASHCTL info; + bool found; + + if (max_active_gtt <= 0) + return; + + gtt_shared_ctl = + ShmemInitStruct("gtt_shared_ctl", + sizeof(gtt_ctl_data), + &found); + + if (!found) + { + LWLockRegisterTranche(LWTRANCHE_GTT_CTL, "gtt_shared_ctl"); + LWLockInitialize(>t_shared_ctl->lock, LWTRANCHE_GTT_CTL); + gtt_shared_ctl->max_entry = max_active_gtt; + gtt_shared_ctl->entry_size = action_gtt_shared_hash_entry_size(); + } + + info.keysize = sizeof(RelFileNode); + info.entrysize = gtt_shared_ctl->entry_size; + active_gtt_shared_hash = + ShmemInitHash("active gtt shared hash", + gtt_shared_ctl->max_entry, + gtt_shared_ctl->max_entry, + &info, HASH_ELEM | HASH_BLOBS | HASH_FIXED_SIZE); +} + +static void +gtt_storage_checkin(RelFileNode rnode) +{ + gtt_shared_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + entry = (gtt_shared_hash_entry *) hash_search(active_gtt_shared_hash, + &rnode, HASH_ENTER_NULL, &found); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of shared memory"), + errhint("You might need to increase max_active_gtt."))); + } + + if (found == false) + { + int wordnum; + + entry->map = (Bitmapset *)((char *)entry + MAXALIGN(sizeof(gtt_shared_hash_entry))); + wordnum = WORDNUM(MaxBackends + 1); + memset(entry->map, 0, BITMAPSET_SIZE(wordnum + 1)); + entry->map->nwords = wordnum + 1; + } + + bms_add_member(entry->map, MyBackendId); + LWLockRelease(>t_shared_ctl->lock); +} + +static void +gtt_storage_checkout(RelFileNode rnode, bool skiplock) +{ + gtt_shared_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (!skiplock) + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + + entry = hash_search(active_gtt_shared_hash, + (void *) &(rnode), HASH_FIND, NULL); + + if (entry == NULL) + { + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + elog(WARNING, "relfilenode %u/%u/%u not exist in gtt shared hash when forget", + rnode.dbNode, rnode.spcNode, rnode.relNode); + return; + } + + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + bms_del_member(entry->map, MyBackendId); + + if (bms_is_empty(entry->map)) + { + if (!hash_search(active_gtt_shared_hash, &rnode, HASH_REMOVE, NULL)) + elog(PANIC, "gtt shared hash table corrupted"); + } + + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + return; +} + +Bitmapset * +copy_active_gtt_bitmap(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + Bitmapset *map_copy = NULL; + + if (max_active_gtt <= 0) + return NULL; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return NULL; + } + + Assert(entry->map); + if (!bms_is_empty(entry->map)) + map_copy = bms_copy(entry->map); + + LWLockRelease(>t_shared_ctl->lock); + + return map_copy; +} + +bool +is_other_backend_use_gtt(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + bool in_use = false; + int num_use = 0; + + if (max_active_gtt <= 0) + return false; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return false; + } + + Assert(entry->map); + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + + num_use = bms_num_members(entry->map); + if (num_use == 0) + in_use = false; + else if (num_use == 1) + { + if(bms_is_member(MyBackendId, entry->map)) + in_use = false; + else + in_use = true; + } + else + in_use = true; + + LWLockRelease(>t_shared_ctl->lock); + + return in_use; +} + +void +remember_gtt_storage_info(RelFileNode rnode, Relation rel) +{ + gtt_local_hash_entry *entry; + MemoryContext oldcontext; + Oid relid = rnode.relNode; + bool found; + + if (max_active_gtt <= 0) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Global temporary table feature is disable"), + errhint("You might need to increase max_active_gtt to enable this feature."))); + + if (RecoveryInProgress()) + elog(ERROR, "readonly mode not support access global temp table yet"); + + if (gtt_storage_local_hash == NULL) + { +#define GTT_LOCAL_HASH_SIZE 1024 + /* First time through: initialize the hash table */ + HASHCTL ctl; + + MemSet(&ctl, 0, sizeof(ctl)); + ctl.keysize = sizeof(Oid); + ctl.entrysize = sizeof(gtt_local_hash_entry); + gtt_storage_local_hash = + hash_create("global temp relation table", + GTT_LOCAL_HASH_SIZE, + &ctl, HASH_ELEM | HASH_BLOBS); + + if (!CacheMemoryContext) + CreateCacheMemoryContext(); + + gtt_relstats_context = + AllocSetContextCreate(CacheMemoryContext, + "gtt relstats context", + ALLOCSET_DEFAULT_SIZES); + } + + /* Look up or create an entry */ + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_ENTER, &found); + + if (found) + { + elog(ERROR, "backend %d relid %u already exists in global temp table local hash", + MyBackendId, relid); + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + + entry->spcnode = rnode.spcNode; + entry->relpages = 0; + entry->reltuples = 0; + entry->relallvisible = 0; + entry->relkind = rel->rd_rel->relkind; + /* only heap contain transaction information */ + if (entry->relkind == RELKIND_RELATION || entry->relkind == RELKIND_PARTITIONED_TABLE) + { + int natts = RelationGetNumberOfAttributes(rel); + entry->natts = natts; + entry->attnum = palloc0(sizeof(int) * natts); + entry->att_stat_tups = palloc0(sizeof(HeapTuple) * natts); + + if (RELATION_GTT_ON_COMMIT_DELETE(rel)) + { + entry->on_commit_delete = true; + register_on_commit_action(rel->rd_node.relNode, ONCOMMIT_DELETE_ROWS); + } + + entry->relfrozenxid = RecentXmin; + entry->relminmxid = GetOldestMultiXactId(); + insert_gtt_relfrozenxid_to_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + gtt_storage_checkin(rnode); + } + else + { + entry->natts = 0; + entry->attnum = 0; + entry->att_stat_tups = NULL; + entry->on_commit_delete = false; + entry->relfrozenxid = 0; + entry->relminmxid = 0; + } + + MemoryContextSwitchTo(oldcontext); + + if (!gtt_cleaner_exit_registered) + { + before_shmem_exit(gtt_storage_removeall, 0); + gtt_cleaner_exit_registered = true; + } + + return; +} + +void +forget_gtt_storage_info(Oid relid) +{ + gtt_local_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, NULL); + + if (entry && entry->relkind == RELKIND_RELATION) + { + RelFileNode rnode; + int i; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + gtt_storage_checkout(rnode, false); + + Assert(TransactionIdIsNormal(entry->relfrozenxid)); + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + + for (i = 0; i < entry->natts; i++) + { + if (entry->att_stat_tups[i]) + { + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + } + } + } + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_REMOVE, NULL); + + return; +} + +/* is the storage file was created in this backend */ +bool +gtt_storage_attached(Oid relid) +{ + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, &found); + + return found; +} + +static void +gtt_storage_removeall(int code, Datum arg) +{ + HASH_SEQ_STATUS status; + gtt_local_hash_entry *entry; + int nrels = 0, + maxrels = 0; + SMgrRelation *srels = NULL; + RelFileNode *rnodes = NULL; + char *relkinds = NULL; + + if (gtt_storage_local_hash == NULL) + return; + + hash_seq_init(&status, gtt_storage_local_hash); + while ((entry = (gtt_local_hash_entry *) hash_seq_search(&status)) != NULL) + { + SMgrRelation srel; + RelFileNode rnode; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + srel = smgropen(rnode, MyBackendId); + + /* allocate the initial array, or extend it, if needed */ + if (maxrels == 0) + { + maxrels = 32; + srels = palloc(sizeof(SMgrRelation) * maxrels); + rnodes = palloc(sizeof(RelFileNode) * maxrels); + relkinds = palloc(sizeof(char) * maxrels); + } + else if (maxrels <= nrels) + { + maxrels *= 2; + srels = repalloc(srels, sizeof(SMgrRelation) * maxrels); + rnodes = repalloc(rnodes, sizeof(RelFileNode) * maxrels); + relkinds = repalloc(relkinds, sizeof(char) * maxrels); + } + + srels[nrels] = srel; + rnodes[nrels] = rnode; + relkinds[nrels] = entry->relkind; + nrels++; + } + + if (nrels > 0) + { + int i; + + smgrdounlinkall(srels, nrels, false); + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + for (i = 0; i < nrels; i++) + { + smgrclose(srels[i]); + if (relkinds[i] == RELKIND_RELATION) + gtt_storage_checkout(rnodes[i], true); + } + LWLockRelease(>t_shared_ctl->lock); + + pfree(srels); + pfree(rnodes); + pfree(relkinds); + } + + MyProc->session_gtt_frozenxid = InvalidTransactionId; + + return; +} + +/* + * Update global temp table relstats(relpage/reltuple/relallvisible) + * to local hashtable + */ +void +up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid) +{ + Oid relid = RelationGetRelid(relation); + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return; + + Assert(entry->spcnode); + + if (num_pages >= 0 && + entry->relpages != (int32)num_pages) + entry->relpages = (int32)num_pages; + + if (num_tuples >= 0 && + num_tuples != (float4)entry->reltuples) + entry->reltuples = (float4)num_tuples; + + /* only heap contain transaction information and relallvisible */ + if (entry->relkind == RELKIND_RELATION) + { + if (entry->relallvisible >= 0 && + entry->relallvisible != (int32)num_all_visible_pages) + { + entry->relallvisible = (int32)num_all_visible_pages; + } + + if (TransactionIdIsNormal(relfrozenxid) && + entry->relfrozenxid != relfrozenxid && + (TransactionIdPrecedes(entry->relfrozenxid, relfrozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), entry->relfrozenxid))) + { + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + entry->relfrozenxid = relfrozenxid; + insert_gtt_relfrozenxid_to_ordered_list(relfrozenxid); + set_gtt_session_relfrozenxid(); + } + + if (MultiXactIdIsValid(relminmxid) && + entry->relminmxid != relminmxid && + (MultiXactIdPrecedes(entry->relminmxid, relminmxid) || + MultiXactIdPrecedes(ReadNextMultiXactId(), entry->relminmxid))) + { + entry->relminmxid = relminmxid; + } + } + + return; +} + +/* + * Search global temp table relstats(relpage/reltuple/relallvisible) + * from local hashtable. + */ +bool +get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid) +{ + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return false; + + Assert(entry->relid == relid); + + if (relpages) + *relpages = entry->relpages; + + if (reltuples) + *reltuples = entry->reltuples; + + if (relallvisible) + *relallvisible = entry->relallvisible; + + if (relfrozenxid) + *relfrozenxid = entry->relfrozenxid; + + if (relminmxid) + *relminmxid = entry->relminmxid; + + return true; +} + +/* + * Update global temp table statistic info(definition is same as pg_statistic) + * to local hashtable where ananyze global temp table + */ +void +up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull) +{ + gtt_local_hash_entry *entry; + bool found; + MemoryContext oldcontext; + int i = 0; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return; + + if (entry->relkind != RELKIND_RELATION) + { + elog(WARNING, "oid %u not a relation", reloid); + return; + } + + /* todo */ + if (entry->natts < natts) + { + elog(WARNING, "reloid %u not support update attstat after add colunm", reloid); + return; + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + Assert(entry->relid == reloid); + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == 0) + { + entry->attnum[i] = attnum; + break; + } + else if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + break; + } + } + + Assert(i < entry->natts); + Assert(entry->att_stat_tups[i] == NULL); + entry->att_stat_tups[i] = heap_form_tuple(tupleDescriptor, values, isnull); + MemoryContextSwitchTo(oldcontext); + + return; +} + +/* + * Search global temp table statistic info(definition is same as pg_statistic) + * from local hashtable. + */ +HeapTuple +get_gtt_att_statistic(Oid reloid, int attnum, bool inh) +{ + gtt_local_hash_entry *entry; + bool found; + int i = 0; + + if (max_active_gtt <= 0) + return NULL; + + if (gtt_storage_local_hash == NULL) + return NULL; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return NULL; + + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + return entry->att_stat_tups[i]; + } + } + + return NULL; +} + +void +release_gtt_statistic_cache(HeapTuple tup) +{ + /* do nothing */ + return; +} + +static void +insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid) +{ + MemoryContext oldcontext; + ListCell *cell; + int i; + + Assert(TransactionIdIsNormal(relfrozenxid)); + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + /* Does the datum belong at the front? */ + if (gtt_session_relfrozenxid_list == NIL || + TransactionIdFollowsOrEquals(relfrozenxid, + linitial_oid(gtt_session_relfrozenxid_list))) + { + gtt_session_relfrozenxid_list = + lcons_oid(relfrozenxid, gtt_session_relfrozenxid_list); + MemoryContextSwitchTo(oldcontext); + + return; + } + + /* No, so find the entry it belongs after */ + i = 0; + foreach (cell, gtt_session_relfrozenxid_list) + { + if (TransactionIdFollowsOrEquals(relfrozenxid, lfirst_oid(cell))) + break; + + i++; + } + gtt_session_relfrozenxid_list = + list_insert_nth_oid(gtt_session_relfrozenxid_list, i, relfrozenxid); + MemoryContextSwitchTo(oldcontext); + + return; +} + +static void +remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid) +{ + gtt_session_relfrozenxid_list = + list_delete_oid(gtt_session_relfrozenxid_list, relfrozenxid); +} + +static void +set_gtt_session_relfrozenxid(void) +{ + TransactionId gtt_frozenxid = InvalidTransactionId; + + if (gtt_session_relfrozenxid_list) + gtt_frozenxid = llast_oid(gtt_session_relfrozenxid_list); + + gtt_session_frozenxid = gtt_frozenxid; + if (MyProc->session_gtt_frozenxid != gtt_frozenxid) + MyProc->session_gtt_frozenxid = gtt_frozenxid; +} + +Datum +pg_get_gtt_statistics(PG_FUNCTION_ARGS) +{ + HeapTuple tuple; + Relation rel = NULL; + int attnum = PG_GETARG_INT32(1); + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + MemoryContext oldcontext; + Tuplestorestate *tupstore; + Relation pg_tatistic = NULL; + TupleDesc sd; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not " \ + "allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + pg_tatistic = table_open(StatisticRelationId, AccessShareLock); + sd = RelationGetDescr(pg_tatistic); + + tuple = get_gtt_att_statistic(reloid, attnum, false); + if (tuple) + { + Datum values[31]; + bool isnull[31]; + HeapTuple res = NULL; + + memset(&values, 0, sizeof(values)); + memset(&isnull, 0, sizeof(isnull)); + heap_deform_tuple(tuple, sd, values, isnull); + res = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, res); + } + + table_close(rel, NoLock); + table_close(pg_tatistic, AccessShareLock); + tuplestore_donestoring(tupstore); + + return (Datum) 0; +} + +Datum +pg_get_gtt_relstats(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + uint32 relfrozenxid = 0; + uint32 relminmxid = 0; + Relation rel = NULL; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + if (get_gtt_relstats(reloid, + &relpages, &reltuples, &relallvisible, + &relfrozenxid, &relminmxid)) + { + Datum values[5]; + bool isnull[5]; + + memset(isnull, 0, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(relpages); + values[1] = Float4GetDatum((float4)reltuples); + values[2] = Int32GetDatum(relallvisible); + values[3] = UInt32GetDatum(relfrozenxid); + values[4] = UInt32GetDatum(relminmxid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_gtt_attached_pid(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + Relation rel = NULL; + PGPROC *proc = NULL; + Bitmapset *map = NULL; + pid_t pid = 0; + int backendid = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + map = copy_active_gtt_bitmap(rel->rd_node); + if (map) + { + backendid = bms_first_member(map); + + do + { + proc = BackendIdGetProc(backendid); + pid = proc->pid; + if (pid > 0) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = UInt32GetDatum(reloid); + values[1] = Int32GetDatum(pid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + backendid = bms_next_member(map, backendid); + } while (backendid > 0); + + pfree(map); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + int num_xid = MaxBackends + 1; + int *pids = NULL; + uint32 *xids = NULL; + int i = 0; + int j = 0; + uint32 oldest = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + if (max_active_gtt <= 0) + return (Datum) 0; + + if (RecoveryInProgress()) + return (Datum) 0; + + pids = palloc0(sizeof(int) * num_xid); + xids = palloc0(sizeof(int) * num_xid); + oldest = list_all_session_gtt_frozenxids(num_xid, pids, xids, &i); + if (i > 0) + { + if (i > 0) + { + pids[i] = 0; + xids[i] = oldest; + i++; + } + + for(j = 0; j < i; j++) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(pids[j]); + values[1] = UInt32GetDatum(xids[j]); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + } + tuplestore_donestoring(tupstore); + pfree(pids); + pfree(xids); + + return (Datum) 0; +} + diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index c9e75f4..2adde62 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -186,6 +186,91 @@ CREATE OR REPLACE VIEW pg_sequences AS WHERE NOT pg_is_other_temp_schema(N.oid) AND relkind = 'S'; +-- For global temporary table +CREATE VIEW pg_gtt_relstats WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_relstats(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_attached_pids WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_gtt_attached_pid(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_stats WITH (security_barrier) AS +SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN s.stakind1 = 1 THEN s.stavalues1 + WHEN s.stakind2 = 1 THEN s.stavalues2 + WHEN s.stakind3 = 1 THEN s.stavalues3 + WHEN s.stakind4 = 1 THEN s.stavalues4 + WHEN s.stakind5 = 1 THEN s.stavalues5 + END AS most_common_vals, + CASE + WHEN s.stakind1 = 1 THEN s.stanumbers1 + WHEN s.stakind2 = 1 THEN s.stanumbers2 + WHEN s.stakind3 = 1 THEN s.stanumbers3 + WHEN s.stakind4 = 1 THEN s.stanumbers4 + WHEN s.stakind5 = 1 THEN s.stanumbers5 + END AS most_common_freqs, + CASE + WHEN s.stakind1 = 2 THEN s.stavalues1 + WHEN s.stakind2 = 2 THEN s.stavalues2 + WHEN s.stakind3 = 2 THEN s.stavalues3 + WHEN s.stakind4 = 2 THEN s.stavalues4 + WHEN s.stakind5 = 2 THEN s.stavalues5 + END AS histogram_bounds, + CASE + WHEN s.stakind1 = 3 THEN s.stanumbers1[1] + WHEN s.stakind2 = 3 THEN s.stanumbers2[1] + WHEN s.stakind3 = 3 THEN s.stanumbers3[1] + WHEN s.stakind4 = 3 THEN s.stanumbers4[1] + WHEN s.stakind5 = 3 THEN s.stanumbers5[1] + END AS correlation, + CASE + WHEN s.stakind1 = 4 THEN s.stavalues1 + WHEN s.stakind2 = 4 THEN s.stavalues2 + WHEN s.stakind3 = 4 THEN s.stavalues3 + WHEN s.stakind4 = 4 THEN s.stavalues4 + WHEN s.stakind5 = 4 THEN s.stavalues5 + END AS most_common_elems, + CASE + WHEN s.stakind1 = 4 THEN s.stanumbers1 + WHEN s.stakind2 = 4 THEN s.stanumbers2 + WHEN s.stakind3 = 4 THEN s.stanumbers3 + WHEN s.stakind4 = 4 THEN s.stanumbers4 + WHEN s.stakind5 = 4 THEN s.stanumbers5 + END AS most_common_elem_freqs, + CASE + WHEN s.stakind1 = 5 THEN s.stanumbers1 + WHEN s.stakind2 = 5 THEN s.stanumbers2 + WHEN s.stakind3 = 5 THEN s.stanumbers3 + WHEN s.stakind4 = 5 THEN s.stanumbers4 + WHEN s.stakind5 = 5 THEN s.stanumbers5 + END AS elem_count_histogram + FROM + pg_class c + JOIN pg_attribute a ON c.oid = a.attrelid + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_statistics(c.oid, a.attnum, ''::text) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') and NOT a.attisdropped AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + CREATE VIEW pg_stats WITH (security_barrier) AS SELECT nspname AS schemaname, diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index c4420dd..a789718 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -66,6 +66,7 @@ #include "utils/syscache.h" #include "utils/timestamp.h" +#include "catalog/storage_gtt.h" /* Per-index data for ANALYZE */ typedef struct AnlIndexData @@ -103,7 +104,7 @@ static int acquire_inherited_sample_rows(Relation onerel, int elevel, HeapTuple *rows, int targrows, double *totalrows, double *totaldeadrows); static void update_attstats(Oid relid, bool inh, - int natts, VacAttrStats **vacattrstats); + int natts, VacAttrStats **vacattrstats, char relpersistence); static Datum std_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); @@ -586,14 +587,15 @@ do_analyze_rel(Relation onerel, VacuumParams *params, * pg_statistic for columns we didn't process, we leave them alone.) */ update_attstats(RelationGetRelid(onerel), inh, - attr_cnt, vacattrstats); + attr_cnt, vacattrstats, RelationGetRelPersistence(onerel)); for (ind = 0; ind < nindexes; ind++) { AnlIndexData *thisdata = &indexdata[ind]; update_attstats(RelationGetRelid(Irel[ind]), false, - thisdata->attr_cnt, thisdata->vacattrstats); + thisdata->attr_cnt, thisdata->vacattrstats, + RelationGetRelPersistence(Irel[ind])); } /* @@ -673,11 +675,20 @@ do_analyze_rel(Relation onerel, VacuumParams *params, IndexBulkDeleteResult *stats; IndexVacuumInfo ivinfo; + memset(&ivinfo, 0, sizeof(IndexVacuumInfo)); ivinfo.index = Irel[ind]; ivinfo.analyze_only = true; ivinfo.estimated_count = true; ivinfo.message_level = elevel; - ivinfo.num_heap_tuples = onerel->rd_rel->reltuples; + /* get global temp relstats from localhash, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(onerel)) + { + get_gtt_relstats(RelationGetRelid(onerel), + NULL, &ivinfo.num_heap_tuples, NULL, + NULL, NULL); + } + else + ivinfo.num_heap_tuples = onerel->rd_rel->reltuples; ivinfo.strategy = vac_strategy; stats = index_vacuum_cleanup(&ivinfo, NULL); @@ -1456,7 +1467,7 @@ acquire_inherited_sample_rows(Relation onerel, int elevel, * by taking a self-exclusive lock on the relation in analyze_rel(). */ static void -update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) +update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats, char relpersistence) { Relation sd; int attno; @@ -1558,31 +1569,45 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) } } - /* Is there already a pg_statistic tuple for this attribute? */ - oldtup = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(relid), - Int16GetDatum(stats->attr->attnum), - BoolGetDatum(inh)); - - if (HeapTupleIsValid(oldtup)) + /* Update column statistic to localhash, not catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { - /* Yes, replace it */ - stup = heap_modify_tuple(oldtup, - RelationGetDescr(sd), - values, - nulls, - replaces); - ReleaseSysCache(oldtup); - CatalogTupleUpdate(sd, &stup->t_self, stup); + up_gtt_att_statistic(relid, + stats->attr->attnum, + inh, + natts, + RelationGetDescr(sd), + values, + nulls); } else { - /* No, insert new tuple */ - stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); - CatalogTupleInsert(sd, stup); - } + /* Is there already a pg_statistic tuple for this attribute? */ + oldtup = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(relid), + Int16GetDatum(stats->attr->attnum), + BoolGetDatum(inh)); + + if (HeapTupleIsValid(oldtup)) + { + /* Yes, replace it */ + stup = heap_modify_tuple(oldtup, + RelationGetDescr(sd), + values, + nulls, + replaces); + ReleaseSysCache(oldtup); + CatalogTupleUpdate(sd, &stup->t_self, stup); + } + else + { + /* No, insert new tuple */ + stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); + CatalogTupleInsert(sd, stup); + } - heap_freetuple(stup); + heap_freetuple(stup); + } } table_close(sd, RowExclusiveLock); diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index e9d7a7f..3088e26 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -391,6 +391,12 @@ cluster_rel(Oid tableOid, Oid indexOid, int options) errmsg("cannot vacuum temporary tables of other sessions"))); } + /* not support cluster global temp table yet */ + if (RELATION_IS_GLOBAL_TEMP(OldHeap)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("not support cluster global temporary tables yet"))); + /* * Also check for active uses of the relation in the current transaction, * including open scans and pending AFTER trigger events. diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 52ce02f..3d3f7dc 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2583,6 +2583,16 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind, !isTempNamespace(classtuple->relnamespace)) continue; + /* not support reindex on global temp table, so skip it */ + if (classtuple->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + ereport(WARNING, + (errmsg("global temp table \"%s.%s\" skip reindexed", + get_namespace_name(get_rel_namespace(relid)), + get_rel_name(relid)))); + continue; + } + /* Check user/system classification, and optionally skip */ if (objectKind == REINDEX_OBJECT_SYSTEM && !IsSystemClass(relid, classtuple)) diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c index 329ab84..dfa257c 100644 --- a/src/backend/commands/lockcmds.c +++ b/src/backend/commands/lockcmds.c @@ -96,7 +96,8 @@ RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, * transaction. */ relpersistence = get_rel_persistence(relid); - if (relpersistence == RELPERSISTENCE_TEMP) + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPNAMESPACE; /* Check permissions. */ diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 6aab73b..44f350d 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -94,7 +94,7 @@ static HTAB *seqhashtab = NULL; /* hash table for SeqTable items */ */ static SeqTableData *last_used_seq = NULL; -static void fill_seq_with_data(Relation rel, HeapTuple tuple); +static void fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf); static Relation lock_and_open_sequence(SeqTable seq); static void create_seq_hashtable(void); static void init_sequence(Oid relid, SeqTable *p_elm, Relation *p_rel); @@ -108,6 +108,7 @@ static void init_params(ParseState *pstate, List *options, bool for_identity, List **owned_by); static void do_setval(Oid relid, int64 next, bool iscalled); static void process_owned_by(Relation seqrel, List *owned_by, bool for_identity); +int64 get_seqence_start_value(Oid seqid); /* @@ -222,7 +223,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq) /* now initialize the sequence's data */ tuple = heap_form_tuple(tupDesc, value, null); - fill_seq_with_data(rel, tuple); + fill_seq_with_data(rel, tuple, InvalidBuffer); /* process OWNED BY if given */ if (owned_by) @@ -327,7 +328,7 @@ ResetSequence(Oid seq_relid) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seq_rel, tuple); + fill_seq_with_data(seq_rel, tuple, InvalidBuffer); /* Clear local cache so that we don't think we have cached numbers */ /* Note that we do not change the currval() state */ @@ -340,17 +341,21 @@ ResetSequence(Oid seq_relid) * Initialize a sequence's relation with the specified tuple as content */ static void -fill_seq_with_data(Relation rel, HeapTuple tuple) +fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf) { - Buffer buf; Page page; sequence_magic *sm; OffsetNumber offnum; + bool lockBuffer = false; /* Initialize first page of relation with special magic number */ - buf = ReadBuffer(rel, P_NEW); - Assert(BufferGetBlockNumber(buf) == 0); + if (buf == InvalidBuffer) + { + buf = ReadBuffer(rel, P_NEW); + Assert(BufferGetBlockNumber(buf) == 0); + lockBuffer = true; + } page = BufferGetPage(buf); @@ -360,7 +365,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) /* Now insert sequence tuple */ - LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); + if (lockBuffer) + LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); /* * Since VACUUM does not process sequences, we have to force the tuple to @@ -410,7 +416,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) END_CRIT_SECTION(); - UnlockReleaseBuffer(buf); + if (lockBuffer) + UnlockReleaseBuffer(buf); } /* @@ -502,7 +509,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seqrel, newdatatuple); + fill_seq_with_data(seqrel, newdatatuple, InvalidBuffer); } /* process OWNED BY if given */ @@ -1178,6 +1185,25 @@ read_seq_tuple(Relation rel, Buffer *buf, HeapTuple seqdatatuple) LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); page = BufferGetPage(*buf); + if (GlobalTempRelationPageIsNotInitialized(rel, page)) + { + /* Initialize sequence for global temporary tables */ + Datum value[SEQ_COL_LASTCOL] = {0}; + bool null[SEQ_COL_LASTCOL] = {false}; + HeapTuple tuple; + int64 startv = get_seqence_start_value(RelationGetRelid(rel)); + + /* + * last_value from pg_sequence.seqstart + * log_cnt = 0 + * is_called = false + */ + value[SEQ_COL_LASTVAL-1] = Int64GetDatumFast(startv); /* start sequence with 1 */ + + tuple = heap_form_tuple(RelationGetDescr(rel), value, null); + fill_seq_with_data(rel, tuple, *buf); + heap_freetuple(tuple); + } sm = (sequence_magic *) PageGetSpecialPointer(page); if (sm->magic != SEQ_MAGIC) @@ -1954,3 +1980,23 @@ seq_mask(char *page, BlockNumber blkno) mask_unused_space(page); } + +int64 +get_seqence_start_value(Oid seqid) +{ + HeapTuple seqtuple; + Form_pg_sequence seqform; + int64 start; + + seqtuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(seqid)); + if (!HeapTupleIsValid(seqtuple)) + elog(ERROR, "cache lookup failed for sequence %u", + seqid); + + seqform = (Form_pg_sequence) GETSTRUCT(seqtuple); + start = seqform->seqstart; + ReleaseSysCache(seqtuple); + + return start; +} + diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 30b72b6..6db8c31 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -47,6 +47,7 @@ #include "catalog/storage.h" #include "catalog/storage_xlog.h" #include "catalog/toasting.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/comment.h" #include "commands/defrem.h" @@ -552,6 +553,7 @@ static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTbl); static List *GetParentedForeignKeyRefs(Relation partition); static void ATDetachCheckNoForeignKeyRefs(Relation partition); +static bool has_oncommit_option(List *options); /* ---------------------------------------------------------------- @@ -597,6 +599,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, LOCKMODE parentLockmode; const char *accessMethod = NULL; Oid accessMethodId = InvalidOid; + bool has_oncommit_clause = false; /* * Truncate relname to appropriate length (probably a waste of time, as @@ -607,8 +610,10 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Check consistency of arguments */ + /* global temp table same as local temp table */ if (stmt->oncommit != ONCOMMIT_NOOP - && stmt->relation->relpersistence != RELPERSISTENCE_TEMP) + && !(stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("ON COMMIT can only be used on temporary tables"))); @@ -638,7 +643,9 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, * code. This is needed because calling code might not expect untrusted * tables to appear in pg_temp at the front of its search path. */ - if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP + /* global temp table same as local temp table */ + if ((stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) && InSecurityRestrictedOperation()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -739,6 +746,57 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Parse and validate reloptions, if any. */ + /* global temp table */ + has_oncommit_clause = has_oncommit_option(stmt->options); + if (stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (relkind == RELKIND_RELATION || relkind == RELKIND_PARTITIONED_TABLE)) + { + /* inherit table or parition table inherit on commit property from parent table*/ + if (inheritOids && stmt->oncommit == ONCOMMIT_NOOP && !has_oncommit_clause) + { + Oid parent = linitial_oid(inheritOids); + Relation relation = table_open(parent, NoLock); + + if (!RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "The parent table must be global temporary table"); + + if (RELATION_GTT_ON_COMMIT_DELETE(relation)) + stmt->oncommit = ONCOMMIT_DELETE_ROWS; + else + stmt->oncommit = ONCOMMIT_PRESERVE_ROWS; + table_close(relation, NoLock); + } + + if (has_oncommit_clause) + { + if (stmt->oncommit != ONCOMMIT_NOOP) + elog(ERROR, "can not defeine global temp table with on commit and with clause at same time"); + } + else + { + DefElem *opt = makeNode(DefElem); + + opt->type = T_DefElem; + opt->defnamespace = NULL; + opt->defname = "on_commit_delete_rows"; + opt->defaction = DEFELEM_UNSPEC; + + /* use reloptions to remember on commit clause */ + if (stmt->oncommit == ONCOMMIT_DELETE_ROWS) + opt->arg = (Node *)makeString("true"); + else if (stmt->oncommit == ONCOMMIT_PRESERVE_ROWS) + opt->arg = (Node *)makeString("false"); + else if (stmt->oncommit == ONCOMMIT_NOOP) + opt->arg = (Node *)makeString("true"); + else + elog(ERROR, "global temp table not support on commit drop clause"); + + stmt->options = lappend(stmt->options, opt); + } + } + else if (has_oncommit_clause) + elog(ERROR, "regular table cannot specifie on_commit_delete_rows"); + reloptions = transformRelOptions((Datum) 0, stmt->options, NULL, validnsps, true, false); @@ -1800,7 +1858,8 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged, * table or the current physical file to be thrown away anyway. */ if (rel->rd_createSubid == mySubid || - rel->rd_newRelfilenodeSubid == mySubid) + rel->rd_newRelfilenodeSubid == mySubid || + RELATION_IS_GLOBAL_TEMP(rel)) { /* Immediate, non-rollbackable truncation is OK */ heap_truncate_one_rel(rel); @@ -3359,6 +3418,13 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo * specially. */ targetrelation = relation_open(myrelid, is_index ? ShareUpdateExclusiveLock : AccessExclusiveLock); + + if (RELATION_IS_GLOBAL_TEMP(targetrelation)) + { + if (is_other_backend_use_gtt(targetrelation->rd_node)) + elog(ERROR, "can not rename relation when other backend attached this global temp table"); + } + namespaceId = RelationGetNamespace(targetrelation); /* @@ -3534,6 +3600,13 @@ AlterTable(AlterTableStmt *stmt, LOCKMODE lockmode, /* Caller is required to provide an adequate lock. */ rel = relation_open(context->relid, NoLock); + /* We allow to alter global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not alter relation when other backend attached this global temp table"); + } + CheckTableNotInUse(rel, "ALTER TABLE"); ATController(stmt, rel, stmt->cmds, stmt->relation->inh, lockmode, context); @@ -8099,6 +8172,13 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, errmsg("referenced relation \"%s\" is not a table", RelationGetRelationName(pkrel)))); + /* global temp table not support foreign key constraint yet */ + if (RELATION_IS_GLOBAL_TEMP(pkrel)) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("referenced relation \"%s\" is not a global temp table", + RelationGetRelationName(pkrel)))); + if (!allowSystemTableMods && IsSystemRelation(pkrel)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -8138,6 +8218,12 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("constraints on temporary tables must involve temporary tables of this session"))); break; + /* global temp table not support foreign key constraint yet */ + case RELPERSISTENCE_GLOBAL_TEMP: + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("not support foreign key constraints on global temp table yet"))); + break; } /* @@ -13174,7 +13260,7 @@ index_copy_data(Relation rel, RelFileNode newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, @@ -14581,7 +14667,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged) */ switch (rel->rd_rel->relpersistence) { + /* global temp table same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("cannot change logged status of table \"%s\" because it is temporary", @@ -17221,3 +17309,20 @@ ATDetachCheckNoForeignKeyRefs(Relation partition) table_close(rel, NoLock); } } + +static bool +has_oncommit_option(List *options) +{ + ListCell *listptr; + + foreach(listptr, options) + { + DefElem *def = (DefElem *) lfirst(listptr); + + if (pg_strcasecmp(def->defname, "on_commit_delete_rows") == 0) + return true; + } + + return false; +} + diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index d625d17..db966e8 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -35,6 +35,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/defrem.h" #include "commands/vacuum.h" @@ -1125,12 +1126,25 @@ vac_estimate_reltuples(Relation relation, BlockNumber scanned_pages, double scanned_tuples) { - BlockNumber old_rel_pages = relation->rd_rel->relpages; - double old_rel_tuples = relation->rd_rel->reltuples; + BlockNumber old_rel_pages = 0; + double old_rel_tuples = 0; double old_density; double unscanned_pages; double total_tuples; + /* get relstat from gtt local hash */ + if (RELATION_IS_GLOBAL_TEMP(relation)) + { + get_gtt_relstats(RelationGetRelid(relation), + &old_rel_pages, &old_rel_tuples, NULL, + NULL, NULL); + } + else + { + old_rel_pages = relation->rd_rel->relpages; + old_rel_tuples = relation->rd_rel->reltuples; + } + /* If we did scan the whole table, just use the count as-is */ if (scanned_pages >= total_pages) return scanned_tuples; @@ -1230,24 +1244,8 @@ vac_update_relstats(Relation relation, /* Apply statistical updates, if any, to copied tuple */ dirty = false; - if (pgcform->relpages != (int32) num_pages) - { - pgcform->relpages = (int32) num_pages; - dirty = true; - } - if (pgcform->reltuples != (float4) num_tuples) - { - pgcform->reltuples = (float4) num_tuples; - dirty = true; - } - if (pgcform->relallvisible != (int32) num_all_visible_pages) - { - pgcform->relallvisible = (int32) num_all_visible_pages; - dirty = true; - } /* Apply DDL updates, but not inside an outer transaction (see above) */ - if (!in_outer_xact) { /* @@ -1272,37 +1270,64 @@ vac_update_relstats(Relation relation, } } - /* - * Update relfrozenxid, unless caller passed InvalidTransactionId - * indicating it has no new data. - * - * Ordinarily, we don't let relfrozenxid go backwards: if things are - * working correctly, the only way the new frozenxid could be older would - * be if a previous VACUUM was done with a tighter freeze_min_age, in - * which case we don't want to forget the work it already did. However, - * if the stored relfrozenxid is "in the future", then it must be corrupt - * and it seems best to overwrite it with the cutoff we used this time. - * This should match vac_update_datfrozenxid() concerning what we consider - * to be "in the future". - */ - if (TransactionIdIsNormal(frozenxid) && - pgcform->relfrozenxid != frozenxid && - (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || - TransactionIdPrecedes(ReadNewTransactionId(), - pgcform->relfrozenxid))) + /* global temp table remember relstats to localhash not catalog */ + if (RELATION_IS_GLOBAL_TEMP(relation)) { - pgcform->relfrozenxid = frozenxid; - dirty = true; + up_gtt_relstats(relation, + num_pages, num_tuples, + num_all_visible_pages, + frozenxid, minmulti); } - - /* Similarly for relminmxid */ - if (MultiXactIdIsValid(minmulti) && - pgcform->relminmxid != minmulti && - (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || - MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) + else { - pgcform->relminmxid = minmulti; - dirty = true; + if (pgcform->relpages != (int32) num_pages) + { + pgcform->relpages = (int32) num_pages; + dirty = true; + } + if (pgcform->reltuples != (float4) num_tuples) + { + pgcform->reltuples = (float4) num_tuples; + dirty = true; + } + if (pgcform->relallvisible != (int32) num_all_visible_pages) + { + pgcform->relallvisible = (int32) num_all_visible_pages; + dirty = true; + } + + /* + * Update relfrozenxid, unless caller passed InvalidTransactionId + * indicating it has no new data. + * + * Ordinarily, we don't let relfrozenxid go backwards: if things are + * working correctly, the only way the new frozenxid could be older would + * be if a previous VACUUM was done with a tighter freeze_min_age, in + * which case we don't want to forget the work it already did. However, + * if the stored relfrozenxid is "in the future", then it must be corrupt + * and it seems best to overwrite it with the cutoff we used this time. + * This should match vac_update_datfrozenxid() concerning what we consider + * to be "in the future". + */ + if (TransactionIdIsNormal(frozenxid) && + pgcform->relfrozenxid != frozenxid && + (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), + pgcform->relfrozenxid))) + { + pgcform->relfrozenxid = frozenxid; + dirty = true; + } + + /* Similarly for relminmxid */ + if (MultiXactIdIsValid(minmulti) && + pgcform->relminmxid != minmulti && + (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || + MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) + { + pgcform->relminmxid = minmulti; + dirty = true; + } } /* If anything changed, write out the tuple. */ @@ -1394,6 +1419,10 @@ vac_update_datfrozenxid(void) continue; } + /* global temp table relstats not in pg_class */ + if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + continue; + /* * Some table AMs might not need per-relation xid / multixid horizons. * It therefore seems reasonable to allow relfrozenxid and relminmxid @@ -1451,6 +1480,25 @@ vac_update_datfrozenxid(void) Assert(TransactionIdIsNormal(newFrozenXid)); Assert(MultiXactIdIsValid(newMinMulti)); + /* + * Global temp table get frozenxid from MyProc + * to avoid the vacuum truncate clog that gtt need. + */ + if (max_active_gtt > 0) + { + TransactionId oldest_gtt_frozenxid = + list_all_session_gtt_frozenxids(0, NULL, NULL, NULL); + + if (TransactionIdIsNormal(oldest_gtt_frozenxid) && + TransactionIdPrecedes(oldest_gtt_frozenxid, newFrozenXid)) + { + ereport(WARNING, + (errmsg("global temp table oldest FrozenXid is far in the past"), + errhint("please truncate them or kill those sessions that use them."))); + newFrozenXid = oldest_gtt_frozenxid; + } + } + /* Now fetch the pg_database tuple we need to update. */ relation = table_open(DatabaseRelationId, RowExclusiveLock); diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 8286d9c..c3992a4 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -591,6 +591,8 @@ static void set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) { + char relpersistence; + /* * The flag has previously been initialized to false, so we can just * return if it becomes clear that we can't safely set it. @@ -618,7 +620,11 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, * the rest of the necessary infrastructure right now anyway. So * for now, bail out if we see a temporary table. */ - if (get_rel_persistence(rte->relid) == RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + relpersistence = get_rel_persistence(rte->relid); + + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) return; /* diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index d6f2153..310a9e2 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -6312,7 +6312,9 @@ plan_create_index_workers(Oid tableOid, Oid indexOid) * Furthermore, any index predicate or index expressions must be parallel * safe. */ + /* global temp table is same as local temp table */ if (heap->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + heap->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP || !is_parallel_safe(root, (Node *) RelationGetIndexExpressions(index)) || !is_parallel_safe(root, (Node *) RelationGetIndexPredicate(index))) { diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index d82fc5a..189286b 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -31,6 +31,7 @@ #include "catalog/pg_am.h" #include "catalog/pg_proc.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "foreign/fdwapi.h" #include "miscadmin.h" #include "nodes/makefuncs.h" @@ -53,6 +54,7 @@ #include "utils/snapmgr.h" #include "utils/syscache.h" + /* GUC parameter */ int constraint_exclusion = CONSTRAINT_EXCLUSION_PARTITION; @@ -946,10 +948,10 @@ void estimate_rel_size(Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac) { - BlockNumber curpages; - BlockNumber relpages; - double reltuples; - BlockNumber relallvisible; + BlockNumber curpages = 0; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; double density; switch (rel->rd_rel->relkind) @@ -963,6 +965,21 @@ estimate_rel_size(Relation rel, int32 *attr_widths, case RELKIND_INDEX: + /* global temp table get relstats from localhash */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + get_gtt_relstats(RelationGetRelid(rel), + &relpages, &reltuples, &relallvisible, + NULL, NULL); + } + else + { + /* coerce values in pg_class to more desirable types */ + relpages = (BlockNumber) rel->rd_rel->relpages; + reltuples = (double) rel->rd_rel->reltuples; + relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + } + /* * XXX: It'd probably be good to move this into a callback, * individual index types e.g. know if they have a metapage. @@ -971,11 +988,6 @@ estimate_rel_size(Relation rel, int32 *attr_widths, /* it has storage, ok to call the smgr */ curpages = RelationGetNumberOfBlocks(rel); - /* coerce values in pg_class to more desirable types */ - relpages = (BlockNumber) rel->rd_rel->relpages; - reltuples = (double) rel->rd_rel->reltuples; - relallvisible = (BlockNumber) rel->rd_rel->relallvisible; - /* report estimated # pages */ *pages = curpages; /* quick exit if rel is clearly empty */ @@ -985,10 +997,6 @@ estimate_rel_size(Relation rel, int32 *attr_widths, *allvisfrac = 0; break; } - /* coerce values in pg_class to more desirable types */ - relpages = (BlockNumber) rel->rd_rel->relpages; - reltuples = (double) rel->rd_rel->reltuples; - relallvisible = (BlockNumber) rel->rd_rel->relallvisible; /* * Discount the metapage while estimating the number of tuples. diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 748bebf..a5ddbcd 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2579,6 +2579,11 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("materialized views must not use temporary tables or views"))); + if (is_query_using_gtt(query)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialized views must not use global temporary tables or views"))); + /* * A materialized view would either need to save parameters for use in * maintaining/loading the data or prohibit them entirely. The latter diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index ba5916b..0ee6931 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3290,17 +3290,11 @@ OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; } | LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; } | GLOBAL TEMPORARY { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; } | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; } @@ -11588,19 +11582,13 @@ OptTempTableName: } | GLOBAL TEMPORARY opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED opt_table qualified_name { diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index b875a50..123945b 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -81,6 +81,7 @@ static void expandTupleDesc(TupleDesc tupdesc, Alias *eref, List **colnames, List **colvars); static int specialAttNum(const char *attname); static bool isQueryUsingTempRelation_walker(Node *node, void *context); +static bool is_query_using_gtt_walker(Node *node, void *context); /* @@ -3579,3 +3580,49 @@ isQueryUsingTempRelation_walker(Node *node, void *context) isQueryUsingTempRelation_walker, context); } + +/* check if the query uses global temp table */ +static bool +is_query_using_gtt_walker(Node *node, void *context) +{ + if (node == NULL) + return false; + + if (IsA(node, Query)) + { + Query *query = (Query *) node; + ListCell *rtable; + + foreach(rtable, query->rtable) + { + RangeTblEntry *rte = lfirst(rtable); + + if (rte->rtekind == RTE_RELATION) + { + Relation rel = relation_open(rte->relid, AccessShareLock); + char relpersistence = rel->rd_rel->relpersistence; + + relation_close(rel, AccessShareLock); + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + return true; + } + } + + return query_tree_walker(query, + is_query_using_gtt_walker, + context, + QTW_IGNORE_JOINALIASES); + } + + return expression_tree_walker(node, + is_query_using_gtt_walker, + context); +} + +/* check if the query uses global temp table */ +bool +is_query_using_gtt(Query *query) +{ + return is_query_using_gtt_walker((Node *) query, NULL); +} + diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index ee2d2b5..9c9abaa 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -437,6 +437,9 @@ generateSerialExtraStmts(CreateStmtContext *cxt, ColumnDef *column, seqstmt->sequence = makeRangeVar(snamespace, sname, -1); seqstmt->options = seqoptions; + if (cxt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + seqstmt->sequence->relpersistence = cxt->relation->relpersistence; + /* * If a sequence data type was specified, add it to the options. Prepend * to the list rather than append; in case a user supplied their own AS diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 6d1f28c..ed837d1 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2086,6 +2086,11 @@ do_autovacuum(void) } continue; } + else if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + /* autovacuum skip vacuum global temp table */ + continue; + } /* Fetch reloptions and the pgstat entry for this table */ relopts = extract_autovac_opts(tuple, pg_class_desc); @@ -2152,7 +2157,9 @@ do_autovacuum(void) /* * We cannot safely process other backends' temp tables, so skip 'em. */ - if (classForm->relpersistence == RELPERSISTENCE_TEMP) + /* autovacuum skip vacuum global temp table */ + if (classForm->relpersistence == RELPERSISTENCE_TEMP || + classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) continue; relid = classForm->oid; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index aba3960..68adcd5 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -53,6 +53,8 @@ #include "utils/resowner_private.h" #include "utils/timestamp.h" +#include "utils/guc.h" +#include "catalog/storage_gtt.h" /* Note: these two macros only work on shared buffers, not local ones! */ #define BufHdrGetBlock(bufHdr) ((Block) (BufferBlocks + ((Size) (bufHdr)->buf_id) * BLCKSZ)) @@ -432,7 +434,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref) static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, - bool *hit); + bool *hit, Relation rel); static bool PinBuffer(BufferDesc *buf, BufferAccessStrategy strategy); static void PinBuffer_Locked(BufferDesc *buf); static void UnpinBuffer(BufferDesc *buf, bool fixOwner); @@ -664,7 +666,8 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, */ pgstat_count_buffer_read(reln); buf = ReadBuffer_common(reln->rd_smgr, reln->rd_rel->relpersistence, - forkNum, blockNum, mode, strategy, &hit); + forkNum, blockNum, mode, strategy, &hit, + reln); if (hit) pgstat_count_buffer_hit(reln); return buf; @@ -692,7 +695,7 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, Assert(InRecovery); return ReadBuffer_common(smgr, RELPERSISTENCE_PERMANENT, forkNum, blockNum, - mode, strategy, &hit); + mode, strategy, &hit, NULL); } @@ -704,7 +707,8 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, - BufferAccessStrategy strategy, bool *hit) + BufferAccessStrategy strategy, bool *hit, + Relation rel) { BufferDesc *bufHdr; Block bufBlock; @@ -719,6 +723,15 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, isExtend = (blockNum == P_NEW); + /* create storage when first read data page for gtt */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (isExtend || blockNum == 0) && + forkNum == MAIN_FORKNUM && + !gtt_storage_attached(smgr->smgr_rnode.node.relNode)) + { + RelationCreateStorage(smgr->smgr_rnode.node, relpersistence, rel); + } + TRACE_POSTGRESQL_BUFFER_READ_START(forkNum, blockNum, smgr->smgr_rnode.node.spcNode, smgr->smgr_rnode.node.dbNode, @@ -2809,6 +2822,16 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln) BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum) { + /* + * When this backend not init gtt storage + * return 0 + */ + if (RELATION_IS_GLOBAL_TEMP(relation) && + !gtt_storage_attached(relation->rd_node.relNode)) + { + return 0; + } + switch (relation->rd_rel->relkind) { case RELKIND_SEQUENCE: diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c index 427b0d5..7adb969 100644 --- a/src/backend/storage/ipc/ipci.c +++ b/src/backend/storage/ipc/ipci.c @@ -21,6 +21,7 @@ #include "access/nbtree.h" #include "access/subtrans.h" #include "access/twophase.h" +#include "catalog/storage_gtt.h" #include "commands/async.h" #include "miscadmin.h" #include "pgstat.h" @@ -147,6 +148,7 @@ CreateSharedMemoryAndSemaphores(void) size = add_size(size, BTreeShmemSize()); size = add_size(size, SyncScanShmemSize()); size = add_size(size, AsyncShmemSize()); + size = add_size(size, active_gtt_shared_hash_size()); #ifdef EXEC_BACKEND size = add_size(size, ShmemBackendArraySize()); #endif @@ -217,6 +219,8 @@ CreateSharedMemoryAndSemaphores(void) SUBTRANSShmemInit(); MultiXactShmemInit(); InitBufferPool(); + /* global temporary table */ + active_gtt_shared_hash_init(); /* * Set up lock manager diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index c3adb2e..eb95e5f 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -62,6 +62,7 @@ #include "utils/builtins.h" #include "utils/rel.h" #include "utils/snapmgr.h" +#include "utils/guc.h" #define UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) @@ -4087,3 +4088,77 @@ KnownAssignedXidsReset(void) LWLockRelease(ProcArrayLock); } + +/* + * search all active backend to get oldest frozenxid + * for global temp table. + */ +int +list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n) +{ + ProcArrayStruct *arrayP = procArray; + TransactionId result = InvalidTransactionId; + int index; + int flags = 0; + int i = 0; + + if (max_active_gtt <= 0) + return 0; + + if (max_size > 0) + { + Assert(pids); + Assert(xids); + Assert(n); + *n = 0; + } + + if (max_active_gtt <= 0) + return InvalidTransactionId; + + if (RecoveryInProgress()) + return InvalidTransactionId; + + flags |= PROC_IS_AUTOVACUUM; + flags |= PROC_IN_LOGICAL_DECODING; + + LWLockAcquire(ProcArrayLock, LW_SHARED); + if (max_size > 0 && max_size < arrayP->numProcs) + { + LWLockRelease(ProcArrayLock); + elog(ERROR, "list_all_gtt_frozenxids require more array"); + } + + for (index = 0; index < arrayP->numProcs; index++) + { + int pgprocno = arrayP->pgprocnos[index]; + volatile PGPROC *proc = &allProcs[pgprocno]; + volatile PGXACT *pgxact = &allPgXact[pgprocno]; + + if (pgxact->vacuumFlags & flags) + continue; + + if (proc->databaseId == MyDatabaseId && + TransactionIdIsNormal(proc->session_gtt_frozenxid)) + { + if (result == InvalidTransactionId) + result = proc->session_gtt_frozenxid; + else if (TransactionIdPrecedes(proc->session_gtt_frozenxid, result)) + result = proc->session_gtt_frozenxid; + + if (max_size > 0) + { + pids[i] = proc->pid; + xids[i] = proc->session_gtt_frozenxid; + i++; + } + } + } + LWLockRelease(ProcArrayLock); + + if (max_size > 0) + *n = i; + + return result; +} + diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 32df8c8..e4e1125 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -395,6 +395,7 @@ InitProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; @@ -577,6 +578,7 @@ InitAuxiliaryProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index 85b7115..f5eae8c 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -646,6 +646,12 @@ mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, */ if (zero_damaged_pages || InRecovery) MemSet(buffer, 0, BLCKSZ); + else if(SmgrIsTemp(reln) && blocknum == 0 && forknum == MAIN_FORKNUM) + { + /* global temp table init btree meta page */ + MemSet(buffer, 0, BLCKSZ); + mdwrite(reln, forknum, blocknum, buffer, true); + } else ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c index 8406644..92f028e 100644 --- a/src/backend/utils/adt/dbsize.c +++ b/src/backend/utils/adt/dbsize.c @@ -19,6 +19,8 @@ #include "catalog/namespace.h" #include "catalog/pg_authid.h" #include "catalog/pg_tablespace.h" +#include "catalog/storage_gtt.h" +#include "catalog/index.h" #include "commands/dbcommands.h" #include "commands/tablespace.h" #include "miscadmin.h" @@ -262,7 +264,6 @@ pg_tablespace_size_name(PG_FUNCTION_ARGS) PG_RETURN_INT64(size); } - /* * calculate size of (one fork of) a relation * @@ -307,6 +308,41 @@ calculate_relation_size(RelFileNode *rfn, BackendId backend, ForkNumber forknum) return totalsize; } +static int64 +calculate_relation_size_all_file(Relation rel, const Bitmapset *gtt_map) +{ + int64 size = 0; + ForkNumber forkNum; + BackendId backendid; + + /* For global temp table */ + if (gtt_map) + { + Bitmapset *map_copy = bms_copy(gtt_map); + + backendid = bms_first_member(map_copy); + + do + { + for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) + size += calculate_relation_size(&(rel->rd_node), + backendid, + forkNum); + backendid = bms_next_member(map_copy, backendid); + } while (backendid > 0); + + pfree(map_copy); + } + else + { + for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) + size += calculate_relation_size(&(rel->rd_node), + rel->rd_backend, forkNum); + } + + return size; +} + Datum pg_relation_size(PG_FUNCTION_ARGS) { @@ -340,20 +376,17 @@ pg_relation_size(PG_FUNCTION_ARGS) * Must not be applied to non-TOAST relations. */ static int64 -calculate_toast_table_size(Oid toastrelid) +calculate_toast_table_size(Oid toastrelid, Bitmapset *gtt_map) { int64 size = 0; Relation toastRel; - ForkNumber forkNum; ListCell *lc; List *indexlist; toastRel = relation_open(toastrelid, AccessShareLock); /* toast heap size, including FSM and VM size */ - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - size += calculate_relation_size(&(toastRel->rd_node), - toastRel->rd_backend, forkNum); + size += calculate_relation_size_all_file(toastRel, gtt_map); /* toast index size, including FSM and VM size */ indexlist = RelationGetIndexList(toastRel); @@ -365,9 +398,8 @@ calculate_toast_table_size(Oid toastrelid) toastIdxRel = relation_open(lfirst_oid(lc), AccessShareLock); - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - size += calculate_relation_size(&(toastIdxRel->rd_node), - toastIdxRel->rd_backend, forkNum); + + size += calculate_relation_size_all_file(toastIdxRel, gtt_map); relation_close(toastIdxRel, AccessShareLock); } @@ -386,23 +418,20 @@ calculate_toast_table_size(Oid toastrelid) * those won't have attached toast tables, but they can have multiple forks. */ static int64 -calculate_table_size(Relation rel) +calculate_table_size(Relation rel, Bitmapset *gtt_map) { int64 size = 0; - ForkNumber forkNum; /* * heap size, including FSM and VM */ - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - size += calculate_relation_size(&(rel->rd_node), rel->rd_backend, - forkNum); + size += calculate_relation_size_all_file(rel, gtt_map); /* * Size of toast relation */ if (OidIsValid(rel->rd_rel->reltoastrelid)) - size += calculate_toast_table_size(rel->rd_rel->reltoastrelid); + size += calculate_toast_table_size(rel->rd_rel->reltoastrelid, gtt_map); return size; } @@ -413,7 +442,7 @@ calculate_table_size(Relation rel) * Can be applied safely to an index, but you'll just get zero. */ static int64 -calculate_indexes_size(Relation rel) +calculate_indexes_size(Relation rel, Bitmapset *gtt_map) { int64 size = 0; @@ -429,14 +458,10 @@ calculate_indexes_size(Relation rel) { Oid idxOid = lfirst_oid(cell); Relation idxRel; - ForkNumber forkNum; idxRel = relation_open(idxOid, AccessShareLock); - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - size += calculate_relation_size(&(idxRel->rd_node), - idxRel->rd_backend, - forkNum); + size += calculate_relation_size_all_file(idxRel, gtt_map); relation_close(idxRel, AccessShareLock); } @@ -453,16 +478,40 @@ pg_table_size(PG_FUNCTION_ARGS) Oid relOid = PG_GETARG_OID(0); Relation rel; int64 size; + Bitmapset *gtt_map = NULL; rel = try_relation_open(relOid, AccessShareLock); if (rel == NULL) PG_RETURN_NULL(); - size = calculate_table_size(rel); + /* For GTT, calculate the size of the data file in the session where the GTT has been initialized */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (rel->rd_rel->relkind == RELKIND_INDEX) + { + Relation relation; + Oid relid; + + relid = IndexGetRelation(RelationGetRelid(rel), false); + relation = try_relation_open(relid, AccessShareLock); + if (relation) + { + gtt_map = copy_active_gtt_bitmap(relation->rd_node); + relation_close(relation, AccessShareLock); + } + } + else + gtt_map = copy_active_gtt_bitmap(rel->rd_node); + } + + size = calculate_table_size(rel, gtt_map); relation_close(rel, AccessShareLock); + if(gtt_map) + pfree(gtt_map); + PG_RETURN_INT64(size); } @@ -472,16 +521,24 @@ pg_indexes_size(PG_FUNCTION_ARGS) Oid relOid = PG_GETARG_OID(0); Relation rel; int64 size; + Bitmapset *gtt_map = NULL; rel = try_relation_open(relOid, AccessShareLock); if (rel == NULL) PG_RETURN_NULL(); - size = calculate_indexes_size(rel); + /* For GTT, calculate the size of the data file in the session where the GTT has been initialized */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + gtt_map = copy_active_gtt_bitmap(rel->rd_node); + + size = calculate_indexes_size(rel, gtt_map); relation_close(rel, AccessShareLock); + if (gtt_map) + pfree(gtt_map); + PG_RETURN_INT64(size); } @@ -493,17 +550,25 @@ static int64 calculate_total_relation_size(Relation rel) { int64 size; + Bitmapset *gtt_map = NULL; + + /* For GTT, calculate the size of the data file in the session where the GTT has been initialized */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + gtt_map = copy_active_gtt_bitmap(rel->rd_node); /* * Aggregate the table size, this includes size of the heap, toast and * toast index with free space and visibility map */ - size = calculate_table_size(rel); + size = calculate_table_size(rel, gtt_map); /* * Add size of all attached indexes as well */ - size += calculate_indexes_size(rel); + size += calculate_indexes_size(rel, gtt_map); + + if (gtt_map) + pfree(gtt_map); return size; } @@ -1008,6 +1073,10 @@ pg_relation_filepath(PG_FUNCTION_ARGS) Assert(backend != InvalidBackendId); } break; + /* For global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + backend = BackendIdForTempRelations(); + break; default: elog(ERROR, "invalid relpersistence: %c", relform->relpersistence); backend = InvalidBackendId; /* placate compiler */ diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 7c6f057..589bd38 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -142,6 +142,7 @@ #include "utils/timestamp.h" #include "utils/typcache.h" +#include "catalog/storage_gtt.h" /* Hooks for plugins to get control when we ask for stats */ get_relation_stats_hook_type get_relation_stats_hook = NULL; @@ -4578,12 +4579,25 @@ examine_variable(PlannerInfo *root, Node *node, int varRelid, } else if (index->indpred == NIL) { - vardata->statsTuple = - SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(index->indexoid), - Int16GetDatum(pos + 1), - BoolGetDatum(false)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(index->indexoid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = + get_gtt_att_statistic(index->indexoid, + Int16GetDatum(pos + 1), + false); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + vardata->statsTuple = + SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(index->indexoid), + Int16GetDatum(pos + 1), + BoolGetDatum(false)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -4708,15 +4722,27 @@ examine_simple_variable(PlannerInfo *root, Var *var, } else if (rte->rtekind == RTE_RELATION) { - /* - * Plain table or parent of an inheritance appendrel, so look up the - * column in pg_statistic - */ - vardata->statsTuple = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(rte->relid), - Int16GetDatum(var->varattno), - BoolGetDatum(rte->inh)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(rte->relid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = get_gtt_att_statistic(rte->relid, + var->varattno, + rte->inh); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + /* + * Plain table or parent of an inheritance appendrel, so look up the + * column in pg_statistic + */ + vardata->statsTuple = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(rte->relid), + Int16GetDatum(var->varattno), + BoolGetDatum(rte->inh)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -6098,6 +6124,7 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, { /* Simple variable --- look to stats for the underlying table */ RangeTblEntry *rte = planner_rt_fetch(index->rel->relid, root); + char rel_persistence = get_rel_persistence(rte->relid); Assert(rte->rtekind == RTE_RELATION); relid = rte->relid; @@ -6115,6 +6142,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + rte->inh); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -6126,6 +6160,8 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* Expression --- maybe there are stats for the index itself */ relid = index->indexoid; colnum = 1; @@ -6141,6 +6177,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -7054,6 +7097,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, /* attempt to lookup stats in relation for this index column */ if (attnum != 0) { + char rel_persistence = get_rel_persistence(rte->relid); + /* Simple variable -- look to stats for the underlying table */ if (get_relation_stats_hook && (*get_relation_stats_hook) (root, rte, attnum, &vardata)) @@ -7066,6 +7111,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(rte->relid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = @@ -7078,6 +7131,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* * Looks like we've found an expression column in the index. Let's * see if there's any stats for it. @@ -7097,6 +7152,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(index->indexoid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 1e3e6d3..44686ce 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -34,6 +34,7 @@ #include "catalog/pg_statistic.h" #include "catalog/pg_transform.h" #include "catalog/pg_type.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "utils/array.h" @@ -46,6 +47,7 @@ #include "utils/syscache.h" #include "utils/typcache.h" + /* Hook for plugins to get control in get_attavgwidth() */ get_attavgwidth_hook_type get_attavgwidth_hook = NULL; @@ -2878,6 +2880,18 @@ get_attavgwidth(Oid relid, AttrNumber attnum) if (stawidth > 0) return stawidth; } + if (get_rel_persistence(relid) == RELPERSISTENCE_GLOBAL_TEMP) + { + tp = get_gtt_att_statistic(relid, attnum, false); + if (!HeapTupleIsValid(tp)) + return 0; + + stawidth = ((Form_pg_statistic) GETSTRUCT(tp))->stawidth; + if (stawidth > 0) + return stawidth; + else + return 0; + } tp = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(relid), Int16GetDatum(attnum), diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index df025a5..1c30d86 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -1124,6 +1124,16 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) relation->rd_islocaltemp = false; } break; + case RELPERSISTENCE_GLOBAL_TEMP: + { + relation->rd_backend = BackendIdForTempRelations(); + /* + * For global temp table, all backend can use + * this relation, so rd_islocaltemp always true. + */ + relation->rd_islocaltemp = true; + } + break; default: elog(ERROR, "invalid relpersistence: %c", relation->rd_rel->relpersistence); @@ -3313,6 +3323,10 @@ RelationBuildLocalRelation(const char *relname, rel->rd_backend = BackendIdForTempRelations(); rel->rd_islocaltemp = true; break; + case RELPERSISTENCE_GLOBAL_TEMP: + rel->rd_backend = BackendIdForTempRelations(); + rel->rd_islocaltemp = true; + break; default: elog(ERROR, "invalid relpersistence: %c", relpersistence); break; @@ -3427,6 +3441,9 @@ RelationSetNewRelfilenode(Relation relation, char persistence) TransactionId freezeXid = InvalidTransactionId; RelFileNode newrnode; + if (RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "global temp table does not allow setting new relfilenode"); + /* Allocate a new relfilenode */ newrelfilenode = GetNewRelFileNode(relation->rd_rel->reltablespace, NULL, persistence); @@ -3467,7 +3484,7 @@ RelationSetNewRelfilenode(Relation relation, char persistence) /* handle these directly, at least for now */ SMgrRelation srel; - srel = RelationCreateStorage(newrnode, persistence); + srel = RelationCreateStorage(newrnode, persistence, relation); smgrclose(srel); } break; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index e44f71e..44c86c8 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -139,6 +139,18 @@ char *GUC_check_errmsg_string; char *GUC_check_errdetail_string; char *GUC_check_errhint_string; +/* + * num = 0 means disable global temp table feature. + * global temp table define can still storage in catalog + * just can not use. + * num > 0 means database can management num active global temp table. + */ +#define MIN_NUM_ACTIVE_GTT 0 +#define DEFAULT_NUM_ACTIVE_GTT 1000 +#define MAX_NUM_ACTIVE_GTT 1000000 + +int max_active_gtt = MIN_NUM_ACTIVE_GTT; + static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3, 4); static void set_config_sourcefile(const char *name, char *sourcefile, @@ -1992,6 +2004,15 @@ static struct config_bool ConfigureNamesBool[] = static struct config_int ConfigureNamesInt[] = { { + {"max_active_global_temporary_table", PGC_POSTMASTER, UNGROUPED, + gettext_noop("max active global temporary table."), + NULL + }, + &max_active_gtt, + DEFAULT_NUM_ACTIVE_GTT, MIN_NUM_ACTIVE_GTT, MAX_NUM_ACTIVE_GTT, + NULL, NULL, NULL + }, + { {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Forces a switch to the next WAL file if a " "new file has not been started within N seconds."), diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 799b698..b98d396 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15583,6 +15583,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) { char *ftoptions = NULL; char *srvname = NULL; + char *table_type = NULL; switch (tbinfo->relkind) { @@ -15634,9 +15635,15 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) binary_upgrade_set_pg_class_oids(fout, q, tbinfo->dobj.catId.oid, false); + if (tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED) + table_type = "UNLOGGED "; + else if (tbinfo->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + table_type = "GLOBAL TEMPORARY "; + else + table_type = ""; + appendPQExpBuffer(q, "CREATE %s%s %s", - tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ? - "UNLOGGED " : "", + table_type, reltypename, qualrelname); diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index f3c7eb9..28134e2 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3723,7 +3723,8 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys if (pset.sversion >= 90100) { appendPQExpBuffer(&buf, - ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + ",\n CASE c.relpersistence WHEN 'g' THEN '%s' WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + gettext_noop("session"), gettext_noop("permanent"), gettext_noop("temporary"), gettext_noop("unlogged"), diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index a12fc1f..78958e4 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -165,6 +165,7 @@ typedef FormData_pg_class *Form_pg_class; #define RELPERSISTENCE_PERMANENT 'p' /* regular table */ #define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */ #define RELPERSISTENCE_TEMP 't' /* temporary table */ +#define RELPERSISTENCE_GLOBAL_TEMP 'g' /* global temporary table */ /* default selection for replica identity (primary key or nothing) */ #define REPLICA_IDENTITY_DEFAULT 'd' diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index fcf2a12..ba0bd5f 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5484,6 +5484,40 @@ proparallel => 'r', prorettype => 'float8', proargtypes => 'oid', prosrc => 'pg_stat_get_xact_function_self_time' }, +# For global temporary table +{ oid => '4191', + descr => 'List local statistics for global temporary table', + proname => 'pg_get_gtt_statistics', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid int4 anyelement', + proallargtypes => '{oid,int4,anyelement,oid,int2,bool,float4,int4,float4,int2,int2,int2,int2,int2,oid,oid,oid,oid,oid,oid,oid,oid,oid,oid,_float4,_float4,_float4,_float4,_float4,anyarray,anyarray,anyarray,anyarray,anyarray}', + proargmodes => '{i,i,i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}', + proargnames => '{relid,att,x,starelid,staattnum,stainherit,stanullfrac,stawidth,stadistinct,stakind1,stakind2,stakind3,stakind4,stakind5,staop1,staop2,staop3,staop4,staop5,stacoll1,stacoll2,stacoll3,stacoll4,stacoll5,stanumbers1,stanumbers2,stanumbers3,stanumbers4,stanumbers5,stavalues1,stavalues2,stavalues3,stavalues4,stavalues5}', + prosrc => 'pg_get_gtt_statistics' }, +{ oid => '4192', + descr => 'List local relstats for global temporary table', + proname => 'pg_get_gtt_relstats', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,int4,float4,int4,xid,xid}', + proargmodes => '{i,o,o,o,o,o}', + proargnames => '{relid,relpages,reltuples,relallvisible,relfrozenxid,relminmxid}', + prosrc => 'pg_get_gtt_relstats' }, +{ oid => '4193', + descr => 'List attached pid for one global temporary table', + proname => 'pg_gtt_attached_pid', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,oid,int4}', + proargmodes => '{i,o,o}', + proargnames => '{relid,relid,pid}', + prosrc => 'pg_gtt_attached_pid' }, +{ oid => '4194', + descr => 'List those backends that have used global temporary table', + proname => 'pg_list_gtt_relfrozenxids', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => '', + proallargtypes => '{int4,xid}', + proargmodes => '{o,o}', + proargnames => '{pid,relfrozenxid}', + prosrc => 'pg_list_gtt_relfrozenxids' }, + { oid => '3788', descr => 'statistics: timestamp of the current statistics snapshot', proname => 'pg_stat_get_snapshot_timestamp', provolatile => 's', diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h index 048003c..af48cdf 100644 --- a/src/include/catalog/storage.h +++ b/src/include/catalog/storage.h @@ -19,7 +19,7 @@ #include "storage/smgr.h" #include "utils/relcache.h" -extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence); +extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel); extern void RelationDropStorage(Relation rel); extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit); extern void RelationTruncate(Relation rel, BlockNumber nblocks); diff --git a/src/include/catalog/storage_gtt.h b/src/include/catalog/storage_gtt.h new file mode 100644 index 0000000..eacc214 --- /dev/null +++ b/src/include/catalog/storage_gtt.h @@ -0,0 +1,39 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.h + * prototypes for functions in backend/catalog/storage_gtt.c + * + * src/include/catalog/storage_gtt.h + * + *------------------------------------------------------------------------- + */ +#ifndef STORAGE_GTT_H +#define STORAGE_GTT_H + +#include "access/htup.h" +#include "storage/block.h" +#include "storage/relfilenode.h" +#include "utils/relcache.h" + +extern Size active_gtt_shared_hash_size(void); +extern void active_gtt_shared_hash_init(void); +extern void remember_gtt_storage_info(RelFileNode rnode, Relation rel); +extern void forget_gtt_storage_info(Oid relid); +extern bool is_other_backend_use_gtt(RelFileNode node); +extern bool gtt_storage_attached(Oid relid); +extern Bitmapset *copy_active_gtt_bitmap(RelFileNode node); +extern void up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull); +extern HeapTuple get_gtt_att_statistic(Oid reloid, int attnum, bool inh); +extern void release_gtt_statistic_cache(HeapTuple tup); +extern void up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid); +extern bool get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid); + +#endif /* STORAGE_H */ diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index 93f9446..14cafae 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -120,4 +120,7 @@ extern Oid attnumTypeId(Relation rd, int attid); extern Oid attnumCollationId(Relation rd, int attid); extern bool isQueryUsingTempRelation(Query *query); +/* global temp table check */ +extern bool is_query_using_gtt(Query *query); + #endif /* PARSE_RELATION_H */ diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 870ecb5..92c590e 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -405,6 +405,8 @@ do { \ #define PageClearPrunable(page) \ (((PageHeader) (page))->pd_prune_xid = InvalidTransactionId) +#define GlobalTempRelationPageIsNotInitialized(rel, page) \ + ((rel)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && PageIsNew(page)) /* ---------------------------------------------------------------- * extern declarations diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 8fda8e4..172eae9 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -220,6 +220,7 @@ typedef enum BuiltinTrancheIds LWTRANCHE_TBM, LWTRANCHE_PARALLEL_APPEND, LWTRANCHE_SXACT, + LWTRANCHE_GTT_CTL, LWTRANCHE_FIRST_USER_DEFINED } BuiltinTrancheIds; diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 5b407e6..f13250a 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -117,6 +117,8 @@ struct PGPROC Oid tempNamespaceId; /* OID of temp schema this backend is * using */ + TransactionId session_gtt_frozenxid; /* session level global temp table relfrozenxid */ + bool isBackgroundWorker; /* true if background worker. */ /* diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index a5c7d0c..a86f61f 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -125,4 +125,6 @@ extern void ProcArraySetReplicationSlotXmin(TransactionId xmin, extern void ProcArrayGetReplicationSlotXmin(TransactionId *xmin, TransactionId *catalog_xmin); +extern int list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n); + #endif /* PROCARRAY_H */ diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index ce93ace..0f7262e 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -281,6 +281,10 @@ extern int tcp_user_timeout; extern bool trace_sort; #endif +/* global temporary table */ +extern int max_active_gtt; +/* end */ + /* * Functions exported by guc.c */ diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 44ed04d..3f9720d 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -277,6 +277,7 @@ typedef struct StdRdOptions int parallel_workers; /* max number of parallel workers */ bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */ bool vacuum_truncate; /* enables vacuum to truncate a relation */ + bool on_commit_delete_rows; /* global temp table */ } StdRdOptions; #define HEAP_MIN_FILLFACTOR 10 @@ -535,7 +536,8 @@ typedef struct ViewOptions * True if relation's pages are stored in local buffers. */ #define RelationUsesLocalBuffers(relation) \ - ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP || \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) /* * RELATION_IS_LOCAL @@ -602,6 +604,17 @@ typedef struct ViewOptions RelationNeedsWAL(relation) && \ !IsCatalogRelation(relation)) +/* global temp table implementations */ +#define RELATION_IS_GLOBAL_TEMP(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + +#define RELATION_GTT_ON_COMMIT_DELETE(relation) \ + ((relation)->rd_options && \ + ((relation)->rd_rel->relkind == RELKIND_RELATION || (relation)->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) && \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP ? \ + ((StdRdOptions *) (relation)->rd_options)->on_commit_delete_rows : false) + +#define RelationGetRelPersistence(relation) ((relation)->rd_rel->relpersistence) + /* routines in utils/cache/relcache.c */ extern void RelationIncrementReferenceCount(Relation rel); extern void RelationDecrementReferenceCount(Relation rel); diff --git a/src/test/regress/expected/gtt_clean.out b/src/test/regress/expected/gtt_clean.out new file mode 100644 index 0000000..50ca9ac --- /dev/null +++ b/src/test/regress/expected/gtt_clean.out @@ -0,0 +1,7 @@ +reset search_path; +drop schema gtt cascade; +NOTICE: drop cascades to 4 other objects +DETAIL: drop cascades to table gtt.gtt1 +drop cascades to table gtt.gtt2 +drop cascades to table gtt.gtt3 +drop cascades to table gtt.gtt_t_kenyon diff --git a/src/test/regress/expected/gtt_function.out b/src/test/regress/expected/gtt_function.out new file mode 100644 index 0000000..2c69f14 --- /dev/null +++ b/src/test/regress/expected/gtt_function.out @@ -0,0 +1,197 @@ +CREATE SCHEMA IF NOT EXISTS gtt_function; +set search_path=gtt_function,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt_test_rename(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); +ERROR: cannot create indexes on global temporary tables using concurrent mode +-- ERROR +cluster gtt1 using gtt1_pkey; +ERROR: not support cluster global temporary tables yet +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; +ERROR: ON COMMIT can only be used on temporary tables +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); +ERROR: regular table cannot specifie on_commit_delete_rows +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +); + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; + count +------- + 2 +(1 row) + +commit; +select count(*) from p_table01; + count +------- + 0 +(1 row) + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +ERROR: The parent table must be global temporary table +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp); +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + relname | relkind | relpersistence | reloptions +---------------------------------+---------+----------------+------------------------------- + p_table01 | p | g | {on_commit_delete_rows=true} + p_table01_2017 | r | g | {on_commit_delete_rows=true} + p_table01_2018 | r | g | {on_commit_delete_rows=true} + p_table01_id_seq | S | g | + p_table02 | p | g | {on_commit_delete_rows=false} + p_table02_2017 | r | g | {on_commit_delete_rows=false} + p_table02_2018 | r | g | {on_commit_delete_rows=false} + p_table02_id_seq | S | g | + tbl_inherits_parent | r | p | + tbl_inherits_parent_global_temp | r | g | {on_commit_delete_rows=true} + tbl_inherits_partition | r | g | {on_commit_delete_rows=true} +(11 rows) + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; +ERROR: global temp table not support on commit drop clause +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; +ERROR: can not defeine global temp table with on commit and with clause at same time +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); +--ok +alter table gtt_test_rename rename to gtt_test; +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; + id | a +----+--- + 2 | 1 + 3 | 2 +(2 rows) + +truncate gtt_seq; +select * from gtt_seq order by id; + id | a +----+--- +(0 rows) + +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + id | a +----+--- + 4 | 3 +(1 row) + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; +ERROR: materialized views must not use global temporary tables or views +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +ERROR: only support btree index on global temp table +create index idx_err on gtt1 using gist (a); +ERROR: data type integer has no default operator class for access method "gist" +HINT: You must specify an operator class for the index or define a default operator class for the data type. +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +ERROR: only support btree index on global temp table +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); +ERROR: only support btree index on global temp table +reset search_path; +drop schema gtt_function cascade; +NOTICE: drop cascades to 15 other objects +DETAIL: drop cascades to table gtt_function.gtt1 +drop cascades to table gtt_function.gtt_test +drop cascades to table gtt_function.gtt2 +drop cascades to table gtt_function.gtt3 +drop cascades to table gtt_function.tmp_t0 +drop cascades to table gtt_function.tbl_inherits_parent +drop cascades to table gtt_function.tbl_inherits_parent_global_temp +drop cascades to table gtt_function.products +drop cascades to table gtt_function.measurement +drop cascades to table gtt_function.p_table01 +drop cascades to table gtt_function.p_table02 +drop cascades to table gtt_function.tbl_inherits_partition +drop cascades to table gtt_function.gtt5 +drop cascades to table gtt_function.mytable +drop cascades to table gtt_function.gtt_seq diff --git a/src/test/regress/expected/gtt_parallel_1.out b/src/test/regress/expected/gtt_parallel_1.out new file mode 100644 index 0000000..30d8a7b --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_1.out @@ -0,0 +1,84 @@ +set search_path=gtt,sys; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_parallel_2.out b/src/test/regress/expected/gtt_parallel_2.out new file mode 100644 index 0000000..850ef3e --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_2.out @@ -0,0 +1,161 @@ +set search_path=gtt,sys; +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +commit; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 + 3 | test1 +(3 rows) + +rollback; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test2 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; + a | b +---+------- + 3 | test3 +(1 row) + +rollback; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; + a | b +---+------- + 5 | test5 +(1 row) + +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + a | b +---+------- + 6 | test6 +(1 row) + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; + count +-------- + 100000 +(1 row) + +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + QUERY PLAN +------------------------------------ + Index Scan using gtt3_pkey on gtt3 + Index Cond: (a = 300) +(2 rows) + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; + relname | pg_relation_size | pg_relation_size | pg_table_size | pg_indexes_size | pg_total_relation_size +--------------+------------------+------------------+---------------+-----------------+------------------------ + gtt_t_kenyon | 450560 | 8192 | 499712 | 475136 | 974848 +(1 row) + +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + relname +-------------- + gtt_t_kenyon +(1 row) + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + relname | pg_relation_size | pg_table_size | pg_total_relation_size +--------------------+------------------+---------------+------------------------ + idx_gtt_t_kenyon_1 | 65536 | 65536 | 65536 + idx_gtt_t_kenyon_2 | 409600 | 409600 | 409600 +(2 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_prepare.out b/src/test/regress/expected/gtt_prepare.out new file mode 100644 index 0000000..9735a93 --- /dev/null +++ b/src/test/regress/expected/gtt_prepare.out @@ -0,0 +1,9 @@ +CREATE SCHEMA IF NOT EXISTS gtt; +set search_path=gtt,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; diff --git a/src/test/regress/expected/gtt_stats.out b/src/test/regress/expected/gtt_stats.out new file mode 100644 index 0000000..b258b7c --- /dev/null +++ b/src/test/regress/expected/gtt_stats.out @@ -0,0 +1,76 @@ +CREATE SCHEMA IF NOT EXISTS gtt_stats; +set search_path=gtt_stats,sys; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +insert into gtt values(generate_series(1,10000),'test'); +-- expect 1 +select count(*) from pg_gtt_attached_pids; + count +------- + 1 +(1 row) + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 2 +(1 row) + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 0 | 0 | 0 +(1 row) + +-- expect 0 +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+------------------+-------------+-------------------+------------------------+---------------------- +(0 rows) + +analyze gtt; +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 55 | 10000 | 0 +(1 row) + +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------------------+------------------------+---------------------- + gtt_stats | gtt | a | f | 0 | 4 | -1 | | | {1,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,8700,8800,8900,9000,9100,9200,9300,9400,9500,9600,9700,9800,9900,10000} | 1 | | | + gtt_stats | gtt | b | f | 0 | 5 | 1 | {test} | {1} | | 1 | | | +(2 rows) + +reset search_path; +drop schema gtt_stats cascade; +NOTICE: drop cascades to table gtt_stats.gtt diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 70e1e2f..30cf4bd 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1348,6 +1348,93 @@ pg_group| SELECT pg_authid.rolname AS groname, WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin); +pg_gtt_attached_pids| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relid, + s.pid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_gtt_attached_pid(c.oid) s(relid, pid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_relstats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relpages, + s.reltuples, + s.relallvisible, + s.relfrozenxid, + s.relminmxid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_relstats(c.oid) s(relpages, reltuples, relallvisible, relfrozenxid, relminmxid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_stats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN (s.stakind1 = 1) THEN s.stavalues1 + WHEN (s.stakind2 = 1) THEN s.stavalues2 + WHEN (s.stakind3 = 1) THEN s.stavalues3 + WHEN (s.stakind4 = 1) THEN s.stavalues4 + WHEN (s.stakind5 = 1) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_vals, + CASE + WHEN (s.stakind1 = 1) THEN s.stanumbers1 + WHEN (s.stakind2 = 1) THEN s.stanumbers2 + WHEN (s.stakind3 = 1) THEN s.stanumbers3 + WHEN (s.stakind4 = 1) THEN s.stanumbers4 + WHEN (s.stakind5 = 1) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_freqs, + CASE + WHEN (s.stakind1 = 2) THEN s.stavalues1 + WHEN (s.stakind2 = 2) THEN s.stavalues2 + WHEN (s.stakind3 = 2) THEN s.stavalues3 + WHEN (s.stakind4 = 2) THEN s.stavalues4 + WHEN (s.stakind5 = 2) THEN s.stavalues5 + ELSE NULL::text[] + END AS histogram_bounds, + CASE + WHEN (s.stakind1 = 3) THEN s.stanumbers1[1] + WHEN (s.stakind2 = 3) THEN s.stanumbers2[1] + WHEN (s.stakind3 = 3) THEN s.stanumbers3[1] + WHEN (s.stakind4 = 3) THEN s.stanumbers4[1] + WHEN (s.stakind5 = 3) THEN s.stanumbers5[1] + ELSE NULL::real + END AS correlation, + CASE + WHEN (s.stakind1 = 4) THEN s.stavalues1 + WHEN (s.stakind2 = 4) THEN s.stavalues2 + WHEN (s.stakind3 = 4) THEN s.stavalues3 + WHEN (s.stakind4 = 4) THEN s.stavalues4 + WHEN (s.stakind5 = 4) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_elems, + CASE + WHEN (s.stakind1 = 4) THEN s.stanumbers1 + WHEN (s.stakind2 = 4) THEN s.stanumbers2 + WHEN (s.stakind3 = 4) THEN s.stanumbers3 + WHEN (s.stakind4 = 4) THEN s.stanumbers4 + WHEN (s.stakind5 = 4) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_elem_freqs, + CASE + WHEN (s.stakind1 = 5) THEN s.stanumbers1 + WHEN (s.stakind2 = 5) THEN s.stanumbers2 + WHEN (s.stakind3 = 5) THEN s.stanumbers3 + WHEN (s.stakind4 = 5) THEN s.stanumbers4 + WHEN (s.stakind5 = 5) THEN s.stanumbers5 + ELSE NULL::real[] + END AS elem_count_histogram + FROM ((pg_class c + JOIN pg_attribute a ON ((c.oid = a.attrelid))) + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_statistics(c.oid, (a.attnum)::integer, ''::text) s(starelid, staattnum, stainherit, stanullfrac, stawidth, stadistinct, stakind1, stakind2, stakind3, stakind4, stakind5, staop1, staop2, staop3, staop4, staop5, stacoll1, stacoll2, stacoll3, stacoll4, stacoll5, stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5, stavalues1, stavalues2, stavalues3, stavalues4, stavalues5) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND (NOT a.attisdropped) AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); pg_hba_file_rules| SELECT a.line_number, a.type, a.database, diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index d33a4e1..643afe4 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -121,3 +121,10 @@ test: fast_default # run stats by itself because its delay may be insufficient under heavy load test: stats + +# global temp table test +test: gtt_stats +test: gtt_function +test: gtt_prepare +test: gtt_parallel_1 gtt_parallel_2 +test: gtt_clean diff --git a/src/test/regress/sql/gtt_clean.sql b/src/test/regress/sql/gtt_clean.sql new file mode 100644 index 0000000..f3cf710 --- /dev/null +++ b/src/test/regress/sql/gtt_clean.sql @@ -0,0 +1,6 @@ + + +reset search_path; + +drop schema gtt cascade; + diff --git a/src/test/regress/sql/gtt_function.sql b/src/test/regress/sql/gtt_function.sql new file mode 100644 index 0000000..49c3f11 --- /dev/null +++ b/src/test/regress/sql/gtt_function.sql @@ -0,0 +1,163 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_function; + +set search_path=gtt_function,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt_test_rename(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); + +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); + +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); + +-- ERROR +cluster gtt1 using gtt1_pkey; + +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; + +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); + +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); + +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +); + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; +commit; + +select count(*) from p_table01; + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; + +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp); + +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; + +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; + +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); + +--ok +alter table gtt_test_rename rename to gtt_test; + +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); + +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; + +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; +truncate gtt_seq; +select * from gtt_seq order by id; +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; + +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +create index idx_err on gtt1 using gist (a); +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); + +reset search_path; + +drop schema gtt_function cascade; + diff --git a/src/test/regress/sql/gtt_parallel_1.sql b/src/test/regress/sql/gtt_parallel_1.sql new file mode 100644 index 0000000..d7d81de --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_1.sql @@ -0,0 +1,42 @@ + + +set search_path=gtt,sys; + +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +commit; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +rollback; +select * from gtt1 order by a; + +truncate gtt1; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +select * from gtt1 order by a; +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + +begin; +select * from gtt1 order by a; +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +commit; +select * from gtt1 order by a; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_parallel_2.sql b/src/test/regress/sql/gtt_parallel_2.sql new file mode 100644 index 0000000..5203c2b --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_2.sql @@ -0,0 +1,76 @@ + + +set search_path=gtt,sys; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; +commit; +select * from gtt3 order by a; + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +truncate gtt3; +select * from gtt3 order by a; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; +truncate gtt3; +select * from gtt3 order by a; +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +begin; +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_prepare.sql b/src/test/regress/sql/gtt_prepare.sql new file mode 100644 index 0000000..1e4cf27 --- /dev/null +++ b/src/test/regress/sql/gtt_prepare.sql @@ -0,0 +1,16 @@ + +CREATE SCHEMA IF NOT EXISTS gtt; + +set search_path=gtt,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; + diff --git a/src/test/regress/sql/gtt_stats.sql b/src/test/regress/sql/gtt_stats.sql new file mode 100644 index 0000000..f041892 --- /dev/null +++ b/src/test/regress/sql/gtt_stats.sql @@ -0,0 +1,42 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_stats; + +set search_path=gtt_stats,sys; + +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +insert into gtt values(generate_series(1,10000),'test'); + +-- expect 1 +select count(*) from pg_gtt_attached_pids; + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +-- expect 0 +select * from pg_gtt_stats order by tablename; + +analyze gtt; + +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +select * from pg_gtt_stats order by tablename; + +reset search_path; + +drop schema gtt_stats cascade; + ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-21 05:43 Pavel Stehule <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-21 05:43 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Erik Rijkers <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> Hi I have a free time this evening, so I will check this patch I have a one question + /* global temp table get relstats from localhash */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + get_gtt_relstats(RelationGetRelid(rel), + &relpages, &reltuples, &relallvisible, + NULL, NULL); + } + else + { + /* coerce values in pg_class to more desirable types */ + relpages = (BlockNumber) rel->rd_rel->relpages; + reltuples = (double) rel->rd_rel->reltuples; + relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + } Isbn't possible to fill the rd_rel structure too, so this branching can be reduced? Regards Pavel po 20. 1. 2020 v 17:27 odesílatel 曾文旌(义从) <[email protected]> napsal: > > > > 2020年1月20日 上午1:32,Erik Rijkers <[email protected]> 写道: > > > > On 2020-01-19 18:04, 曾文旌(义从) wrote: > >>> 2020年1月14日 下午9:20,Pavel Stehule <[email protected]> 写道: > >>> út 14. 1. 2020 v 14:09 odesílatel 曾文旌(义从) <[email protected] > <mailto:[email protected]>> napsal: > > > >>> [global_temporary_table_v4-pg13.patch ] > > > > Hi, > > > > This patch doesn't quiet apply for me: > > > > patching file src/backend/access/common/reloptions.c > > patching file src/backend/access/gist/gistutil.c > > patching file src/backend/access/hash/hash.c > > Hunk #1 succeeded at 149 (offset 3 lines). > > patching file src/backend/access/heap/heapam_handler.c > > patching file src/backend/access/heap/vacuumlazy.c > > patching file src/backend/access/nbtree/nbtpage.c > > patching file src/backend/access/table/tableam.c > > patching file src/backend/access/transam/xlog.c > > patching file src/backend/catalog/Makefile > > Hunk #1 FAILED at 44. > > 1 out of 1 hunk FAILED -- saving rejects to file > src/backend/catalog/Makefile.rej > > [...] > > (The rest applies without errors) > > > > src/backend/catalog/Makefile.rej contains: > > > > ------------------------ > > --- src/backend/catalog/Makefile > > +++ src/backend/catalog/Makefile > > @@ -44,6 +44,8 @@ OBJS = \ > > storage.o \ > > toasting.o > > > > +OBJS += storage_gtt.o > > + > > BKIFILES = postgres.bki postgres.description postgres.shdescription > > > > include $(top_srcdir)/src/backend/common.mk > > ------------------------ > > > > Can you have a look? > I updated the code and remade the patch. > Please give me feedback if you have any more questions. > > > > > > > > > > thanks, > > > > Erik Rijkers > > > > > > > > > > > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-21 08:45 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Pavel Stehule <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-21 08:45 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月12日 上午4:27,Pavel Stehule <[email protected]> 写道: > > Hi > > so 11. 1. 2020 v 15:00 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: > Hi all > > This is the latest patch > > The updates are as follows: > 1. Support global temp Inherit table global temp partition table > 2. Support serial column in GTT > 3. Provide views pg_gtt_relstats pg_gtt_stats for GTT’s statistics > 4. Provide view pg_gtt_attached_pids to manage GTT > 5. Provide function pg_list_gtt_relfrozenxids() to manage GTT > 6. Alter GTT or rename GTT is allowed under some conditions > > > Please give me feedback. > > I tested the functionality > > 1. i think so "ON COMMIT PRESERVE ROWS" should be default mode (like local temp tables). ON COMMIT PRESERVE ROWS is default mode now. Wenjing > > I tested some simple scripts > > test01.sql > > CREATE TEMP TABLE foo(a int, b int); > INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); > ANALYZE foo; > SELECT sum(a), sum(b) FROM foo; > DROP TABLE foo; -- simulate disconnect > > > after 100 sec, the table pg_attribute has 3.2MB > and 64 tps, 6446 transaction > > test02.sql > > INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); > ANALYZE foo; > SELECT sum(a), sum(b) FROM foo; > DELETE FROM foo; -- simulate disconnect > > > after 100 sec, 1688 tps, 168830 transactions > > So performance is absolutely different as we expected. > > From my perspective, this functionality is great. > > Todo: > > pg_table_size function doesn't work > > Regards > > Pavel > > > Wenjing > > > > > >> 2020年1月6日 上午4:06,Tomas Vondra <[email protected] <mailto:[email protected]>> 写道: >> >> Hi, >> >> I think we need to do something with having two patches aiming to add >> global temporary tables: >> >> [1] https://commitfest.postgresql.org/26/2349/ <https://commitfest.postgresql.org/26/2349/; >> >> [2] https://commitfest.postgresql.org/26/2233/ <https://commitfest.postgresql.org/26/2233/; >> >> As a reviewer I have no idea which of the threads to look at - certainly >> not without reading both threads, which I doubt anyone will really do. >> The reviews and discussions are somewhat intermixed between those two >> threads, which makes it even more confusing. >> >> I think we should agree on a minimal patch combining the necessary/good >> bits from the various patches, and terminate one of the threads (i.e. >> mark it as rejected or RWF). And we need to do that now, otherwise >> there's about 0% chance of getting this into v13. >> >> In general, I agree with the sentiment Rober expressed in [1] - the >> patch needs to be as small as possible, not adding "nice to have" >> features (like support for parallel queries - I very much doubt just >> using shared instead of local buffers is enough to make it work.) >> >> regards >> >> -- >> Tomas Vondra http://www.2ndQuadrant.com <http://www.2ndquadrant.com/; >> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services > Attachments: [application/octet-stream] global_temporary_table_v6-pg13.patch (159.3K, ../../[email protected]/3-global_temporary_table_v6-pg13.patch) download | inline diff: diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 79430d2..b7173c7 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -158,6 +158,19 @@ static relopt_bool boolRelOpts[] = }, true }, + /* + * For global temp table only + * use AccessExclusiveLock for ensure safety + */ + { + { + "on_commit_delete_rows", + "global temp table on commit options", + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, + ShareUpdateExclusiveLock + }, + true + }, /* list terminator */ {{NULL}} }; @@ -1486,6 +1499,8 @@ bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind) { static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)}, {"fillfactor", RELOPT_TYPE_INT, offsetof(StdRdOptions, fillfactor)}, {"autovacuum_enabled", RELOPT_TYPE_BOOL, offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, enabled)}, @@ -1586,13 +1601,18 @@ build_reloptions(Datum reloptions, bool validate, bytea * partitioned_table_reloptions(Datum reloptions, bool validate) { + static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)} + }; + /* * There are no options for partitioned tables yet, but this is able to do * some validation. */ return (bytea *) build_reloptions(reloptions, validate, RELOPT_KIND_PARTITIONED, - 0, NULL, 0); + sizeof(StdRdOptions), tab, lengthof(tab)); } /* diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index dd975b1..1610e7d 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -1013,7 +1013,9 @@ gistGetFakeLSN(Relation rel) { static XLogRecPtr counter = FirstNormalUnloggedLSN; - if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + /* global temp is same as local temp table */ + if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + rel->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { /* * Temporary relations are only accessible in our session, so a simple diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 4871b7f..16b00c9 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -149,7 +149,9 @@ hashbuild(Relation heap, Relation index, IndexInfo *indexInfo) * metapage, nor the first bitmap page. */ sort_threshold = (maintenance_work_mem * 1024L) / BLCKSZ; - if (index->rd_rel->relpersistence != RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + if (!(index->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + index->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) sort_threshold = Min(sort_threshold, NBuffers); else sort_threshold = Min(sort_threshold, NLocBuffer); diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index 1f6f6d0..5727ccd 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -598,7 +598,7 @@ heapam_relation_set_new_filenode(Relation rel, */ *minmulti = GetOldestMultiXactId(); - srel = RelationCreateStorage(*newrnode, persistence); + srel = RelationCreateStorage(*newrnode, persistence, rel); /* * If required, set up an init fork for an unlogged table so that it can @@ -651,7 +651,7 @@ heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index b331f4c..5bd681f 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -79,6 +79,7 @@ #include "utils/pg_rusage.h" #include "utils/timestamp.h" +#include "catalog/storage_gtt.h" /* * Space/time tradeoff parameters: do these need to be user-tunable? @@ -397,8 +398,10 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, Assert(params->truncate != VACOPT_TERNARY_DEFAULT); /* not every AM requires these to be valid, but heap does */ - Assert(TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); - Assert(MultiXactIdIsValid(onerel->rd_rel->relminmxid)); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relfrozenxid == InvalidTransactionId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && TransactionIdIsNormal(onerel->rd_rel->relfrozenxid))); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relminmxid == InvalidMultiXactId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && MultiXactIdIsValid(onerel->rd_rel->relminmxid))); /* measure elapsed time iff autovacuum logging requires it */ if (IsAutoVacuumWorkerProcess() && params->log_min_duration >= 0) @@ -457,8 +460,19 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, vacrelstats = (LVRelStats *) palloc0(sizeof(LVRelStats)); - vacrelstats->old_rel_pages = onerel->rd_rel->relpages; - vacrelstats->old_live_tuples = onerel->rd_rel->reltuples; + /* get relstat from gtt localhash */ + if (RELATION_IS_GLOBAL_TEMP(onerel)) + { + get_gtt_relstats(RelationGetRelid(onerel), + &vacrelstats->old_rel_pages, + &vacrelstats->old_live_tuples, + NULL, NULL, NULL); + } + else + { + vacrelstats->old_rel_pages = onerel->rd_rel->relpages; + vacrelstats->old_live_tuples = onerel->rd_rel->reltuples; + } vacrelstats->num_index_scans = 0; vacrelstats->pages_removed = 0; vacrelstats->lock_waiter_detected = false; diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index f05cbe7..946c9d2 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -763,7 +763,14 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access) /* Read an existing block of the relation */ buf = ReadBuffer(rel, blkno); LockBuffer(buf, access); - _bt_checkpage(rel, buf); + + /* global temp table may be not yet initialized for this backend. */ + if (RELATION_IS_GLOBAL_TEMP(rel) && + blkno == BTREE_METAPAGE && + PageIsNew(BufferGetPage(buf))) + _bt_initmetapage(BufferGetPage(buf), P_NONE, 0); + else + _bt_checkpage(rel, buf); } else { diff --git a/src/backend/access/table/tableam.c b/src/backend/access/table/tableam.c index c814733..ff51840 100644 --- a/src/backend/access/table/tableam.c +++ b/src/backend/access/table/tableam.c @@ -24,6 +24,7 @@ #include "access/heapam.h" /* for ss_* */ #include "access/tableam.h" #include "access/xact.h" +#include "catalog/storage_gtt.h" #include "optimizer/plancat.h" #include "storage/bufmgr.h" #include "storage/shmem.h" @@ -560,10 +561,20 @@ table_block_relation_estimate_size(Relation rel, int32 *attr_widths, /* it should have storage, so we can call the smgr */ curpages = RelationGetNumberOfBlocks(rel); - /* coerce values in pg_class to more desirable types */ - relpages = (BlockNumber) rel->rd_rel->relpages; - reltuples = (double) rel->rd_rel->reltuples; - relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + /* global temp table get relstats from localhash */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + get_gtt_relstats(RelationGetRelid(rel), + &relpages, &reltuples, &relallvisible, + NULL, NULL); + } + else + { + /* coerce values in pg_class to more desirable types */ + relpages = (BlockNumber) rel->rd_rel->relpages; + reltuples = (double) rel->rd_rel->reltuples; + relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + } /* * HACK: if the relation has never yet been vacuumed, use a minimum size diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 7f4f784..aba8a9f 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6327,6 +6327,10 @@ StartupXLOG(void) else recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID; + /* clean temp relation files */ + if (max_active_gtt > 0) + RemovePgTempFiles(); + /* * Check for signal files, and if so set up state for offline recovery */ diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index d5da81c..c753b0e 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -42,6 +42,7 @@ OBJS = \ pg_subscription.o \ pg_type.o \ storage.o \ + storage_gtt.o \ toasting.o include $(top_srcdir)/src/backend/common.mk diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c index 16cb6d8..f28f2c2 100644 --- a/src/backend/catalog/catalog.c +++ b/src/backend/catalog/catalog.c @@ -398,7 +398,9 @@ GetNewRelFileNode(Oid reltablespace, Relation pg_class, char relpersistence) switch (relpersistence) { + /* global temp table is same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); break; case RELPERSISTENCE_UNLOGGED: diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 0fdff29..54a5243 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -61,6 +61,7 @@ #include "catalog/pg_type.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "commands/tablecmds.h" #include "commands/typecmds.h" #include "executor/executor.h" @@ -99,6 +100,7 @@ static void AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -404,6 +406,10 @@ heap_create(const char *relname, relpersistence, relkind); + /* global temp table not create storage file when catalog create */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + create_storage = false; + /* * Have the storage manager create the relation's disk file, if needed. * @@ -427,7 +433,7 @@ heap_create(const char *relname, case RELKIND_INDEX: case RELKIND_SEQUENCE: - RelationCreateStorage(rel->rd_node, relpersistence); + RelationCreateStorage(rel->rd_node, relpersistence, rel); break; case RELKIND_RELATION: @@ -956,6 +962,7 @@ AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -994,8 +1001,18 @@ AddNewRelationTuple(Relation pg_class_desc, break; } - new_rel_reltup->relfrozenxid = relfrozenxid; - new_rel_reltup->relminmxid = relminmxid; + /* global temp table not remember transaction info in catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + new_rel_reltup->relfrozenxid = InvalidTransactionId; + new_rel_reltup->relminmxid = InvalidMultiXactId; + } + else + { + new_rel_reltup->relfrozenxid = relfrozenxid; + new_rel_reltup->relminmxid = relminmxid; + } + new_rel_reltup->relowner = relowner; new_rel_reltup->reltype = new_type_oid; new_rel_reltup->reloftype = reloftype; @@ -1357,6 +1374,7 @@ heap_create_with_catalog(const char *relname, reloftypeid, ownerid, relkind, + relpersistence, relfrozenxid, relminmxid, PointerGetDatum(relacl), @@ -1441,11 +1459,15 @@ heap_create_with_catalog(const char *relname, */ StoreConstraints(new_rel_desc, cooked_constraints, is_internal); - /* - * If there's a special on-commit action, remember it - */ - if (oncommit != ONCOMMIT_NOOP) - register_on_commit_action(relid, oncommit); + /* global temp table register action when storage init */ + if (relpersistence != RELPERSISTENCE_GLOBAL_TEMP) + { + /* + * If there's a special on-commit action, remember it + */ + if (oncommit != ONCOMMIT_NOOP) + register_on_commit_action(relid, oncommit); + } /* * ok, the relation has been cataloged, so close our relations and return @@ -1937,6 +1959,13 @@ heap_drop_with_catalog(Oid relid) if (relid == defaultPartOid) update_default_partition_oid(parentOid, InvalidOid); + /* We allow to drop global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not drop relation when other backend attached this global temp table"); + } + /* * Schedule unlinking of the relation's physical files at commit. */ @@ -3163,9 +3192,10 @@ RemoveStatistics(Oid relid, AttrNumber attnum) * * The routine will truncate and then reconstruct the indexes on * the specified relation. Caller must hold exclusive lock on rel. + * */ static void -RelationTruncateIndexes(Relation heapRelation) +RelationTruncateIndexes(Relation heapRelation, LOCKMODE lockmode) { ListCell *indlist; @@ -3177,7 +3207,7 @@ RelationTruncateIndexes(Relation heapRelation) IndexInfo *indexInfo; /* Open the index relation; use exclusive lock, just to be sure */ - currentIndex = index_open(indexId, AccessExclusiveLock); + currentIndex = index_open(indexId, lockmode); /* * Fetch info needed for index_build. Since we know there are no @@ -3223,8 +3253,13 @@ heap_truncate(List *relids) { Oid rid = lfirst_oid(cell); Relation rel; + LOCKMODE lockmode = AccessExclusiveLock; - rel = table_open(rid, AccessExclusiveLock); + /* truncate global temp table only need RowExclusiveLock */ + if (get_rel_persistence(rid) == RELPERSISTENCE_GLOBAL_TEMP) + lockmode = RowExclusiveLock; + + rel = table_open(rid, lockmode); relations = lappend(relations, rel); } @@ -3257,6 +3292,8 @@ void heap_truncate_one_rel(Relation rel) { Oid toastrelid; + LOCKMODE lockmode = AccessExclusiveLock; + bool truncate_toastrel = false; /* * Truncate the relation. Partitioned tables have no storage, so there is @@ -3265,23 +3302,40 @@ heap_truncate_one_rel(Relation rel) if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) return; + toastrelid = rel->rd_rel->reltoastrelid; + + /* + * Truncate global temp table only need RowExclusiveLock + */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + lockmode = RowExclusiveLock; + if (OidIsValid(toastrelid) && + gtt_storage_attached(toastrelid)) + truncate_toastrel = true; + } + else if (OidIsValid(toastrelid)) + truncate_toastrel = true; + /* Truncate the underlying relation */ table_relation_nontransactional_truncate(rel); /* If the relation has indexes, truncate the indexes too */ - RelationTruncateIndexes(rel); + RelationTruncateIndexes(rel, lockmode); /* If there is a toast table, truncate that too */ - toastrelid = rel->rd_rel->reltoastrelid; - if (OidIsValid(toastrelid)) + if (truncate_toastrel) { - Relation toastrel = table_open(toastrelid, AccessExclusiveLock); + Relation toastrel = table_open(toastrelid, lockmode); table_relation_nontransactional_truncate(toastrel); - RelationTruncateIndexes(toastrel); + RelationTruncateIndexes(toastrel, lockmode); /* keep the lock... */ table_close(toastrel, NoLock); } + + if (RELATION_IS_GLOBAL_TEMP(rel)) + up_gtt_relstats(rel, 0, 0, 0, RecentXmin, InvalidMultiXactId); } /* diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 3e59e64..9867d6f 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -52,6 +52,7 @@ #include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/event_trigger.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -877,6 +878,26 @@ index_create(Relation heapRelation, indexRelationName, RelationGetRelationName(heapRelation)))); } + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + if (accessMethodObjectId != BTREE_AM_OID) + elog(ERROR, "only support btree index on global temp table"); + + /* We allow to create index on global temp table only this session use it */ + if (is_other_backend_use_gtt(heapRelation->rd_node)) + elog(ERROR, "can not create index when have other backend attached this global temp table"); + + /* No support create index on global temp table use concurrent mode yet */ + if (concurrent) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot create indexes on global temporary tables using concurrent mode"))); + + /* if global temp table not init storage, then skip build index */ + if (!gtt_storage_attached(heapRelation->rd_node.relNode)) + flags |= INDEX_CREATE_SKIP_BUILD; + } + /* * construct tuple descriptor for index tuples */ @@ -2045,6 +2066,13 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) */ CheckTableNotInUse(userIndexRelation, "DROP INDEX"); + /* We allow to drop index on global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(userHeapRelation)) + { + if (is_other_backend_use_gtt(userHeapRelation->rd_node)) + elog(ERROR, "can not drop index when other backend attached this global temp table"); + } + /* * Drop Index Concurrently is more or less the reverse process of Create * Index Concurrently. @@ -2736,20 +2764,29 @@ index_update_stats(Relation rel, else /* don't bother for indexes */ relallvisible = 0; - if (rd_rel->relpages != (int32) relpages) + /* update index stats into localhash for global temp table */ + if (RELATION_IS_GLOBAL_TEMP(rel)) { - rd_rel->relpages = (int32) relpages; - dirty = true; + up_gtt_relstats(rel, relpages, reltuples, relallvisible, + InvalidTransactionId, InvalidMultiXactId); } - if (rd_rel->reltuples != (float4) reltuples) - { - rd_rel->reltuples = (float4) reltuples; - dirty = true; - } - if (rd_rel->relallvisible != (int32) relallvisible) + else { - rd_rel->relallvisible = (int32) relallvisible; - dirty = true; + if (rd_rel->relpages != (int32) relpages) + { + rd_rel->relpages = (int32) relpages; + dirty = true; + } + if (rd_rel->reltuples != (float4) reltuples) + { + rd_rel->reltuples = (float4) reltuples; + dirty = true; + } + if (rd_rel->relallvisible != (int32) relallvisible) + { + rd_rel->relallvisible = (int32) relallvisible; + dirty = true; + } } } @@ -2864,6 +2901,12 @@ index_build(Relation heapRelation, pgstat_progress_update_multi_param(6, index, val); } + if (RELATION_IS_GLOBAL_TEMP(indexRelation)) + { + if (!gtt_storage_attached(indexRelation->rd_node.relNode)) + RelationCreateStorage(indexRelation->rd_node, RELPERSISTENCE_GLOBAL_TEMP, indexRelation); + } + /* * Call the access method's build procedure */ @@ -3196,12 +3239,22 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot) /* * Scan the index and gather up all the TIDs into a tuplesort object. */ + memset(&ivinfo, 0, sizeof(IndexVacuumInfo)); ivinfo.index = indexRelation; ivinfo.analyze_only = false; ivinfo.report_progress = true; ivinfo.estimated_count = true; ivinfo.message_level = DEBUG2; - ivinfo.num_heap_tuples = heapRelation->rd_rel->reltuples; + + /* get relstats abort global temp table from hashtable, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + get_gtt_relstats(RelationGetRelid(heapRelation), + NULL, &ivinfo.num_heap_tuples, NULL, + NULL, NULL); + } + else + ivinfo.num_heap_tuples = heapRelation->rd_rel->reltuples; ivinfo.strategy = NULL; /* @@ -3459,6 +3512,15 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence, errmsg("cannot reindex temporary tables of other sessions"))); /* + * Because global temp table cannot change relfilenode + * no support reindex on global temp table yet. + */ + if (RELATION_IS_GLOBAL_TEMP(iRel)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot reindex global temporary tables"))); + + /* * Also check for active uses of the index in the current transaction; we * don't want to reindex underneath an open indexscan. */ diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index e70243a..301da79 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -647,6 +647,13 @@ RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid) errmsg("cannot create temporary relation in non-temporary schema"))); } break; + /* global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + if (isAnyTempNamespace(nspid)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("cannot create global temp relations in temporary schemas"))); + break; case RELPERSISTENCE_PERMANENT: if (isTempOrTempToastNamespace(nspid)) newRelation->relpersistence = RELPERSISTENCE_TEMP; diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index fddfbf1..03806ae 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -26,6 +26,7 @@ #include "access/xlogutils.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "storage/freespace.h" #include "storage/smgr.h" @@ -73,9 +74,10 @@ static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */ * * This function is transactional. The creation is WAL-logged, and if the * transaction aborts later on, the storage will be destroyed. + * */ SMgrRelation -RelationCreateStorage(RelFileNode rnode, char relpersistence) +RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel) { PendingRelDelete *pending; SMgrRelation srel; @@ -85,6 +87,8 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) switch (relpersistence) { case RELPERSISTENCE_TEMP: + /* global temp table use same storage strategy as local temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); needs_wal = false; break; @@ -117,6 +121,10 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) pending->next = pendingDeletes; pendingDeletes = pending; + /* remember global temp table storage info to localhash */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && rel) + remember_gtt_storage_info(rnode, rel); + return srel; } @@ -486,8 +494,15 @@ smgrDoPendingDeletes(bool isCommit) smgrdounlinkall(srels, nrels, false); for (i = 0; i < nrels; i++) + { smgrclose(srels[i]); + /* clean global temp table flags when transaction commit or rollback */ + if (SmgrIsTemp(srels[i]) && + gtt_storage_attached(srels[i]->smgr_rnode.node.relNode)) + forget_gtt_storage_info(srels[i]->smgr_rnode.node.relNode); + } + pfree(srels); } } diff --git a/src/backend/catalog/storage_gtt.c b/src/backend/catalog/storage_gtt.c new file mode 100644 index 0000000..f489cd3 --- /dev/null +++ b/src/backend/catalog/storage_gtt.c @@ -0,0 +1,1129 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.c + * code to create and destroy physical storage for global temparary table + * + * IDENTIFICATION + * src/backend/catalog/storage_gtt.c + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "access/table.h" +#include "access/visibilitymap.h" +#include "access/xact.h" +#include "access/xlog.h" +#include "access/xloginsert.h" +#include "access/xlogutils.h" +#include "access/htup_details.h" +#include "access/multixact.h" +#include "catalog/storage.h" +#include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" +#include "catalog/heap.h" +#include "catalog/namespace.h" +#include "catalog/pg_type.h" +#include "catalog/pg_statistic.h" +#include "commands/tablecmds.h" +#include "funcapi.h" +#include "nodes/primnodes.h" +#include "nodes/pg_list.h" +#include "nodes/execnodes.h" +#include "miscadmin.h" +#include "storage/freespace.h" +#include "storage/smgr.h" +#include "storage/ipc.h" +#include "storage/proc.h" +#include "storage/procarray.h" +#include "storage/lwlock.h" +#include "storage/shmem.h" +#include "storage/sinvaladt.h" +#include "utils/memutils.h" +#include "utils/rel.h" +#include "utils/hsearch.h" +#include "utils/catcache.h" +#include "utils/lsyscache.h" +#include <utils/relcache.h> +#include "utils/inval.h" +#include "utils/guc.h" + + +/* Copy from bitmapset.c, because gtt used the function in bitmapset.c */ +#define WORDNUM(x) ((x) / BITS_PER_BITMAPWORD) +#define BITNUM(x) ((x) % BITS_PER_BITMAPWORD) + +#define BITMAPSET_SIZE(nwords) \ + (offsetof(Bitmapset, words) + (nwords) * sizeof(bitmapword)) + +static bool gtt_cleaner_exit_registered = false; +static HTAB *gtt_storage_local_hash = NULL; +static HTAB *active_gtt_shared_hash = NULL; +static MemoryContext gtt_relstats_context = NULL; + +/* relfrozenxid of all gtts in the current session */ +static List *gtt_session_relfrozenxid_list = NIL; +static TransactionId gtt_session_frozenxid = InvalidTransactionId; + +typedef struct gtt_ctl_data +{ + LWLock lock; + int max_entry; + int entry_size; +}gtt_ctl_data; + +static gtt_ctl_data *gtt_shared_ctl = NULL; + +typedef struct +{ + RelFileNode rnode; + Bitmapset *map; + /* bitmap data */ +} gtt_shared_hash_entry; + +typedef struct +{ + Oid relid; + + Oid spcnode; + /* pg_class stat */ + int32 relpages; + float4 reltuples; + int32 relallvisible; + TransactionId relfrozenxid; + TransactionId relminmxid; + char relkind; + bool on_commit_delete; + + /* pg_statistic */ + int natts; + int *attnum; + HeapTuple *att_stat_tups; +} gtt_local_hash_entry; + +static Size action_gtt_shared_hash_entry_size(void); +static void gtt_storage_checkin(RelFileNode rnode); +static void gtt_storage_checkout(RelFileNode rnode, bool skiplock); +static void gtt_storage_removeall(int code, Datum arg); +static void insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid); +static void remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid); +static void set_gtt_session_relfrozenxid(void); + +Datum pg_get_gtt_statistics(PG_FUNCTION_ARGS); +Datum pg_get_gtt_relstats(PG_FUNCTION_ARGS); +Datum pg_gtt_attached_pid(PG_FUNCTION_ARGS); +Datum pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS); + + +static Size +action_gtt_shared_hash_entry_size(void) +{ + int wordnum; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + wordnum = WORDNUM(MaxBackends + 1); + hash_entry_size += MAXALIGN(sizeof(gtt_shared_hash_entry)); + hash_entry_size += MAXALIGN(BITMAPSET_SIZE(wordnum + 1)); + + return hash_entry_size; +} + +Size +active_gtt_shared_hash_size(void) +{ + Size size = 0; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + size = MAXALIGN(sizeof(gtt_ctl_data)); + hash_entry_size = action_gtt_shared_hash_entry_size(); + size += hash_estimate_size(max_active_gtt, hash_entry_size); + + return size; +} + +void +active_gtt_shared_hash_init(void) +{ + HASHCTL info; + bool found; + + if (max_active_gtt <= 0) + return; + + gtt_shared_ctl = + ShmemInitStruct("gtt_shared_ctl", + sizeof(gtt_ctl_data), + &found); + + if (!found) + { + LWLockRegisterTranche(LWTRANCHE_GTT_CTL, "gtt_shared_ctl"); + LWLockInitialize(>t_shared_ctl->lock, LWTRANCHE_GTT_CTL); + gtt_shared_ctl->max_entry = max_active_gtt; + gtt_shared_ctl->entry_size = action_gtt_shared_hash_entry_size(); + } + + info.keysize = sizeof(RelFileNode); + info.entrysize = gtt_shared_ctl->entry_size; + active_gtt_shared_hash = + ShmemInitHash("active gtt shared hash", + gtt_shared_ctl->max_entry, + gtt_shared_ctl->max_entry, + &info, HASH_ELEM | HASH_BLOBS | HASH_FIXED_SIZE); +} + +static void +gtt_storage_checkin(RelFileNode rnode) +{ + gtt_shared_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + entry = (gtt_shared_hash_entry *) hash_search(active_gtt_shared_hash, + &rnode, HASH_ENTER_NULL, &found); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of shared memory"), + errhint("You might need to increase max_active_gtt."))); + } + + if (found == false) + { + int wordnum; + + entry->map = (Bitmapset *)((char *)entry + MAXALIGN(sizeof(gtt_shared_hash_entry))); + wordnum = WORDNUM(MaxBackends + 1); + memset(entry->map, 0, BITMAPSET_SIZE(wordnum + 1)); + entry->map->nwords = wordnum + 1; + } + + bms_add_member(entry->map, MyBackendId); + LWLockRelease(>t_shared_ctl->lock); +} + +static void +gtt_storage_checkout(RelFileNode rnode, bool skiplock) +{ + gtt_shared_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (!skiplock) + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + + entry = hash_search(active_gtt_shared_hash, + (void *) &(rnode), HASH_FIND, NULL); + + if (entry == NULL) + { + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + elog(WARNING, "relfilenode %u/%u/%u not exist in gtt shared hash when forget", + rnode.dbNode, rnode.spcNode, rnode.relNode); + return; + } + + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + bms_del_member(entry->map, MyBackendId); + + if (bms_is_empty(entry->map)) + { + if (!hash_search(active_gtt_shared_hash, &rnode, HASH_REMOVE, NULL)) + elog(PANIC, "gtt shared hash table corrupted"); + } + + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + return; +} + +Bitmapset * +copy_active_gtt_bitmap(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + Bitmapset *map_copy = NULL; + + if (max_active_gtt <= 0) + return NULL; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return NULL; + } + + Assert(entry->map); + if (!bms_is_empty(entry->map)) + map_copy = bms_copy(entry->map); + + LWLockRelease(>t_shared_ctl->lock); + + return map_copy; +} + +bool +is_other_backend_use_gtt(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + bool in_use = false; + int num_use = 0; + + if (max_active_gtt <= 0) + return false; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return false; + } + + Assert(entry->map); + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + + num_use = bms_num_members(entry->map); + if (num_use == 0) + in_use = false; + else if (num_use == 1) + { + if(bms_is_member(MyBackendId, entry->map)) + in_use = false; + else + in_use = true; + } + else + in_use = true; + + LWLockRelease(>t_shared_ctl->lock); + + return in_use; +} + +void +remember_gtt_storage_info(RelFileNode rnode, Relation rel) +{ + gtt_local_hash_entry *entry; + MemoryContext oldcontext; + Oid relid = rnode.relNode; + bool found; + + if (max_active_gtt <= 0) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Global temporary table feature is disable"), + errhint("You might need to increase max_active_gtt to enable this feature."))); + + if (RecoveryInProgress()) + elog(ERROR, "readonly mode not support access global temp table yet"); + + if (gtt_storage_local_hash == NULL) + { +#define GTT_LOCAL_HASH_SIZE 1024 + /* First time through: initialize the hash table */ + HASHCTL ctl; + + MemSet(&ctl, 0, sizeof(ctl)); + ctl.keysize = sizeof(Oid); + ctl.entrysize = sizeof(gtt_local_hash_entry); + gtt_storage_local_hash = + hash_create("global temp relation table", + GTT_LOCAL_HASH_SIZE, + &ctl, HASH_ELEM | HASH_BLOBS); + + if (!CacheMemoryContext) + CreateCacheMemoryContext(); + + gtt_relstats_context = + AllocSetContextCreate(CacheMemoryContext, + "gtt relstats context", + ALLOCSET_DEFAULT_SIZES); + } + + /* Look up or create an entry */ + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_ENTER, &found); + + if (found) + { + elog(ERROR, "backend %d relid %u already exists in global temp table local hash", + MyBackendId, relid); + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + + entry->spcnode = rnode.spcNode; + entry->relpages = 0; + entry->reltuples = 0; + entry->relallvisible = 0; + entry->relkind = rel->rd_rel->relkind; + /* only heap contain transaction information */ + if (entry->relkind == RELKIND_RELATION || entry->relkind == RELKIND_PARTITIONED_TABLE) + { + int natts = RelationGetNumberOfAttributes(rel); + entry->natts = natts; + entry->attnum = palloc0(sizeof(int) * natts); + entry->att_stat_tups = palloc0(sizeof(HeapTuple) * natts); + + if (RELATION_GTT_ON_COMMIT_DELETE(rel)) + { + entry->on_commit_delete = true; + register_on_commit_action(rel->rd_node.relNode, ONCOMMIT_DELETE_ROWS); + } + + entry->relfrozenxid = RecentXmin; + entry->relminmxid = GetOldestMultiXactId(); + insert_gtt_relfrozenxid_to_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + gtt_storage_checkin(rnode); + } + else + { + entry->natts = 0; + entry->attnum = 0; + entry->att_stat_tups = NULL; + entry->on_commit_delete = false; + entry->relfrozenxid = 0; + entry->relminmxid = 0; + } + + MemoryContextSwitchTo(oldcontext); + + if (!gtt_cleaner_exit_registered) + { + before_shmem_exit(gtt_storage_removeall, 0); + gtt_cleaner_exit_registered = true; + } + + return; +} + +void +forget_gtt_storage_info(Oid relid) +{ + gtt_local_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, NULL); + + if (entry && entry->relkind == RELKIND_RELATION) + { + RelFileNode rnode; + int i; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + gtt_storage_checkout(rnode, false); + + Assert(TransactionIdIsNormal(entry->relfrozenxid)); + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + + for (i = 0; i < entry->natts; i++) + { + if (entry->att_stat_tups[i]) + { + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + } + } + } + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_REMOVE, NULL); + + return; +} + +/* is the storage file was created in this backend */ +bool +gtt_storage_attached(Oid relid) +{ + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, &found); + + return found; +} + +static void +gtt_storage_removeall(int code, Datum arg) +{ + HASH_SEQ_STATUS status; + gtt_local_hash_entry *entry; + int nrels = 0, + maxrels = 0; + SMgrRelation *srels = NULL; + RelFileNode *rnodes = NULL; + char *relkinds = NULL; + + if (gtt_storage_local_hash == NULL) + return; + + hash_seq_init(&status, gtt_storage_local_hash); + while ((entry = (gtt_local_hash_entry *) hash_seq_search(&status)) != NULL) + { + SMgrRelation srel; + RelFileNode rnode; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + srel = smgropen(rnode, MyBackendId); + + /* allocate the initial array, or extend it, if needed */ + if (maxrels == 0) + { + maxrels = 32; + srels = palloc(sizeof(SMgrRelation) * maxrels); + rnodes = palloc(sizeof(RelFileNode) * maxrels); + relkinds = palloc(sizeof(char) * maxrels); + } + else if (maxrels <= nrels) + { + maxrels *= 2; + srels = repalloc(srels, sizeof(SMgrRelation) * maxrels); + rnodes = repalloc(rnodes, sizeof(RelFileNode) * maxrels); + relkinds = repalloc(relkinds, sizeof(char) * maxrels); + } + + srels[nrels] = srel; + rnodes[nrels] = rnode; + relkinds[nrels] = entry->relkind; + nrels++; + } + + if (nrels > 0) + { + int i; + + smgrdounlinkall(srels, nrels, false); + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + for (i = 0; i < nrels; i++) + { + smgrclose(srels[i]); + if (relkinds[i] == RELKIND_RELATION) + gtt_storage_checkout(rnodes[i], true); + } + LWLockRelease(>t_shared_ctl->lock); + + pfree(srels); + pfree(rnodes); + pfree(relkinds); + } + + MyProc->session_gtt_frozenxid = InvalidTransactionId; + + return; +} + +/* + * Update global temp table relstats(relpage/reltuple/relallvisible) + * to local hashtable + */ +void +up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid) +{ + Oid relid = RelationGetRelid(relation); + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return; + + Assert(entry->spcnode); + + if (num_pages >= 0 && + entry->relpages != (int32)num_pages) + entry->relpages = (int32)num_pages; + + if (num_tuples >= 0 && + num_tuples != (float4)entry->reltuples) + entry->reltuples = (float4)num_tuples; + + /* only heap contain transaction information and relallvisible */ + if (entry->relkind == RELKIND_RELATION) + { + if (entry->relallvisible >= 0 && + entry->relallvisible != (int32)num_all_visible_pages) + { + entry->relallvisible = (int32)num_all_visible_pages; + } + + if (TransactionIdIsNormal(relfrozenxid) && + entry->relfrozenxid != relfrozenxid && + (TransactionIdPrecedes(entry->relfrozenxid, relfrozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), entry->relfrozenxid))) + { + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + entry->relfrozenxid = relfrozenxid; + insert_gtt_relfrozenxid_to_ordered_list(relfrozenxid); + set_gtt_session_relfrozenxid(); + } + + if (MultiXactIdIsValid(relminmxid) && + entry->relminmxid != relminmxid && + (MultiXactIdPrecedes(entry->relminmxid, relminmxid) || + MultiXactIdPrecedes(ReadNextMultiXactId(), entry->relminmxid))) + { + entry->relminmxid = relminmxid; + } + } + + return; +} + +/* + * Search global temp table relstats(relpage/reltuple/relallvisible) + * from local hashtable. + */ +bool +get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid) +{ + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return false; + + Assert(entry->relid == relid); + + if (relpages) + *relpages = entry->relpages; + + if (reltuples) + *reltuples = entry->reltuples; + + if (relallvisible) + *relallvisible = entry->relallvisible; + + if (relfrozenxid) + *relfrozenxid = entry->relfrozenxid; + + if (relminmxid) + *relminmxid = entry->relminmxid; + + return true; +} + +/* + * Update global temp table statistic info(definition is same as pg_statistic) + * to local hashtable where ananyze global temp table + */ +void +up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull) +{ + gtt_local_hash_entry *entry; + bool found; + MemoryContext oldcontext; + int i = 0; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return; + + if (entry->relkind != RELKIND_RELATION) + { + elog(WARNING, "oid %u not a relation", reloid); + return; + } + + /* todo */ + if (entry->natts < natts) + { + elog(WARNING, "reloid %u not support update attstat after add colunm", reloid); + return; + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + Assert(entry->relid == reloid); + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == 0) + { + entry->attnum[i] = attnum; + break; + } + else if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + break; + } + } + + Assert(i < entry->natts); + Assert(entry->att_stat_tups[i] == NULL); + entry->att_stat_tups[i] = heap_form_tuple(tupleDescriptor, values, isnull); + MemoryContextSwitchTo(oldcontext); + + return; +} + +/* + * Search global temp table statistic info(definition is same as pg_statistic) + * from local hashtable. + */ +HeapTuple +get_gtt_att_statistic(Oid reloid, int attnum, bool inh) +{ + gtt_local_hash_entry *entry; + bool found; + int i = 0; + + if (max_active_gtt <= 0) + return NULL; + + if (gtt_storage_local_hash == NULL) + return NULL; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return NULL; + + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + return entry->att_stat_tups[i]; + } + } + + return NULL; +} + +void +release_gtt_statistic_cache(HeapTuple tup) +{ + /* do nothing */ + return; +} + +static void +insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid) +{ + MemoryContext oldcontext; + ListCell *cell; + int i; + + Assert(TransactionIdIsNormal(relfrozenxid)); + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + /* Does the datum belong at the front? */ + if (gtt_session_relfrozenxid_list == NIL || + TransactionIdFollowsOrEquals(relfrozenxid, + linitial_oid(gtt_session_relfrozenxid_list))) + { + gtt_session_relfrozenxid_list = + lcons_oid(relfrozenxid, gtt_session_relfrozenxid_list); + MemoryContextSwitchTo(oldcontext); + + return; + } + + /* No, so find the entry it belongs after */ + i = 0; + foreach (cell, gtt_session_relfrozenxid_list) + { + if (TransactionIdFollowsOrEquals(relfrozenxid, lfirst_oid(cell))) + break; + + i++; + } + gtt_session_relfrozenxid_list = + list_insert_nth_oid(gtt_session_relfrozenxid_list, i, relfrozenxid); + MemoryContextSwitchTo(oldcontext); + + return; +} + +static void +remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid) +{ + gtt_session_relfrozenxid_list = + list_delete_oid(gtt_session_relfrozenxid_list, relfrozenxid); +} + +static void +set_gtt_session_relfrozenxid(void) +{ + TransactionId gtt_frozenxid = InvalidTransactionId; + + if (gtt_session_relfrozenxid_list) + gtt_frozenxid = llast_oid(gtt_session_relfrozenxid_list); + + gtt_session_frozenxid = gtt_frozenxid; + if (MyProc->session_gtt_frozenxid != gtt_frozenxid) + MyProc->session_gtt_frozenxid = gtt_frozenxid; +} + +Datum +pg_get_gtt_statistics(PG_FUNCTION_ARGS) +{ + HeapTuple tuple; + Relation rel = NULL; + int attnum = PG_GETARG_INT32(1); + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + MemoryContext oldcontext; + Tuplestorestate *tupstore; + Relation pg_tatistic = NULL; + TupleDesc sd; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not " \ + "allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + pg_tatistic = table_open(StatisticRelationId, AccessShareLock); + sd = RelationGetDescr(pg_tatistic); + + tuple = get_gtt_att_statistic(reloid, attnum, false); + if (tuple) + { + Datum values[31]; + bool isnull[31]; + HeapTuple res = NULL; + + memset(&values, 0, sizeof(values)); + memset(&isnull, 0, sizeof(isnull)); + heap_deform_tuple(tuple, sd, values, isnull); + res = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, res); + } + + table_close(rel, NoLock); + table_close(pg_tatistic, AccessShareLock); + tuplestore_donestoring(tupstore); + + return (Datum) 0; +} + +Datum +pg_get_gtt_relstats(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + uint32 relfrozenxid = 0; + uint32 relminmxid = 0; + Relation rel = NULL; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + if (get_gtt_relstats(reloid, + &relpages, &reltuples, &relallvisible, + &relfrozenxid, &relminmxid)) + { + Datum values[5]; + bool isnull[5]; + + memset(isnull, 0, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(relpages); + values[1] = Float4GetDatum((float4)reltuples); + values[2] = Int32GetDatum(relallvisible); + values[3] = UInt32GetDatum(relfrozenxid); + values[4] = UInt32GetDatum(relminmxid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_gtt_attached_pid(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + Relation rel = NULL; + PGPROC *proc = NULL; + Bitmapset *map = NULL; + pid_t pid = 0; + int backendid = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + map = copy_active_gtt_bitmap(rel->rd_node); + if (map) + { + backendid = bms_first_member(map); + + do + { + proc = BackendIdGetProc(backendid); + pid = proc->pid; + if (pid > 0) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = UInt32GetDatum(reloid); + values[1] = Int32GetDatum(pid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + backendid = bms_next_member(map, backendid); + } while (backendid > 0); + + pfree(map); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + int num_xid = MaxBackends + 1; + int *pids = NULL; + uint32 *xids = NULL; + int i = 0; + int j = 0; + uint32 oldest = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + if (max_active_gtt <= 0) + return (Datum) 0; + + if (RecoveryInProgress()) + return (Datum) 0; + + pids = palloc0(sizeof(int) * num_xid); + xids = palloc0(sizeof(int) * num_xid); + oldest = list_all_session_gtt_frozenxids(num_xid, pids, xids, &i); + if (i > 0) + { + if (i > 0) + { + pids[i] = 0; + xids[i] = oldest; + i++; + } + + for(j = 0; j < i; j++) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(pids[j]); + values[1] = UInt32GetDatum(xids[j]); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + } + tuplestore_donestoring(tupstore); + pfree(pids); + pfree(xids); + + return (Datum) 0; +} + diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index c9e75f4..2adde62 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -186,6 +186,91 @@ CREATE OR REPLACE VIEW pg_sequences AS WHERE NOT pg_is_other_temp_schema(N.oid) AND relkind = 'S'; +-- For global temporary table +CREATE VIEW pg_gtt_relstats WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_relstats(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_attached_pids WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_gtt_attached_pid(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_stats WITH (security_barrier) AS +SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN s.stakind1 = 1 THEN s.stavalues1 + WHEN s.stakind2 = 1 THEN s.stavalues2 + WHEN s.stakind3 = 1 THEN s.stavalues3 + WHEN s.stakind4 = 1 THEN s.stavalues4 + WHEN s.stakind5 = 1 THEN s.stavalues5 + END AS most_common_vals, + CASE + WHEN s.stakind1 = 1 THEN s.stanumbers1 + WHEN s.stakind2 = 1 THEN s.stanumbers2 + WHEN s.stakind3 = 1 THEN s.stanumbers3 + WHEN s.stakind4 = 1 THEN s.stanumbers4 + WHEN s.stakind5 = 1 THEN s.stanumbers5 + END AS most_common_freqs, + CASE + WHEN s.stakind1 = 2 THEN s.stavalues1 + WHEN s.stakind2 = 2 THEN s.stavalues2 + WHEN s.stakind3 = 2 THEN s.stavalues3 + WHEN s.stakind4 = 2 THEN s.stavalues4 + WHEN s.stakind5 = 2 THEN s.stavalues5 + END AS histogram_bounds, + CASE + WHEN s.stakind1 = 3 THEN s.stanumbers1[1] + WHEN s.stakind2 = 3 THEN s.stanumbers2[1] + WHEN s.stakind3 = 3 THEN s.stanumbers3[1] + WHEN s.stakind4 = 3 THEN s.stanumbers4[1] + WHEN s.stakind5 = 3 THEN s.stanumbers5[1] + END AS correlation, + CASE + WHEN s.stakind1 = 4 THEN s.stavalues1 + WHEN s.stakind2 = 4 THEN s.stavalues2 + WHEN s.stakind3 = 4 THEN s.stavalues3 + WHEN s.stakind4 = 4 THEN s.stavalues4 + WHEN s.stakind5 = 4 THEN s.stavalues5 + END AS most_common_elems, + CASE + WHEN s.stakind1 = 4 THEN s.stanumbers1 + WHEN s.stakind2 = 4 THEN s.stanumbers2 + WHEN s.stakind3 = 4 THEN s.stanumbers3 + WHEN s.stakind4 = 4 THEN s.stanumbers4 + WHEN s.stakind5 = 4 THEN s.stanumbers5 + END AS most_common_elem_freqs, + CASE + WHEN s.stakind1 = 5 THEN s.stanumbers1 + WHEN s.stakind2 = 5 THEN s.stanumbers2 + WHEN s.stakind3 = 5 THEN s.stanumbers3 + WHEN s.stakind4 = 5 THEN s.stanumbers4 + WHEN s.stakind5 = 5 THEN s.stanumbers5 + END AS elem_count_histogram + FROM + pg_class c + JOIN pg_attribute a ON c.oid = a.attrelid + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_statistics(c.oid, a.attnum, ''::text) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') and NOT a.attisdropped AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + CREATE VIEW pg_stats WITH (security_barrier) AS SELECT nspname AS schemaname, diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index c4420dd..a789718 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -66,6 +66,7 @@ #include "utils/syscache.h" #include "utils/timestamp.h" +#include "catalog/storage_gtt.h" /* Per-index data for ANALYZE */ typedef struct AnlIndexData @@ -103,7 +104,7 @@ static int acquire_inherited_sample_rows(Relation onerel, int elevel, HeapTuple *rows, int targrows, double *totalrows, double *totaldeadrows); static void update_attstats(Oid relid, bool inh, - int natts, VacAttrStats **vacattrstats); + int natts, VacAttrStats **vacattrstats, char relpersistence); static Datum std_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); @@ -586,14 +587,15 @@ do_analyze_rel(Relation onerel, VacuumParams *params, * pg_statistic for columns we didn't process, we leave them alone.) */ update_attstats(RelationGetRelid(onerel), inh, - attr_cnt, vacattrstats); + attr_cnt, vacattrstats, RelationGetRelPersistence(onerel)); for (ind = 0; ind < nindexes; ind++) { AnlIndexData *thisdata = &indexdata[ind]; update_attstats(RelationGetRelid(Irel[ind]), false, - thisdata->attr_cnt, thisdata->vacattrstats); + thisdata->attr_cnt, thisdata->vacattrstats, + RelationGetRelPersistence(Irel[ind])); } /* @@ -673,11 +675,20 @@ do_analyze_rel(Relation onerel, VacuumParams *params, IndexBulkDeleteResult *stats; IndexVacuumInfo ivinfo; + memset(&ivinfo, 0, sizeof(IndexVacuumInfo)); ivinfo.index = Irel[ind]; ivinfo.analyze_only = true; ivinfo.estimated_count = true; ivinfo.message_level = elevel; - ivinfo.num_heap_tuples = onerel->rd_rel->reltuples; + /* get global temp relstats from localhash, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(onerel)) + { + get_gtt_relstats(RelationGetRelid(onerel), + NULL, &ivinfo.num_heap_tuples, NULL, + NULL, NULL); + } + else + ivinfo.num_heap_tuples = onerel->rd_rel->reltuples; ivinfo.strategy = vac_strategy; stats = index_vacuum_cleanup(&ivinfo, NULL); @@ -1456,7 +1467,7 @@ acquire_inherited_sample_rows(Relation onerel, int elevel, * by taking a self-exclusive lock on the relation in analyze_rel(). */ static void -update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) +update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats, char relpersistence) { Relation sd; int attno; @@ -1558,31 +1569,45 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) } } - /* Is there already a pg_statistic tuple for this attribute? */ - oldtup = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(relid), - Int16GetDatum(stats->attr->attnum), - BoolGetDatum(inh)); - - if (HeapTupleIsValid(oldtup)) + /* Update column statistic to localhash, not catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { - /* Yes, replace it */ - stup = heap_modify_tuple(oldtup, - RelationGetDescr(sd), - values, - nulls, - replaces); - ReleaseSysCache(oldtup); - CatalogTupleUpdate(sd, &stup->t_self, stup); + up_gtt_att_statistic(relid, + stats->attr->attnum, + inh, + natts, + RelationGetDescr(sd), + values, + nulls); } else { - /* No, insert new tuple */ - stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); - CatalogTupleInsert(sd, stup); - } + /* Is there already a pg_statistic tuple for this attribute? */ + oldtup = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(relid), + Int16GetDatum(stats->attr->attnum), + BoolGetDatum(inh)); + + if (HeapTupleIsValid(oldtup)) + { + /* Yes, replace it */ + stup = heap_modify_tuple(oldtup, + RelationGetDescr(sd), + values, + nulls, + replaces); + ReleaseSysCache(oldtup); + CatalogTupleUpdate(sd, &stup->t_self, stup); + } + else + { + /* No, insert new tuple */ + stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); + CatalogTupleInsert(sd, stup); + } - heap_freetuple(stup); + heap_freetuple(stup); + } } table_close(sd, RowExclusiveLock); diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index e9d7a7f..3088e26 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -391,6 +391,12 @@ cluster_rel(Oid tableOid, Oid indexOid, int options) errmsg("cannot vacuum temporary tables of other sessions"))); } + /* not support cluster global temp table yet */ + if (RELATION_IS_GLOBAL_TEMP(OldHeap)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("not support cluster global temporary tables yet"))); + /* * Also check for active uses of the relation in the current transaction, * including open scans and pending AFTER trigger events. diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 52ce02f..3d3f7dc 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2583,6 +2583,16 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind, !isTempNamespace(classtuple->relnamespace)) continue; + /* not support reindex on global temp table, so skip it */ + if (classtuple->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + ereport(WARNING, + (errmsg("global temp table \"%s.%s\" skip reindexed", + get_namespace_name(get_rel_namespace(relid)), + get_rel_name(relid)))); + continue; + } + /* Check user/system classification, and optionally skip */ if (objectKind == REINDEX_OBJECT_SYSTEM && !IsSystemClass(relid, classtuple)) diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c index 329ab84..dfa257c 100644 --- a/src/backend/commands/lockcmds.c +++ b/src/backend/commands/lockcmds.c @@ -96,7 +96,8 @@ RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, * transaction. */ relpersistence = get_rel_persistence(relid); - if (relpersistence == RELPERSISTENCE_TEMP) + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPNAMESPACE; /* Check permissions. */ diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 6aab73b..44f350d 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -94,7 +94,7 @@ static HTAB *seqhashtab = NULL; /* hash table for SeqTable items */ */ static SeqTableData *last_used_seq = NULL; -static void fill_seq_with_data(Relation rel, HeapTuple tuple); +static void fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf); static Relation lock_and_open_sequence(SeqTable seq); static void create_seq_hashtable(void); static void init_sequence(Oid relid, SeqTable *p_elm, Relation *p_rel); @@ -108,6 +108,7 @@ static void init_params(ParseState *pstate, List *options, bool for_identity, List **owned_by); static void do_setval(Oid relid, int64 next, bool iscalled); static void process_owned_by(Relation seqrel, List *owned_by, bool for_identity); +int64 get_seqence_start_value(Oid seqid); /* @@ -222,7 +223,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq) /* now initialize the sequence's data */ tuple = heap_form_tuple(tupDesc, value, null); - fill_seq_with_data(rel, tuple); + fill_seq_with_data(rel, tuple, InvalidBuffer); /* process OWNED BY if given */ if (owned_by) @@ -327,7 +328,7 @@ ResetSequence(Oid seq_relid) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seq_rel, tuple); + fill_seq_with_data(seq_rel, tuple, InvalidBuffer); /* Clear local cache so that we don't think we have cached numbers */ /* Note that we do not change the currval() state */ @@ -340,17 +341,21 @@ ResetSequence(Oid seq_relid) * Initialize a sequence's relation with the specified tuple as content */ static void -fill_seq_with_data(Relation rel, HeapTuple tuple) +fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf) { - Buffer buf; Page page; sequence_magic *sm; OffsetNumber offnum; + bool lockBuffer = false; /* Initialize first page of relation with special magic number */ - buf = ReadBuffer(rel, P_NEW); - Assert(BufferGetBlockNumber(buf) == 0); + if (buf == InvalidBuffer) + { + buf = ReadBuffer(rel, P_NEW); + Assert(BufferGetBlockNumber(buf) == 0); + lockBuffer = true; + } page = BufferGetPage(buf); @@ -360,7 +365,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) /* Now insert sequence tuple */ - LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); + if (lockBuffer) + LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); /* * Since VACUUM does not process sequences, we have to force the tuple to @@ -410,7 +416,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) END_CRIT_SECTION(); - UnlockReleaseBuffer(buf); + if (lockBuffer) + UnlockReleaseBuffer(buf); } /* @@ -502,7 +509,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seqrel, newdatatuple); + fill_seq_with_data(seqrel, newdatatuple, InvalidBuffer); } /* process OWNED BY if given */ @@ -1178,6 +1185,25 @@ read_seq_tuple(Relation rel, Buffer *buf, HeapTuple seqdatatuple) LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); page = BufferGetPage(*buf); + if (GlobalTempRelationPageIsNotInitialized(rel, page)) + { + /* Initialize sequence for global temporary tables */ + Datum value[SEQ_COL_LASTCOL] = {0}; + bool null[SEQ_COL_LASTCOL] = {false}; + HeapTuple tuple; + int64 startv = get_seqence_start_value(RelationGetRelid(rel)); + + /* + * last_value from pg_sequence.seqstart + * log_cnt = 0 + * is_called = false + */ + value[SEQ_COL_LASTVAL-1] = Int64GetDatumFast(startv); /* start sequence with 1 */ + + tuple = heap_form_tuple(RelationGetDescr(rel), value, null); + fill_seq_with_data(rel, tuple, *buf); + heap_freetuple(tuple); + } sm = (sequence_magic *) PageGetSpecialPointer(page); if (sm->magic != SEQ_MAGIC) @@ -1954,3 +1980,23 @@ seq_mask(char *page, BlockNumber blkno) mask_unused_space(page); } + +int64 +get_seqence_start_value(Oid seqid) +{ + HeapTuple seqtuple; + Form_pg_sequence seqform; + int64 start; + + seqtuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(seqid)); + if (!HeapTupleIsValid(seqtuple)) + elog(ERROR, "cache lookup failed for sequence %u", + seqid); + + seqform = (Form_pg_sequence) GETSTRUCT(seqtuple); + start = seqform->seqstart; + ReleaseSysCache(seqtuple); + + return start; +} + diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 30b72b6..cc5b991 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -47,6 +47,7 @@ #include "catalog/storage.h" #include "catalog/storage_xlog.h" #include "catalog/toasting.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/comment.h" #include "commands/defrem.h" @@ -552,6 +553,7 @@ static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTbl); static List *GetParentedForeignKeyRefs(Relation partition); static void ATDetachCheckNoForeignKeyRefs(Relation partition); +static bool has_oncommit_option(List *options); /* ---------------------------------------------------------------- @@ -597,6 +599,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, LOCKMODE parentLockmode; const char *accessMethod = NULL; Oid accessMethodId = InvalidOid; + bool has_oncommit_clause = false; /* * Truncate relname to appropriate length (probably a waste of time, as @@ -607,8 +610,10 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Check consistency of arguments */ + /* global temp table same as local temp table */ if (stmt->oncommit != ONCOMMIT_NOOP - && stmt->relation->relpersistence != RELPERSISTENCE_TEMP) + && !(stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("ON COMMIT can only be used on temporary tables"))); @@ -638,7 +643,9 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, * code. This is needed because calling code might not expect untrusted * tables to appear in pg_temp at the front of its search path. */ - if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP + /* global temp table same as local temp table */ + if ((stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) && InSecurityRestrictedOperation()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -739,6 +746,57 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Parse and validate reloptions, if any. */ + /* global temp table */ + has_oncommit_clause = has_oncommit_option(stmt->options); + if (stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (relkind == RELKIND_RELATION || relkind == RELKIND_PARTITIONED_TABLE)) + { + /* inherit table or parition table inherit on commit property from parent table*/ + if (inheritOids && stmt->oncommit == ONCOMMIT_NOOP && !has_oncommit_clause) + { + Oid parent = linitial_oid(inheritOids); + Relation relation = table_open(parent, NoLock); + + if (!RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "The parent table must be global temporary table"); + + if (RELATION_GTT_ON_COMMIT_DELETE(relation)) + stmt->oncommit = ONCOMMIT_DELETE_ROWS; + else + stmt->oncommit = ONCOMMIT_PRESERVE_ROWS; + table_close(relation, NoLock); + } + + if (has_oncommit_clause) + { + if (stmt->oncommit != ONCOMMIT_NOOP) + elog(ERROR, "can not defeine global temp table with on commit and with clause at same time"); + } + else + { + DefElem *opt = makeNode(DefElem); + + opt->type = T_DefElem; + opt->defnamespace = NULL; + opt->defname = "on_commit_delete_rows"; + opt->defaction = DEFELEM_UNSPEC; + + /* use reloptions to remember on commit clause */ + if (stmt->oncommit == ONCOMMIT_DELETE_ROWS) + opt->arg = (Node *)makeString("true"); + else if (stmt->oncommit == ONCOMMIT_PRESERVE_ROWS) + opt->arg = (Node *)makeString("false"); + else if (stmt->oncommit == ONCOMMIT_NOOP) + opt->arg = (Node *)makeString("false"); + else + elog(ERROR, "global temp table not support on commit drop clause"); + + stmt->options = lappend(stmt->options, opt); + } + } + else if (has_oncommit_clause) + elog(ERROR, "regular table cannot specifie on_commit_delete_rows"); + reloptions = transformRelOptions((Datum) 0, stmt->options, NULL, validnsps, true, false); @@ -1800,7 +1858,8 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged, * table or the current physical file to be thrown away anyway. */ if (rel->rd_createSubid == mySubid || - rel->rd_newRelfilenodeSubid == mySubid) + rel->rd_newRelfilenodeSubid == mySubid || + RELATION_IS_GLOBAL_TEMP(rel)) { /* Immediate, non-rollbackable truncation is OK */ heap_truncate_one_rel(rel); @@ -3359,6 +3418,13 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo * specially. */ targetrelation = relation_open(myrelid, is_index ? ShareUpdateExclusiveLock : AccessExclusiveLock); + + if (RELATION_IS_GLOBAL_TEMP(targetrelation)) + { + if (is_other_backend_use_gtt(targetrelation->rd_node)) + elog(ERROR, "can not rename relation when other backend attached this global temp table"); + } + namespaceId = RelationGetNamespace(targetrelation); /* @@ -3534,6 +3600,13 @@ AlterTable(AlterTableStmt *stmt, LOCKMODE lockmode, /* Caller is required to provide an adequate lock. */ rel = relation_open(context->relid, NoLock); + /* We allow to alter global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not alter relation when other backend attached this global temp table"); + } + CheckTableNotInUse(rel, "ALTER TABLE"); ATController(stmt, rel, stmt->cmds, stmt->relation->inh, lockmode, context); @@ -8099,6 +8172,13 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, errmsg("referenced relation \"%s\" is not a table", RelationGetRelationName(pkrel)))); + /* global temp table not support foreign key constraint yet */ + if (RELATION_IS_GLOBAL_TEMP(pkrel)) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("referenced relation \"%s\" is not a global temp table", + RelationGetRelationName(pkrel)))); + if (!allowSystemTableMods && IsSystemRelation(pkrel)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -8138,6 +8218,12 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("constraints on temporary tables must involve temporary tables of this session"))); break; + /* global temp table not support foreign key constraint yet */ + case RELPERSISTENCE_GLOBAL_TEMP: + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("not support foreign key constraints on global temp table yet"))); + break; } /* @@ -13174,7 +13260,7 @@ index_copy_data(Relation rel, RelFileNode newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, @@ -14581,7 +14667,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged) */ switch (rel->rd_rel->relpersistence) { + /* global temp table same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("cannot change logged status of table \"%s\" because it is temporary", @@ -17221,3 +17309,20 @@ ATDetachCheckNoForeignKeyRefs(Relation partition) table_close(rel, NoLock); } } + +static bool +has_oncommit_option(List *options) +{ + ListCell *listptr; + + foreach(listptr, options) + { + DefElem *def = (DefElem *) lfirst(listptr); + + if (pg_strcasecmp(def->defname, "on_commit_delete_rows") == 0) + return true; + } + + return false; +} + diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index d625d17..db966e8 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -35,6 +35,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/defrem.h" #include "commands/vacuum.h" @@ -1125,12 +1126,25 @@ vac_estimate_reltuples(Relation relation, BlockNumber scanned_pages, double scanned_tuples) { - BlockNumber old_rel_pages = relation->rd_rel->relpages; - double old_rel_tuples = relation->rd_rel->reltuples; + BlockNumber old_rel_pages = 0; + double old_rel_tuples = 0; double old_density; double unscanned_pages; double total_tuples; + /* get relstat from gtt local hash */ + if (RELATION_IS_GLOBAL_TEMP(relation)) + { + get_gtt_relstats(RelationGetRelid(relation), + &old_rel_pages, &old_rel_tuples, NULL, + NULL, NULL); + } + else + { + old_rel_pages = relation->rd_rel->relpages; + old_rel_tuples = relation->rd_rel->reltuples; + } + /* If we did scan the whole table, just use the count as-is */ if (scanned_pages >= total_pages) return scanned_tuples; @@ -1230,24 +1244,8 @@ vac_update_relstats(Relation relation, /* Apply statistical updates, if any, to copied tuple */ dirty = false; - if (pgcform->relpages != (int32) num_pages) - { - pgcform->relpages = (int32) num_pages; - dirty = true; - } - if (pgcform->reltuples != (float4) num_tuples) - { - pgcform->reltuples = (float4) num_tuples; - dirty = true; - } - if (pgcform->relallvisible != (int32) num_all_visible_pages) - { - pgcform->relallvisible = (int32) num_all_visible_pages; - dirty = true; - } /* Apply DDL updates, but not inside an outer transaction (see above) */ - if (!in_outer_xact) { /* @@ -1272,37 +1270,64 @@ vac_update_relstats(Relation relation, } } - /* - * Update relfrozenxid, unless caller passed InvalidTransactionId - * indicating it has no new data. - * - * Ordinarily, we don't let relfrozenxid go backwards: if things are - * working correctly, the only way the new frozenxid could be older would - * be if a previous VACUUM was done with a tighter freeze_min_age, in - * which case we don't want to forget the work it already did. However, - * if the stored relfrozenxid is "in the future", then it must be corrupt - * and it seems best to overwrite it with the cutoff we used this time. - * This should match vac_update_datfrozenxid() concerning what we consider - * to be "in the future". - */ - if (TransactionIdIsNormal(frozenxid) && - pgcform->relfrozenxid != frozenxid && - (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || - TransactionIdPrecedes(ReadNewTransactionId(), - pgcform->relfrozenxid))) + /* global temp table remember relstats to localhash not catalog */ + if (RELATION_IS_GLOBAL_TEMP(relation)) { - pgcform->relfrozenxid = frozenxid; - dirty = true; + up_gtt_relstats(relation, + num_pages, num_tuples, + num_all_visible_pages, + frozenxid, minmulti); } - - /* Similarly for relminmxid */ - if (MultiXactIdIsValid(minmulti) && - pgcform->relminmxid != minmulti && - (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || - MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) + else { - pgcform->relminmxid = minmulti; - dirty = true; + if (pgcform->relpages != (int32) num_pages) + { + pgcform->relpages = (int32) num_pages; + dirty = true; + } + if (pgcform->reltuples != (float4) num_tuples) + { + pgcform->reltuples = (float4) num_tuples; + dirty = true; + } + if (pgcform->relallvisible != (int32) num_all_visible_pages) + { + pgcform->relallvisible = (int32) num_all_visible_pages; + dirty = true; + } + + /* + * Update relfrozenxid, unless caller passed InvalidTransactionId + * indicating it has no new data. + * + * Ordinarily, we don't let relfrozenxid go backwards: if things are + * working correctly, the only way the new frozenxid could be older would + * be if a previous VACUUM was done with a tighter freeze_min_age, in + * which case we don't want to forget the work it already did. However, + * if the stored relfrozenxid is "in the future", then it must be corrupt + * and it seems best to overwrite it with the cutoff we used this time. + * This should match vac_update_datfrozenxid() concerning what we consider + * to be "in the future". + */ + if (TransactionIdIsNormal(frozenxid) && + pgcform->relfrozenxid != frozenxid && + (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), + pgcform->relfrozenxid))) + { + pgcform->relfrozenxid = frozenxid; + dirty = true; + } + + /* Similarly for relminmxid */ + if (MultiXactIdIsValid(minmulti) && + pgcform->relminmxid != minmulti && + (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || + MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) + { + pgcform->relminmxid = minmulti; + dirty = true; + } } /* If anything changed, write out the tuple. */ @@ -1394,6 +1419,10 @@ vac_update_datfrozenxid(void) continue; } + /* global temp table relstats not in pg_class */ + if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + continue; + /* * Some table AMs might not need per-relation xid / multixid horizons. * It therefore seems reasonable to allow relfrozenxid and relminmxid @@ -1451,6 +1480,25 @@ vac_update_datfrozenxid(void) Assert(TransactionIdIsNormal(newFrozenXid)); Assert(MultiXactIdIsValid(newMinMulti)); + /* + * Global temp table get frozenxid from MyProc + * to avoid the vacuum truncate clog that gtt need. + */ + if (max_active_gtt > 0) + { + TransactionId oldest_gtt_frozenxid = + list_all_session_gtt_frozenxids(0, NULL, NULL, NULL); + + if (TransactionIdIsNormal(oldest_gtt_frozenxid) && + TransactionIdPrecedes(oldest_gtt_frozenxid, newFrozenXid)) + { + ereport(WARNING, + (errmsg("global temp table oldest FrozenXid is far in the past"), + errhint("please truncate them or kill those sessions that use them."))); + newFrozenXid = oldest_gtt_frozenxid; + } + } + /* Now fetch the pg_database tuple we need to update. */ relation = table_open(DatabaseRelationId, RowExclusiveLock); diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 8286d9c..c3992a4 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -591,6 +591,8 @@ static void set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) { + char relpersistence; + /* * The flag has previously been initialized to false, so we can just * return if it becomes clear that we can't safely set it. @@ -618,7 +620,11 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, * the rest of the necessary infrastructure right now anyway. So * for now, bail out if we see a temporary table. */ - if (get_rel_persistence(rte->relid) == RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + relpersistence = get_rel_persistence(rte->relid); + + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) return; /* diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index d6f2153..310a9e2 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -6312,7 +6312,9 @@ plan_create_index_workers(Oid tableOid, Oid indexOid) * Furthermore, any index predicate or index expressions must be parallel * safe. */ + /* global temp table is same as local temp table */ if (heap->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + heap->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP || !is_parallel_safe(root, (Node *) RelationGetIndexExpressions(index)) || !is_parallel_safe(root, (Node *) RelationGetIndexPredicate(index))) { diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index d82fc5a..189286b 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -31,6 +31,7 @@ #include "catalog/pg_am.h" #include "catalog/pg_proc.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "foreign/fdwapi.h" #include "miscadmin.h" #include "nodes/makefuncs.h" @@ -53,6 +54,7 @@ #include "utils/snapmgr.h" #include "utils/syscache.h" + /* GUC parameter */ int constraint_exclusion = CONSTRAINT_EXCLUSION_PARTITION; @@ -946,10 +948,10 @@ void estimate_rel_size(Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac) { - BlockNumber curpages; - BlockNumber relpages; - double reltuples; - BlockNumber relallvisible; + BlockNumber curpages = 0; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; double density; switch (rel->rd_rel->relkind) @@ -963,6 +965,21 @@ estimate_rel_size(Relation rel, int32 *attr_widths, case RELKIND_INDEX: + /* global temp table get relstats from localhash */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + get_gtt_relstats(RelationGetRelid(rel), + &relpages, &reltuples, &relallvisible, + NULL, NULL); + } + else + { + /* coerce values in pg_class to more desirable types */ + relpages = (BlockNumber) rel->rd_rel->relpages; + reltuples = (double) rel->rd_rel->reltuples; + relallvisible = (BlockNumber) rel->rd_rel->relallvisible; + } + /* * XXX: It'd probably be good to move this into a callback, * individual index types e.g. know if they have a metapage. @@ -971,11 +988,6 @@ estimate_rel_size(Relation rel, int32 *attr_widths, /* it has storage, ok to call the smgr */ curpages = RelationGetNumberOfBlocks(rel); - /* coerce values in pg_class to more desirable types */ - relpages = (BlockNumber) rel->rd_rel->relpages; - reltuples = (double) rel->rd_rel->reltuples; - relallvisible = (BlockNumber) rel->rd_rel->relallvisible; - /* report estimated # pages */ *pages = curpages; /* quick exit if rel is clearly empty */ @@ -985,10 +997,6 @@ estimate_rel_size(Relation rel, int32 *attr_widths, *allvisfrac = 0; break; } - /* coerce values in pg_class to more desirable types */ - relpages = (BlockNumber) rel->rd_rel->relpages; - reltuples = (double) rel->rd_rel->reltuples; - relallvisible = (BlockNumber) rel->rd_rel->relallvisible; /* * Discount the metapage while estimating the number of tuples. diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 748bebf..a5ddbcd 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2579,6 +2579,11 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("materialized views must not use temporary tables or views"))); + if (is_query_using_gtt(query)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialized views must not use global temporary tables or views"))); + /* * A materialized view would either need to save parameters for use in * maintaining/loading the data or prohibit them entirely. The latter diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index ba5916b..0ee6931 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3290,17 +3290,11 @@ OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; } | LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; } | GLOBAL TEMPORARY { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; } | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; } @@ -11588,19 +11582,13 @@ OptTempTableName: } | GLOBAL TEMPORARY opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED opt_table qualified_name { diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index b875a50..123945b 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -81,6 +81,7 @@ static void expandTupleDesc(TupleDesc tupdesc, Alias *eref, List **colnames, List **colvars); static int specialAttNum(const char *attname); static bool isQueryUsingTempRelation_walker(Node *node, void *context); +static bool is_query_using_gtt_walker(Node *node, void *context); /* @@ -3579,3 +3580,49 @@ isQueryUsingTempRelation_walker(Node *node, void *context) isQueryUsingTempRelation_walker, context); } + +/* check if the query uses global temp table */ +static bool +is_query_using_gtt_walker(Node *node, void *context) +{ + if (node == NULL) + return false; + + if (IsA(node, Query)) + { + Query *query = (Query *) node; + ListCell *rtable; + + foreach(rtable, query->rtable) + { + RangeTblEntry *rte = lfirst(rtable); + + if (rte->rtekind == RTE_RELATION) + { + Relation rel = relation_open(rte->relid, AccessShareLock); + char relpersistence = rel->rd_rel->relpersistence; + + relation_close(rel, AccessShareLock); + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + return true; + } + } + + return query_tree_walker(query, + is_query_using_gtt_walker, + context, + QTW_IGNORE_JOINALIASES); + } + + return expression_tree_walker(node, + is_query_using_gtt_walker, + context); +} + +/* check if the query uses global temp table */ +bool +is_query_using_gtt(Query *query) +{ + return is_query_using_gtt_walker((Node *) query, NULL); +} + diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index ee2d2b5..9c9abaa 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -437,6 +437,9 @@ generateSerialExtraStmts(CreateStmtContext *cxt, ColumnDef *column, seqstmt->sequence = makeRangeVar(snamespace, sname, -1); seqstmt->options = seqoptions; + if (cxt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + seqstmt->sequence->relpersistence = cxt->relation->relpersistence; + /* * If a sequence data type was specified, add it to the options. Prepend * to the list rather than append; in case a user supplied their own AS diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 6d1f28c..ed837d1 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2086,6 +2086,11 @@ do_autovacuum(void) } continue; } + else if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + /* autovacuum skip vacuum global temp table */ + continue; + } /* Fetch reloptions and the pgstat entry for this table */ relopts = extract_autovac_opts(tuple, pg_class_desc); @@ -2152,7 +2157,9 @@ do_autovacuum(void) /* * We cannot safely process other backends' temp tables, so skip 'em. */ - if (classForm->relpersistence == RELPERSISTENCE_TEMP) + /* autovacuum skip vacuum global temp table */ + if (classForm->relpersistence == RELPERSISTENCE_TEMP || + classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) continue; relid = classForm->oid; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index aba3960..68adcd5 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -53,6 +53,8 @@ #include "utils/resowner_private.h" #include "utils/timestamp.h" +#include "utils/guc.h" +#include "catalog/storage_gtt.h" /* Note: these two macros only work on shared buffers, not local ones! */ #define BufHdrGetBlock(bufHdr) ((Block) (BufferBlocks + ((Size) (bufHdr)->buf_id) * BLCKSZ)) @@ -432,7 +434,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref) static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, - bool *hit); + bool *hit, Relation rel); static bool PinBuffer(BufferDesc *buf, BufferAccessStrategy strategy); static void PinBuffer_Locked(BufferDesc *buf); static void UnpinBuffer(BufferDesc *buf, bool fixOwner); @@ -664,7 +666,8 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, */ pgstat_count_buffer_read(reln); buf = ReadBuffer_common(reln->rd_smgr, reln->rd_rel->relpersistence, - forkNum, blockNum, mode, strategy, &hit); + forkNum, blockNum, mode, strategy, &hit, + reln); if (hit) pgstat_count_buffer_hit(reln); return buf; @@ -692,7 +695,7 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, Assert(InRecovery); return ReadBuffer_common(smgr, RELPERSISTENCE_PERMANENT, forkNum, blockNum, - mode, strategy, &hit); + mode, strategy, &hit, NULL); } @@ -704,7 +707,8 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, - BufferAccessStrategy strategy, bool *hit) + BufferAccessStrategy strategy, bool *hit, + Relation rel) { BufferDesc *bufHdr; Block bufBlock; @@ -719,6 +723,15 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, isExtend = (blockNum == P_NEW); + /* create storage when first read data page for gtt */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (isExtend || blockNum == 0) && + forkNum == MAIN_FORKNUM && + !gtt_storage_attached(smgr->smgr_rnode.node.relNode)) + { + RelationCreateStorage(smgr->smgr_rnode.node, relpersistence, rel); + } + TRACE_POSTGRESQL_BUFFER_READ_START(forkNum, blockNum, smgr->smgr_rnode.node.spcNode, smgr->smgr_rnode.node.dbNode, @@ -2809,6 +2822,16 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln) BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum) { + /* + * When this backend not init gtt storage + * return 0 + */ + if (RELATION_IS_GLOBAL_TEMP(relation) && + !gtt_storage_attached(relation->rd_node.relNode)) + { + return 0; + } + switch (relation->rd_rel->relkind) { case RELKIND_SEQUENCE: diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c index 427b0d5..7adb969 100644 --- a/src/backend/storage/ipc/ipci.c +++ b/src/backend/storage/ipc/ipci.c @@ -21,6 +21,7 @@ #include "access/nbtree.h" #include "access/subtrans.h" #include "access/twophase.h" +#include "catalog/storage_gtt.h" #include "commands/async.h" #include "miscadmin.h" #include "pgstat.h" @@ -147,6 +148,7 @@ CreateSharedMemoryAndSemaphores(void) size = add_size(size, BTreeShmemSize()); size = add_size(size, SyncScanShmemSize()); size = add_size(size, AsyncShmemSize()); + size = add_size(size, active_gtt_shared_hash_size()); #ifdef EXEC_BACKEND size = add_size(size, ShmemBackendArraySize()); #endif @@ -217,6 +219,8 @@ CreateSharedMemoryAndSemaphores(void) SUBTRANSShmemInit(); MultiXactShmemInit(); InitBufferPool(); + /* global temporary table */ + active_gtt_shared_hash_init(); /* * Set up lock manager diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index c3adb2e..eb95e5f 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -62,6 +62,7 @@ #include "utils/builtins.h" #include "utils/rel.h" #include "utils/snapmgr.h" +#include "utils/guc.h" #define UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) @@ -4087,3 +4088,77 @@ KnownAssignedXidsReset(void) LWLockRelease(ProcArrayLock); } + +/* + * search all active backend to get oldest frozenxid + * for global temp table. + */ +int +list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n) +{ + ProcArrayStruct *arrayP = procArray; + TransactionId result = InvalidTransactionId; + int index; + int flags = 0; + int i = 0; + + if (max_active_gtt <= 0) + return 0; + + if (max_size > 0) + { + Assert(pids); + Assert(xids); + Assert(n); + *n = 0; + } + + if (max_active_gtt <= 0) + return InvalidTransactionId; + + if (RecoveryInProgress()) + return InvalidTransactionId; + + flags |= PROC_IS_AUTOVACUUM; + flags |= PROC_IN_LOGICAL_DECODING; + + LWLockAcquire(ProcArrayLock, LW_SHARED); + if (max_size > 0 && max_size < arrayP->numProcs) + { + LWLockRelease(ProcArrayLock); + elog(ERROR, "list_all_gtt_frozenxids require more array"); + } + + for (index = 0; index < arrayP->numProcs; index++) + { + int pgprocno = arrayP->pgprocnos[index]; + volatile PGPROC *proc = &allProcs[pgprocno]; + volatile PGXACT *pgxact = &allPgXact[pgprocno]; + + if (pgxact->vacuumFlags & flags) + continue; + + if (proc->databaseId == MyDatabaseId && + TransactionIdIsNormal(proc->session_gtt_frozenxid)) + { + if (result == InvalidTransactionId) + result = proc->session_gtt_frozenxid; + else if (TransactionIdPrecedes(proc->session_gtt_frozenxid, result)) + result = proc->session_gtt_frozenxid; + + if (max_size > 0) + { + pids[i] = proc->pid; + xids[i] = proc->session_gtt_frozenxid; + i++; + } + } + } + LWLockRelease(ProcArrayLock); + + if (max_size > 0) + *n = i; + + return result; +} + diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 32df8c8..e4e1125 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -395,6 +395,7 @@ InitProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; @@ -577,6 +578,7 @@ InitAuxiliaryProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index 85b7115..f5eae8c 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -646,6 +646,12 @@ mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, */ if (zero_damaged_pages || InRecovery) MemSet(buffer, 0, BLCKSZ); + else if(SmgrIsTemp(reln) && blocknum == 0 && forknum == MAIN_FORKNUM) + { + /* global temp table init btree meta page */ + MemSet(buffer, 0, BLCKSZ); + mdwrite(reln, forknum, blocknum, buffer, true); + } else ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c index 8406644..92f028e 100644 --- a/src/backend/utils/adt/dbsize.c +++ b/src/backend/utils/adt/dbsize.c @@ -19,6 +19,8 @@ #include "catalog/namespace.h" #include "catalog/pg_authid.h" #include "catalog/pg_tablespace.h" +#include "catalog/storage_gtt.h" +#include "catalog/index.h" #include "commands/dbcommands.h" #include "commands/tablespace.h" #include "miscadmin.h" @@ -262,7 +264,6 @@ pg_tablespace_size_name(PG_FUNCTION_ARGS) PG_RETURN_INT64(size); } - /* * calculate size of (one fork of) a relation * @@ -307,6 +308,41 @@ calculate_relation_size(RelFileNode *rfn, BackendId backend, ForkNumber forknum) return totalsize; } +static int64 +calculate_relation_size_all_file(Relation rel, const Bitmapset *gtt_map) +{ + int64 size = 0; + ForkNumber forkNum; + BackendId backendid; + + /* For global temp table */ + if (gtt_map) + { + Bitmapset *map_copy = bms_copy(gtt_map); + + backendid = bms_first_member(map_copy); + + do + { + for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) + size += calculate_relation_size(&(rel->rd_node), + backendid, + forkNum); + backendid = bms_next_member(map_copy, backendid); + } while (backendid > 0); + + pfree(map_copy); + } + else + { + for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) + size += calculate_relation_size(&(rel->rd_node), + rel->rd_backend, forkNum); + } + + return size; +} + Datum pg_relation_size(PG_FUNCTION_ARGS) { @@ -340,20 +376,17 @@ pg_relation_size(PG_FUNCTION_ARGS) * Must not be applied to non-TOAST relations. */ static int64 -calculate_toast_table_size(Oid toastrelid) +calculate_toast_table_size(Oid toastrelid, Bitmapset *gtt_map) { int64 size = 0; Relation toastRel; - ForkNumber forkNum; ListCell *lc; List *indexlist; toastRel = relation_open(toastrelid, AccessShareLock); /* toast heap size, including FSM and VM size */ - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - size += calculate_relation_size(&(toastRel->rd_node), - toastRel->rd_backend, forkNum); + size += calculate_relation_size_all_file(toastRel, gtt_map); /* toast index size, including FSM and VM size */ indexlist = RelationGetIndexList(toastRel); @@ -365,9 +398,8 @@ calculate_toast_table_size(Oid toastrelid) toastIdxRel = relation_open(lfirst_oid(lc), AccessShareLock); - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - size += calculate_relation_size(&(toastIdxRel->rd_node), - toastIdxRel->rd_backend, forkNum); + + size += calculate_relation_size_all_file(toastIdxRel, gtt_map); relation_close(toastIdxRel, AccessShareLock); } @@ -386,23 +418,20 @@ calculate_toast_table_size(Oid toastrelid) * those won't have attached toast tables, but they can have multiple forks. */ static int64 -calculate_table_size(Relation rel) +calculate_table_size(Relation rel, Bitmapset *gtt_map) { int64 size = 0; - ForkNumber forkNum; /* * heap size, including FSM and VM */ - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - size += calculate_relation_size(&(rel->rd_node), rel->rd_backend, - forkNum); + size += calculate_relation_size_all_file(rel, gtt_map); /* * Size of toast relation */ if (OidIsValid(rel->rd_rel->reltoastrelid)) - size += calculate_toast_table_size(rel->rd_rel->reltoastrelid); + size += calculate_toast_table_size(rel->rd_rel->reltoastrelid, gtt_map); return size; } @@ -413,7 +442,7 @@ calculate_table_size(Relation rel) * Can be applied safely to an index, but you'll just get zero. */ static int64 -calculate_indexes_size(Relation rel) +calculate_indexes_size(Relation rel, Bitmapset *gtt_map) { int64 size = 0; @@ -429,14 +458,10 @@ calculate_indexes_size(Relation rel) { Oid idxOid = lfirst_oid(cell); Relation idxRel; - ForkNumber forkNum; idxRel = relation_open(idxOid, AccessShareLock); - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - size += calculate_relation_size(&(idxRel->rd_node), - idxRel->rd_backend, - forkNum); + size += calculate_relation_size_all_file(idxRel, gtt_map); relation_close(idxRel, AccessShareLock); } @@ -453,16 +478,40 @@ pg_table_size(PG_FUNCTION_ARGS) Oid relOid = PG_GETARG_OID(0); Relation rel; int64 size; + Bitmapset *gtt_map = NULL; rel = try_relation_open(relOid, AccessShareLock); if (rel == NULL) PG_RETURN_NULL(); - size = calculate_table_size(rel); + /* For GTT, calculate the size of the data file in the session where the GTT has been initialized */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (rel->rd_rel->relkind == RELKIND_INDEX) + { + Relation relation; + Oid relid; + + relid = IndexGetRelation(RelationGetRelid(rel), false); + relation = try_relation_open(relid, AccessShareLock); + if (relation) + { + gtt_map = copy_active_gtt_bitmap(relation->rd_node); + relation_close(relation, AccessShareLock); + } + } + else + gtt_map = copy_active_gtt_bitmap(rel->rd_node); + } + + size = calculate_table_size(rel, gtt_map); relation_close(rel, AccessShareLock); + if(gtt_map) + pfree(gtt_map); + PG_RETURN_INT64(size); } @@ -472,16 +521,24 @@ pg_indexes_size(PG_FUNCTION_ARGS) Oid relOid = PG_GETARG_OID(0); Relation rel; int64 size; + Bitmapset *gtt_map = NULL; rel = try_relation_open(relOid, AccessShareLock); if (rel == NULL) PG_RETURN_NULL(); - size = calculate_indexes_size(rel); + /* For GTT, calculate the size of the data file in the session where the GTT has been initialized */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + gtt_map = copy_active_gtt_bitmap(rel->rd_node); + + size = calculate_indexes_size(rel, gtt_map); relation_close(rel, AccessShareLock); + if (gtt_map) + pfree(gtt_map); + PG_RETURN_INT64(size); } @@ -493,17 +550,25 @@ static int64 calculate_total_relation_size(Relation rel) { int64 size; + Bitmapset *gtt_map = NULL; + + /* For GTT, calculate the size of the data file in the session where the GTT has been initialized */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + gtt_map = copy_active_gtt_bitmap(rel->rd_node); /* * Aggregate the table size, this includes size of the heap, toast and * toast index with free space and visibility map */ - size = calculate_table_size(rel); + size = calculate_table_size(rel, gtt_map); /* * Add size of all attached indexes as well */ - size += calculate_indexes_size(rel); + size += calculate_indexes_size(rel, gtt_map); + + if (gtt_map) + pfree(gtt_map); return size; } @@ -1008,6 +1073,10 @@ pg_relation_filepath(PG_FUNCTION_ARGS) Assert(backend != InvalidBackendId); } break; + /* For global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + backend = BackendIdForTempRelations(); + break; default: elog(ERROR, "invalid relpersistence: %c", relform->relpersistence); backend = InvalidBackendId; /* placate compiler */ diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 7c6f057..589bd38 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -142,6 +142,7 @@ #include "utils/timestamp.h" #include "utils/typcache.h" +#include "catalog/storage_gtt.h" /* Hooks for plugins to get control when we ask for stats */ get_relation_stats_hook_type get_relation_stats_hook = NULL; @@ -4578,12 +4579,25 @@ examine_variable(PlannerInfo *root, Node *node, int varRelid, } else if (index->indpred == NIL) { - vardata->statsTuple = - SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(index->indexoid), - Int16GetDatum(pos + 1), - BoolGetDatum(false)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(index->indexoid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = + get_gtt_att_statistic(index->indexoid, + Int16GetDatum(pos + 1), + false); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + vardata->statsTuple = + SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(index->indexoid), + Int16GetDatum(pos + 1), + BoolGetDatum(false)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -4708,15 +4722,27 @@ examine_simple_variable(PlannerInfo *root, Var *var, } else if (rte->rtekind == RTE_RELATION) { - /* - * Plain table or parent of an inheritance appendrel, so look up the - * column in pg_statistic - */ - vardata->statsTuple = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(rte->relid), - Int16GetDatum(var->varattno), - BoolGetDatum(rte->inh)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(rte->relid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = get_gtt_att_statistic(rte->relid, + var->varattno, + rte->inh); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + /* + * Plain table or parent of an inheritance appendrel, so look up the + * column in pg_statistic + */ + vardata->statsTuple = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(rte->relid), + Int16GetDatum(var->varattno), + BoolGetDatum(rte->inh)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -6098,6 +6124,7 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, { /* Simple variable --- look to stats for the underlying table */ RangeTblEntry *rte = planner_rt_fetch(index->rel->relid, root); + char rel_persistence = get_rel_persistence(rte->relid); Assert(rte->rtekind == RTE_RELATION); relid = rte->relid; @@ -6115,6 +6142,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + rte->inh); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -6126,6 +6160,8 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* Expression --- maybe there are stats for the index itself */ relid = index->indexoid; colnum = 1; @@ -6141,6 +6177,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -7054,6 +7097,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, /* attempt to lookup stats in relation for this index column */ if (attnum != 0) { + char rel_persistence = get_rel_persistence(rte->relid); + /* Simple variable -- look to stats for the underlying table */ if (get_relation_stats_hook && (*get_relation_stats_hook) (root, rte, attnum, &vardata)) @@ -7066,6 +7111,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(rte->relid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = @@ -7078,6 +7131,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* * Looks like we've found an expression column in the index. Let's * see if there's any stats for it. @@ -7097,6 +7152,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(index->indexoid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 1e3e6d3..44686ce 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -34,6 +34,7 @@ #include "catalog/pg_statistic.h" #include "catalog/pg_transform.h" #include "catalog/pg_type.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "utils/array.h" @@ -46,6 +47,7 @@ #include "utils/syscache.h" #include "utils/typcache.h" + /* Hook for plugins to get control in get_attavgwidth() */ get_attavgwidth_hook_type get_attavgwidth_hook = NULL; @@ -2878,6 +2880,18 @@ get_attavgwidth(Oid relid, AttrNumber attnum) if (stawidth > 0) return stawidth; } + if (get_rel_persistence(relid) == RELPERSISTENCE_GLOBAL_TEMP) + { + tp = get_gtt_att_statistic(relid, attnum, false); + if (!HeapTupleIsValid(tp)) + return 0; + + stawidth = ((Form_pg_statistic) GETSTRUCT(tp))->stawidth; + if (stawidth > 0) + return stawidth; + else + return 0; + } tp = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(relid), Int16GetDatum(attnum), diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index df025a5..1c30d86 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -1124,6 +1124,16 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) relation->rd_islocaltemp = false; } break; + case RELPERSISTENCE_GLOBAL_TEMP: + { + relation->rd_backend = BackendIdForTempRelations(); + /* + * For global temp table, all backend can use + * this relation, so rd_islocaltemp always true. + */ + relation->rd_islocaltemp = true; + } + break; default: elog(ERROR, "invalid relpersistence: %c", relation->rd_rel->relpersistence); @@ -3313,6 +3323,10 @@ RelationBuildLocalRelation(const char *relname, rel->rd_backend = BackendIdForTempRelations(); rel->rd_islocaltemp = true; break; + case RELPERSISTENCE_GLOBAL_TEMP: + rel->rd_backend = BackendIdForTempRelations(); + rel->rd_islocaltemp = true; + break; default: elog(ERROR, "invalid relpersistence: %c", relpersistence); break; @@ -3427,6 +3441,9 @@ RelationSetNewRelfilenode(Relation relation, char persistence) TransactionId freezeXid = InvalidTransactionId; RelFileNode newrnode; + if (RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "global temp table does not allow setting new relfilenode"); + /* Allocate a new relfilenode */ newrelfilenode = GetNewRelFileNode(relation->rd_rel->reltablespace, NULL, persistence); @@ -3467,7 +3484,7 @@ RelationSetNewRelfilenode(Relation relation, char persistence) /* handle these directly, at least for now */ SMgrRelation srel; - srel = RelationCreateStorage(newrnode, persistence); + srel = RelationCreateStorage(newrnode, persistence, relation); smgrclose(srel); } break; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index e44f71e..44c86c8 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -139,6 +139,18 @@ char *GUC_check_errmsg_string; char *GUC_check_errdetail_string; char *GUC_check_errhint_string; +/* + * num = 0 means disable global temp table feature. + * global temp table define can still storage in catalog + * just can not use. + * num > 0 means database can management num active global temp table. + */ +#define MIN_NUM_ACTIVE_GTT 0 +#define DEFAULT_NUM_ACTIVE_GTT 1000 +#define MAX_NUM_ACTIVE_GTT 1000000 + +int max_active_gtt = MIN_NUM_ACTIVE_GTT; + static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3, 4); static void set_config_sourcefile(const char *name, char *sourcefile, @@ -1992,6 +2004,15 @@ static struct config_bool ConfigureNamesBool[] = static struct config_int ConfigureNamesInt[] = { { + {"max_active_global_temporary_table", PGC_POSTMASTER, UNGROUPED, + gettext_noop("max active global temporary table."), + NULL + }, + &max_active_gtt, + DEFAULT_NUM_ACTIVE_GTT, MIN_NUM_ACTIVE_GTT, MAX_NUM_ACTIVE_GTT, + NULL, NULL, NULL + }, + { {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Forces a switch to the next WAL file if a " "new file has not been started within N seconds."), diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 799b698..b98d396 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15583,6 +15583,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) { char *ftoptions = NULL; char *srvname = NULL; + char *table_type = NULL; switch (tbinfo->relkind) { @@ -15634,9 +15635,15 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) binary_upgrade_set_pg_class_oids(fout, q, tbinfo->dobj.catId.oid, false); + if (tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED) + table_type = "UNLOGGED "; + else if (tbinfo->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + table_type = "GLOBAL TEMPORARY "; + else + table_type = ""; + appendPQExpBuffer(q, "CREATE %s%s %s", - tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ? - "UNLOGGED " : "", + table_type, reltypename, qualrelname); diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index f3c7eb9..28134e2 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3723,7 +3723,8 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys if (pset.sversion >= 90100) { appendPQExpBuffer(&buf, - ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + ",\n CASE c.relpersistence WHEN 'g' THEN '%s' WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + gettext_noop("session"), gettext_noop("permanent"), gettext_noop("temporary"), gettext_noop("unlogged"), diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index a12fc1f..78958e4 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -165,6 +165,7 @@ typedef FormData_pg_class *Form_pg_class; #define RELPERSISTENCE_PERMANENT 'p' /* regular table */ #define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */ #define RELPERSISTENCE_TEMP 't' /* temporary table */ +#define RELPERSISTENCE_GLOBAL_TEMP 'g' /* global temporary table */ /* default selection for replica identity (primary key or nothing) */ #define REPLICA_IDENTITY_DEFAULT 'd' diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index fcf2a12..ba0bd5f 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5484,6 +5484,40 @@ proparallel => 'r', prorettype => 'float8', proargtypes => 'oid', prosrc => 'pg_stat_get_xact_function_self_time' }, +# For global temporary table +{ oid => '4191', + descr => 'List local statistics for global temporary table', + proname => 'pg_get_gtt_statistics', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid int4 anyelement', + proallargtypes => '{oid,int4,anyelement,oid,int2,bool,float4,int4,float4,int2,int2,int2,int2,int2,oid,oid,oid,oid,oid,oid,oid,oid,oid,oid,_float4,_float4,_float4,_float4,_float4,anyarray,anyarray,anyarray,anyarray,anyarray}', + proargmodes => '{i,i,i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}', + proargnames => '{relid,att,x,starelid,staattnum,stainherit,stanullfrac,stawidth,stadistinct,stakind1,stakind2,stakind3,stakind4,stakind5,staop1,staop2,staop3,staop4,staop5,stacoll1,stacoll2,stacoll3,stacoll4,stacoll5,stanumbers1,stanumbers2,stanumbers3,stanumbers4,stanumbers5,stavalues1,stavalues2,stavalues3,stavalues4,stavalues5}', + prosrc => 'pg_get_gtt_statistics' }, +{ oid => '4192', + descr => 'List local relstats for global temporary table', + proname => 'pg_get_gtt_relstats', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,int4,float4,int4,xid,xid}', + proargmodes => '{i,o,o,o,o,o}', + proargnames => '{relid,relpages,reltuples,relallvisible,relfrozenxid,relminmxid}', + prosrc => 'pg_get_gtt_relstats' }, +{ oid => '4193', + descr => 'List attached pid for one global temporary table', + proname => 'pg_gtt_attached_pid', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,oid,int4}', + proargmodes => '{i,o,o}', + proargnames => '{relid,relid,pid}', + prosrc => 'pg_gtt_attached_pid' }, +{ oid => '4194', + descr => 'List those backends that have used global temporary table', + proname => 'pg_list_gtt_relfrozenxids', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => '', + proallargtypes => '{int4,xid}', + proargmodes => '{o,o}', + proargnames => '{pid,relfrozenxid}', + prosrc => 'pg_list_gtt_relfrozenxids' }, + { oid => '3788', descr => 'statistics: timestamp of the current statistics snapshot', proname => 'pg_stat_get_snapshot_timestamp', provolatile => 's', diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h index 048003c..af48cdf 100644 --- a/src/include/catalog/storage.h +++ b/src/include/catalog/storage.h @@ -19,7 +19,7 @@ #include "storage/smgr.h" #include "utils/relcache.h" -extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence); +extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel); extern void RelationDropStorage(Relation rel); extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit); extern void RelationTruncate(Relation rel, BlockNumber nblocks); diff --git a/src/include/catalog/storage_gtt.h b/src/include/catalog/storage_gtt.h new file mode 100644 index 0000000..eacc214 --- /dev/null +++ b/src/include/catalog/storage_gtt.h @@ -0,0 +1,39 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.h + * prototypes for functions in backend/catalog/storage_gtt.c + * + * src/include/catalog/storage_gtt.h + * + *------------------------------------------------------------------------- + */ +#ifndef STORAGE_GTT_H +#define STORAGE_GTT_H + +#include "access/htup.h" +#include "storage/block.h" +#include "storage/relfilenode.h" +#include "utils/relcache.h" + +extern Size active_gtt_shared_hash_size(void); +extern void active_gtt_shared_hash_init(void); +extern void remember_gtt_storage_info(RelFileNode rnode, Relation rel); +extern void forget_gtt_storage_info(Oid relid); +extern bool is_other_backend_use_gtt(RelFileNode node); +extern bool gtt_storage_attached(Oid relid); +extern Bitmapset *copy_active_gtt_bitmap(RelFileNode node); +extern void up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull); +extern HeapTuple get_gtt_att_statistic(Oid reloid, int attnum, bool inh); +extern void release_gtt_statistic_cache(HeapTuple tup); +extern void up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid); +extern bool get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid); + +#endif /* STORAGE_H */ diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index 93f9446..14cafae 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -120,4 +120,7 @@ extern Oid attnumTypeId(Relation rd, int attid); extern Oid attnumCollationId(Relation rd, int attid); extern bool isQueryUsingTempRelation(Query *query); +/* global temp table check */ +extern bool is_query_using_gtt(Query *query); + #endif /* PARSE_RELATION_H */ diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 870ecb5..92c590e 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -405,6 +405,8 @@ do { \ #define PageClearPrunable(page) \ (((PageHeader) (page))->pd_prune_xid = InvalidTransactionId) +#define GlobalTempRelationPageIsNotInitialized(rel, page) \ + ((rel)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && PageIsNew(page)) /* ---------------------------------------------------------------- * extern declarations diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 8fda8e4..172eae9 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -220,6 +220,7 @@ typedef enum BuiltinTrancheIds LWTRANCHE_TBM, LWTRANCHE_PARALLEL_APPEND, LWTRANCHE_SXACT, + LWTRANCHE_GTT_CTL, LWTRANCHE_FIRST_USER_DEFINED } BuiltinTrancheIds; diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 5b407e6..f13250a 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -117,6 +117,8 @@ struct PGPROC Oid tempNamespaceId; /* OID of temp schema this backend is * using */ + TransactionId session_gtt_frozenxid; /* session level global temp table relfrozenxid */ + bool isBackgroundWorker; /* true if background worker. */ /* diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index a5c7d0c..a86f61f 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -125,4 +125,6 @@ extern void ProcArraySetReplicationSlotXmin(TransactionId xmin, extern void ProcArrayGetReplicationSlotXmin(TransactionId *xmin, TransactionId *catalog_xmin); +extern int list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n); + #endif /* PROCARRAY_H */ diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index ce93ace..0f7262e 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -281,6 +281,10 @@ extern int tcp_user_timeout; extern bool trace_sort; #endif +/* global temporary table */ +extern int max_active_gtt; +/* end */ + /* * Functions exported by guc.c */ diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 44ed04d..3f9720d 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -277,6 +277,7 @@ typedef struct StdRdOptions int parallel_workers; /* max number of parallel workers */ bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */ bool vacuum_truncate; /* enables vacuum to truncate a relation */ + bool on_commit_delete_rows; /* global temp table */ } StdRdOptions; #define HEAP_MIN_FILLFACTOR 10 @@ -535,7 +536,8 @@ typedef struct ViewOptions * True if relation's pages are stored in local buffers. */ #define RelationUsesLocalBuffers(relation) \ - ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP || \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) /* * RELATION_IS_LOCAL @@ -602,6 +604,17 @@ typedef struct ViewOptions RelationNeedsWAL(relation) && \ !IsCatalogRelation(relation)) +/* global temp table implementations */ +#define RELATION_IS_GLOBAL_TEMP(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + +#define RELATION_GTT_ON_COMMIT_DELETE(relation) \ + ((relation)->rd_options && \ + ((relation)->rd_rel->relkind == RELKIND_RELATION || (relation)->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) && \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP ? \ + ((StdRdOptions *) (relation)->rd_options)->on_commit_delete_rows : false) + +#define RelationGetRelPersistence(relation) ((relation)->rd_rel->relpersistence) + /* routines in utils/cache/relcache.c */ extern void RelationIncrementReferenceCount(Relation rel); extern void RelationDecrementReferenceCount(Relation rel); diff --git a/src/test/regress/expected/gtt_clean.out b/src/test/regress/expected/gtt_clean.out new file mode 100644 index 0000000..50ca9ac --- /dev/null +++ b/src/test/regress/expected/gtt_clean.out @@ -0,0 +1,7 @@ +reset search_path; +drop schema gtt cascade; +NOTICE: drop cascades to 4 other objects +DETAIL: drop cascades to table gtt.gtt1 +drop cascades to table gtt.gtt2 +drop cascades to table gtt.gtt3 +drop cascades to table gtt.gtt_t_kenyon diff --git a/src/test/regress/expected/gtt_function.out b/src/test/regress/expected/gtt_function.out new file mode 100644 index 0000000..a477917 --- /dev/null +++ b/src/test/regress/expected/gtt_function.out @@ -0,0 +1,197 @@ +CREATE SCHEMA IF NOT EXISTS gtt_function; +set search_path=gtt_function,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt_test_rename(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); +ERROR: cannot create indexes on global temporary tables using concurrent mode +-- ERROR +cluster gtt1 using gtt1_pkey; +ERROR: not support cluster global temporary tables yet +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; +ERROR: ON COMMIT can only be used on temporary tables +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); +ERROR: regular table cannot specifie on_commit_delete_rows +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; + count +------- + 2 +(1 row) + +commit; +select count(*) from p_table01; + count +------- + 0 +(1 row) + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +ERROR: The parent table must be global temporary table +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + relname | relkind | relpersistence | reloptions +---------------------------------+---------+----------------+------------------------------- + p_table01 | p | g | {on_commit_delete_rows=true} + p_table01_2017 | r | g | {on_commit_delete_rows=true} + p_table01_2018 | r | g | {on_commit_delete_rows=true} + p_table01_id_seq | S | g | + p_table02 | p | g | {on_commit_delete_rows=false} + p_table02_2017 | r | g | {on_commit_delete_rows=false} + p_table02_2018 | r | g | {on_commit_delete_rows=false} + p_table02_id_seq | S | g | + tbl_inherits_parent | r | p | + tbl_inherits_parent_global_temp | r | g | {on_commit_delete_rows=true} + tbl_inherits_partition | r | g | {on_commit_delete_rows=true} +(11 rows) + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; +ERROR: global temp table not support on commit drop clause +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; +ERROR: can not defeine global temp table with on commit and with clause at same time +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); +--ok +alter table gtt_test_rename rename to gtt_test; +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; + id | a +----+--- + 2 | 1 + 3 | 2 +(2 rows) + +truncate gtt_seq; +select * from gtt_seq order by id; + id | a +----+--- +(0 rows) + +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + id | a +----+--- + 4 | 3 +(1 row) + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; +ERROR: materialized views must not use global temporary tables or views +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +ERROR: only support btree index on global temp table +create index idx_err on gtt1 using gist (a); +ERROR: data type integer has no default operator class for access method "gist" +HINT: You must specify an operator class for the index or define a default operator class for the data type. +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +ERROR: only support btree index on global temp table +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); +ERROR: only support btree index on global temp table +reset search_path; +drop schema gtt_function cascade; +NOTICE: drop cascades to 15 other objects +DETAIL: drop cascades to table gtt_function.gtt1 +drop cascades to table gtt_function.gtt_test +drop cascades to table gtt_function.gtt2 +drop cascades to table gtt_function.gtt3 +drop cascades to table gtt_function.tmp_t0 +drop cascades to table gtt_function.tbl_inherits_parent +drop cascades to table gtt_function.tbl_inherits_parent_global_temp +drop cascades to table gtt_function.products +drop cascades to table gtt_function.measurement +drop cascades to table gtt_function.p_table01 +drop cascades to table gtt_function.p_table02 +drop cascades to table gtt_function.tbl_inherits_partition +drop cascades to table gtt_function.gtt5 +drop cascades to table gtt_function.mytable +drop cascades to table gtt_function.gtt_seq diff --git a/src/test/regress/expected/gtt_parallel_1.out b/src/test/regress/expected/gtt_parallel_1.out new file mode 100644 index 0000000..30d8a7b --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_1.out @@ -0,0 +1,84 @@ +set search_path=gtt,sys; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_parallel_2.out b/src/test/regress/expected/gtt_parallel_2.out new file mode 100644 index 0000000..850ef3e --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_2.out @@ -0,0 +1,161 @@ +set search_path=gtt,sys; +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +commit; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 + 3 | test1 +(3 rows) + +rollback; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test2 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; + a | b +---+------- + 3 | test3 +(1 row) + +rollback; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; + a | b +---+------- + 5 | test5 +(1 row) + +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + a | b +---+------- + 6 | test6 +(1 row) + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; + count +-------- + 100000 +(1 row) + +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + QUERY PLAN +------------------------------------ + Index Scan using gtt3_pkey on gtt3 + Index Cond: (a = 300) +(2 rows) + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; + relname | pg_relation_size | pg_relation_size | pg_table_size | pg_indexes_size | pg_total_relation_size +--------------+------------------+------------------+---------------+-----------------+------------------------ + gtt_t_kenyon | 450560 | 8192 | 499712 | 475136 | 974848 +(1 row) + +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + relname +-------------- + gtt_t_kenyon +(1 row) + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + relname | pg_relation_size | pg_table_size | pg_total_relation_size +--------------------+------------------+---------------+------------------------ + idx_gtt_t_kenyon_1 | 65536 | 65536 | 65536 + idx_gtt_t_kenyon_2 | 409600 | 409600 | 409600 +(2 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_prepare.out b/src/test/regress/expected/gtt_prepare.out new file mode 100644 index 0000000..9fe5fd4 --- /dev/null +++ b/src/test/regress/expected/gtt_prepare.out @@ -0,0 +1,9 @@ +CREATE SCHEMA IF NOT EXISTS gtt; +set search_path=gtt,sys; +create global temp table gtt1(a int primary key, b text) on commit delete rows; +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text); +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; diff --git a/src/test/regress/expected/gtt_stats.out b/src/test/regress/expected/gtt_stats.out new file mode 100644 index 0000000..b258b7c --- /dev/null +++ b/src/test/regress/expected/gtt_stats.out @@ -0,0 +1,76 @@ +CREATE SCHEMA IF NOT EXISTS gtt_stats; +set search_path=gtt_stats,sys; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +insert into gtt values(generate_series(1,10000),'test'); +-- expect 1 +select count(*) from pg_gtt_attached_pids; + count +------- + 1 +(1 row) + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 2 +(1 row) + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 0 | 0 | 0 +(1 row) + +-- expect 0 +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+------------------+-------------+-------------------+------------------------+---------------------- +(0 rows) + +analyze gtt; +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 55 | 10000 | 0 +(1 row) + +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------------------+------------------------+---------------------- + gtt_stats | gtt | a | f | 0 | 4 | -1 | | | {1,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,8700,8800,8900,9000,9100,9200,9300,9400,9500,9600,9700,9800,9900,10000} | 1 | | | + gtt_stats | gtt | b | f | 0 | 5 | 1 | {test} | {1} | | 1 | | | +(2 rows) + +reset search_path; +drop schema gtt_stats cascade; +NOTICE: drop cascades to table gtt_stats.gtt diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 70e1e2f..30cf4bd 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1348,6 +1348,93 @@ pg_group| SELECT pg_authid.rolname AS groname, WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin); +pg_gtt_attached_pids| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relid, + s.pid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_gtt_attached_pid(c.oid) s(relid, pid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_relstats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relpages, + s.reltuples, + s.relallvisible, + s.relfrozenxid, + s.relminmxid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_relstats(c.oid) s(relpages, reltuples, relallvisible, relfrozenxid, relminmxid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_stats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN (s.stakind1 = 1) THEN s.stavalues1 + WHEN (s.stakind2 = 1) THEN s.stavalues2 + WHEN (s.stakind3 = 1) THEN s.stavalues3 + WHEN (s.stakind4 = 1) THEN s.stavalues4 + WHEN (s.stakind5 = 1) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_vals, + CASE + WHEN (s.stakind1 = 1) THEN s.stanumbers1 + WHEN (s.stakind2 = 1) THEN s.stanumbers2 + WHEN (s.stakind3 = 1) THEN s.stanumbers3 + WHEN (s.stakind4 = 1) THEN s.stanumbers4 + WHEN (s.stakind5 = 1) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_freqs, + CASE + WHEN (s.stakind1 = 2) THEN s.stavalues1 + WHEN (s.stakind2 = 2) THEN s.stavalues2 + WHEN (s.stakind3 = 2) THEN s.stavalues3 + WHEN (s.stakind4 = 2) THEN s.stavalues4 + WHEN (s.stakind5 = 2) THEN s.stavalues5 + ELSE NULL::text[] + END AS histogram_bounds, + CASE + WHEN (s.stakind1 = 3) THEN s.stanumbers1[1] + WHEN (s.stakind2 = 3) THEN s.stanumbers2[1] + WHEN (s.stakind3 = 3) THEN s.stanumbers3[1] + WHEN (s.stakind4 = 3) THEN s.stanumbers4[1] + WHEN (s.stakind5 = 3) THEN s.stanumbers5[1] + ELSE NULL::real + END AS correlation, + CASE + WHEN (s.stakind1 = 4) THEN s.stavalues1 + WHEN (s.stakind2 = 4) THEN s.stavalues2 + WHEN (s.stakind3 = 4) THEN s.stavalues3 + WHEN (s.stakind4 = 4) THEN s.stavalues4 + WHEN (s.stakind5 = 4) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_elems, + CASE + WHEN (s.stakind1 = 4) THEN s.stanumbers1 + WHEN (s.stakind2 = 4) THEN s.stanumbers2 + WHEN (s.stakind3 = 4) THEN s.stanumbers3 + WHEN (s.stakind4 = 4) THEN s.stanumbers4 + WHEN (s.stakind5 = 4) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_elem_freqs, + CASE + WHEN (s.stakind1 = 5) THEN s.stanumbers1 + WHEN (s.stakind2 = 5) THEN s.stanumbers2 + WHEN (s.stakind3 = 5) THEN s.stanumbers3 + WHEN (s.stakind4 = 5) THEN s.stanumbers4 + WHEN (s.stakind5 = 5) THEN s.stanumbers5 + ELSE NULL::real[] + END AS elem_count_histogram + FROM ((pg_class c + JOIN pg_attribute a ON ((c.oid = a.attrelid))) + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_statistics(c.oid, (a.attnum)::integer, ''::text) s(starelid, staattnum, stainherit, stanullfrac, stawidth, stadistinct, stakind1, stakind2, stakind3, stakind4, stakind5, staop1, staop2, staop3, staop4, staop5, stacoll1, stacoll2, stacoll3, stacoll4, stacoll5, stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5, stavalues1, stavalues2, stavalues3, stavalues4, stavalues5) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND (NOT a.attisdropped) AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); pg_hba_file_rules| SELECT a.line_number, a.type, a.database, diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index d33a4e1..643afe4 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -121,3 +121,10 @@ test: fast_default # run stats by itself because its delay may be insufficient under heavy load test: stats + +# global temp table test +test: gtt_stats +test: gtt_function +test: gtt_prepare +test: gtt_parallel_1 gtt_parallel_2 +test: gtt_clean diff --git a/src/test/regress/sql/gtt_clean.sql b/src/test/regress/sql/gtt_clean.sql new file mode 100644 index 0000000..f3cf710 --- /dev/null +++ b/src/test/regress/sql/gtt_clean.sql @@ -0,0 +1,6 @@ + + +reset search_path; + +drop schema gtt cascade; + diff --git a/src/test/regress/sql/gtt_function.sql b/src/test/regress/sql/gtt_function.sql new file mode 100644 index 0000000..cfc1879 --- /dev/null +++ b/src/test/regress/sql/gtt_function.sql @@ -0,0 +1,163 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_function; + +set search_path=gtt_function,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt_test_rename(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); + +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; + +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); + +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); + +-- ERROR +cluster gtt1 using gtt1_pkey; + +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; + +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); + +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); + +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; +commit; + +select count(*) from p_table01; + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; + +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; + +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; + +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; + +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); + +--ok +alter table gtt_test_rename rename to gtt_test; + +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); + +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; + +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; +truncate gtt_seq; +select * from gtt_seq order by id; +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; + +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +create index idx_err on gtt1 using gist (a); +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); + +reset search_path; + +drop schema gtt_function cascade; + diff --git a/src/test/regress/sql/gtt_parallel_1.sql b/src/test/regress/sql/gtt_parallel_1.sql new file mode 100644 index 0000000..d7d81de --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_1.sql @@ -0,0 +1,42 @@ + + +set search_path=gtt,sys; + +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +commit; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +rollback; +select * from gtt1 order by a; + +truncate gtt1; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +select * from gtt1 order by a; +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + +begin; +select * from gtt1 order by a; +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +commit; +select * from gtt1 order by a; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_parallel_2.sql b/src/test/regress/sql/gtt_parallel_2.sql new file mode 100644 index 0000000..5203c2b --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_2.sql @@ -0,0 +1,76 @@ + + +set search_path=gtt,sys; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; +commit; +select * from gtt3 order by a; + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +truncate gtt3; +select * from gtt3 order by a; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; +truncate gtt3; +select * from gtt3 order by a; +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +begin; +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_prepare.sql b/src/test/regress/sql/gtt_prepare.sql new file mode 100644 index 0000000..2f4d883 --- /dev/null +++ b/src/test/regress/sql/gtt_prepare.sql @@ -0,0 +1,16 @@ + +CREATE SCHEMA IF NOT EXISTS gtt; + +set search_path=gtt,sys; + +create global temp table gtt1(a int primary key, b text) on commit delete rows; + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text); + +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; + diff --git a/src/test/regress/sql/gtt_stats.sql b/src/test/regress/sql/gtt_stats.sql new file mode 100644 index 0000000..f041892 --- /dev/null +++ b/src/test/regress/sql/gtt_stats.sql @@ -0,0 +1,42 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_stats; + +set search_path=gtt_stats,sys; + +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +insert into gtt values(generate_series(1,10000),'test'); + +-- expect 1 +select count(*) from pg_gtt_attached_pids; + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +-- expect 0 +select * from pg_gtt_stats order by tablename; + +analyze gtt; + +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +select * from pg_gtt_stats order by tablename; + +reset search_path; + +drop schema gtt_stats cascade; + ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-21 18:51 Pavel Stehule <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-21 18:51 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> út 21. 1. 2020 v 9:46 odesílatel 曾文旌(义从) <[email protected]> napsal: > > > 2020年1月12日 上午4:27,Pavel Stehule <[email protected]> 写道: > > Hi > > so 11. 1. 2020 v 15:00 odesílatel 曾文旌(义从) <[email protected]> > napsal: > >> Hi all >> >> This is the latest patch >> >> The updates are as follows: >> 1. Support global temp Inherit table global temp partition table >> 2. Support serial column in GTT >> 3. Provide views pg_gtt_relstats pg_gtt_stats for GTT’s statistics >> 4. Provide view pg_gtt_attached_pids to manage GTT >> 5. Provide function pg_list_gtt_relfrozenxids() to manage GTT >> 6. Alter GTT or rename GTT is allowed under some conditions >> >> >> Please give me feedback. >> > > I tested the functionality > > 1. i think so "ON COMMIT PRESERVE ROWS" should be default mode (like local > temp tables). > > > ON COMMIT PRESERVE ROWS is default mode now. > Thank you * I tried to create global temp table with index. When I tried to drop this table (and this table was used by second instance), then I got error message postgres=# drop table foo; ERROR: can not drop index when other backend attached this global temp table It is expected, but it is not too much user friendly. Is better to check if you can drop table, then lock it, and then drop all objects. * tab complete can be nice for CREATE GLOBAL TEMP table \dt+ \di+ doesn't work correctly, or maybe I don't understand to the implementation. I see same size in all sessions. Global temp tables shares same files? Regards Pavel > > Wenjing > > > > > I tested some simple scripts > > test01.sql > > CREATE TEMP TABLE foo(a int, b int); > INSERT INTO foo SELECT random()*100, random()*1000 FROM > generate_series(1,1000); > ANALYZE foo; > SELECT sum(a), sum(b) FROM foo; > DROP TABLE foo; -- simulate disconnect > > > after 100 sec, the table pg_attribute has 3.2MB > and 64 tps, 6446 transaction > > test02.sql > > INSERT INTO foo SELECT random()*100, random()*1000 FROM > generate_series(1,1000); > ANALYZE foo; > SELECT sum(a), sum(b) FROM foo; > DELETE FROM foo; -- simulate disconnect > > > after 100 sec, 1688 tps, 168830 transactions > > So performance is absolutely different as we expected. > > From my perspective, this functionality is great. > > Todo: > > pg_table_size function doesn't work > > Regards > > Pavel > > >> Wenjing >> >> >> >> >> >> 2020年1月6日 上午4:06,Tomas Vondra <[email protected]> 写道: >> >> Hi, >> >> I think we need to do something with having two patches aiming to add >> global temporary tables: >> >> [1] https://commitfest.postgresql.org/26/2349/ >> >> [2] https://commitfest.postgresql.org/26/2233/ >> >> As a reviewer I have no idea which of the threads to look at - certainly >> not without reading both threads, which I doubt anyone will really do. >> The reviews and discussions are somewhat intermixed between those two >> threads, which makes it even more confusing. >> >> I think we should agree on a minimal patch combining the necessary/good >> bits from the various patches, and terminate one of the threads (i.e. >> mark it as rejected or RWF). And we need to do that now, otherwise >> there's about 0% chance of getting this into v13. >> >> In general, I agree with the sentiment Rober expressed in [1] - the >> patch needs to be as small as possible, not adding "nice to have" >> features (like support for parallel queries - I very much doubt just >> using shared instead of local buffers is enough to make it work.) >> >> regards >> >> -- >> Tomas Vondra http://www.2ndQuadrant.com >> <http://www.2ndquadrant.com/; >> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services >> >> >> > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-22 05:29 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-22 05:29 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Erik Rijkers <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月21日 下午1:43,Pavel Stehule <[email protected]> 写道: > > Hi > > I have a free time this evening, so I will check this patch > > I have a one question > > + /* global temp table get relstats from localhash */ > + if (RELATION_IS_GLOBAL_TEMP(rel)) > + { > + get_gtt_relstats(RelationGetRelid(rel), > + &relpages, &reltuples, &relallvisible, > + NULL, NULL); > + } > + else > + { > + /* coerce values in pg_class to more desirable types */ > + relpages = (BlockNumber) rel->rd_rel->relpages; > + reltuples = (double) rel->rd_rel->reltuples; > + relallvisible = (BlockNumber) rel->rd_rel->relallvisible; > + } > > Isbn't possible to fill the rd_rel structure too, so this branching can be reduced? I'll make some improvements to optimize this part of the code. > > Regards > > Pavel > > po 20. 1. 2020 v 17:27 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: > > > > 2020年1月20日 上午1:32,Erik Rijkers <[email protected] <mailto:[email protected]>> 写道: > > > > On 2020-01-19 18:04, 曾文旌(义从) wrote: > >>> 2020年1月14日 下午9:20,Pavel Stehule <[email protected] <mailto:[email protected]>> 写道: > >>> út 14. 1. 2020 v 14:09 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>> napsal: > > > >>> [global_temporary_table_v4-pg13.patch ] > > > > Hi, > > > > This patch doesn't quiet apply for me: > > > > patching file src/backend/access/common/reloptions.c > > patching file src/backend/access/gist/gistutil.c > > patching file src/backend/access/hash/hash.c > > Hunk #1 succeeded at 149 (offset 3 lines). > > patching file src/backend/access/heap/heapam_handler.c > > patching file src/backend/access/heap/vacuumlazy.c > > patching file src/backend/access/nbtree/nbtpage.c > > patching file src/backend/access/table/tableam.c > > patching file src/backend/access/transam/xlog.c > > patching file src/backend/catalog/Makefile > > Hunk #1 FAILED at 44. > > 1 out of 1 hunk FAILED -- saving rejects to file src/backend/catalog/Makefile.rej > > [...] > > (The rest applies without errors) > > > > src/backend/catalog/Makefile.rej contains: > > > > ------------------------ > > --- src/backend/catalog/Makefile > > +++ src/backend/catalog/Makefile > > @@ -44,6 +44,8 @@ OBJS = \ > > storage.o \ > > toasting.o > > > > +OBJS += storage_gtt.o > > + > > BKIFILES = postgres.bki postgres.description postgres.shdescription > > > > include $(top_srcdir)/src/backend/common.mk <http://common.mk/; > > ------------------------ > > > > Can you have a look? > I updated the code and remade the patch. > Please give me feedback if you have any more questions. > > > > > > > > > > thanks, > > > > Erik Rijkers > > > > > > > > > > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-22 06:16 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-22 06:16 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月22日 上午2:51,Pavel Stehule <[email protected]> 写道: > > > > út 21. 1. 2020 v 9:46 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: > > >> 2020年1月12日 上午4:27,Pavel Stehule <[email protected] <mailto:[email protected]>> 写道: >> >> Hi >> >> so 11. 1. 2020 v 15:00 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: >> Hi all >> >> This is the latest patch >> >> The updates are as follows: >> 1. Support global temp Inherit table global temp partition table >> 2. Support serial column in GTT >> 3. Provide views pg_gtt_relstats pg_gtt_stats for GTT’s statistics >> 4. Provide view pg_gtt_attached_pids to manage GTT >> 5. Provide function pg_list_gtt_relfrozenxids() to manage GTT >> 6. Alter GTT or rename GTT is allowed under some conditions >> >> >> Please give me feedback. >> >> I tested the functionality >> >> 1. i think so "ON COMMIT PRESERVE ROWS" should be default mode (like local temp tables). > > ON COMMIT PRESERVE ROWS is default mode now. > > Thank you > > * I tried to create global temp table with index. When I tried to drop this table (and this table was used by second instance), then I got error message > > postgres=# drop table foo; > ERROR: can not drop index when other backend attached this global temp table > > It is expected, but it is not too much user friendly. Is better to check if you can drop table, then lock it, and then drop all objects. I don't understand what needs to be improved. Could you describe it in detail? > > * tab complete can be nice for CREATE GLOBAL TEMP table Yes, I will improve it. > > \dt+ \di+ doesn't work correctly, or maybe I don't understand to the implementation. > postgres=# create table t(a int primary key); CREATE TABLE postgres=# create global temp table gt(a int primary key); CREATE TABLE postgres=# insert into t values(generate_series(1,10000)); INSERT 0 10000 postgres=# insert into gt values(generate_series(1,10000)); INSERT 0 10000 postgres=# \dt+ List of relations Schema | Name | Type | Owner | Persistence | Size | Description --------+------+-------+-------------+-------------+--------+------------- public | gt | table | wenjing.zwj | session | 384 kB | public | t | table | wenjing.zwj | permanent | 384 kB | (2 rows) postgres=# \di+ List of relations Schema | Name | Type | Owner | Table | Persistence | Size | Description --------+---------+-------+-------------+-------+-------------+--------+------------- public | gt_pkey | index | wenjing.zwj | gt | session | 240 kB | public | t_pkey | index | wenjing.zwj | t | permanent | 240 kB | (2 rows) > I see same size in all sessions. Global temp tables shares same files? No, they use their own files. But \dt+ \di+ counts the total file sizes in all sessions for each GTT. Wenjing > > Regards > > Pavel > > > > > > Wenjing > > > >> >> I tested some simple scripts >> >> test01.sql >> >> CREATE TEMP TABLE foo(a int, b int); >> INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); >> ANALYZE foo; >> SELECT sum(a), sum(b) FROM foo; >> DROP TABLE foo; -- simulate disconnect >> >> >> after 100 sec, the table pg_attribute has 3.2MB >> and 64 tps, 6446 transaction >> >> test02.sql >> >> INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); >> ANALYZE foo; >> SELECT sum(a), sum(b) FROM foo; >> DELETE FROM foo; -- simulate disconnect >> >> >> after 100 sec, 1688 tps, 168830 transactions >> >> So performance is absolutely different as we expected. >> >> From my perspective, this functionality is great. >> >> Todo: >> >> pg_table_size function doesn't work >> >> Regards >> >> Pavel >> >> >> Wenjing >> >> >> >> >> >>> 2020年1月6日 上午4:06,Tomas Vondra <[email protected] <mailto:[email protected]>> 写道: >>> >>> Hi, >>> >>> I think we need to do something with having two patches aiming to add >>> global temporary tables: >>> >>> [1] https://commitfest.postgresql.org/26/2349/ <https://commitfest.postgresql.org/26/2349/; >>> >>> [2] https://commitfest.postgresql.org/26/2233/ <https://commitfest.postgresql.org/26/2233/; >>> >>> As a reviewer I have no idea which of the threads to look at - certainly >>> not without reading both threads, which I doubt anyone will really do. >>> The reviews and discussions are somewhat intermixed between those two >>> threads, which makes it even more confusing. >>> >>> I think we should agree on a minimal patch combining the necessary/good >>> bits from the various patches, and terminate one of the threads (i.e. >>> mark it as rejected or RWF). And we need to do that now, otherwise >>> there's about 0% chance of getting this into v13. >>> >>> In general, I agree with the sentiment Rober expressed in [1] - the >>> patch needs to be as small as possible, not adding "nice to have" >>> features (like support for parallel queries - I very much doubt just >>> using shared instead of local buffers is enough to make it work.) >>> >>> regards >>> >>> -- >>> Tomas Vondra http://www.2ndQuadrant.com <http://www.2ndquadrant.com/; >>> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services >> > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-22 06:31 Pavel Stehule <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-22 06:31 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> st 22. 1. 2020 v 7:16 odesílatel 曾文旌(义从) <[email protected]> napsal: > > > 2020年1月22日 上午2:51,Pavel Stehule <[email protected]> 写道: > > > > út 21. 1. 2020 v 9:46 odesílatel 曾文旌(义从) <[email protected]> > napsal: > >> >> >> 2020年1月12日 上午4:27,Pavel Stehule <[email protected]> 写道: >> >> Hi >> >> so 11. 1. 2020 v 15:00 odesílatel 曾文旌(义从) <[email protected]> >> napsal: >> >>> Hi all >>> >>> This is the latest patch >>> >>> The updates are as follows: >>> 1. Support global temp Inherit table global temp partition table >>> 2. Support serial column in GTT >>> 3. Provide views pg_gtt_relstats pg_gtt_stats for GTT’s statistics >>> 4. Provide view pg_gtt_attached_pids to manage GTT >>> 5. Provide function pg_list_gtt_relfrozenxids() to manage GTT >>> 6. Alter GTT or rename GTT is allowed under some conditions >>> >>> >>> Please give me feedback. >>> >> >> I tested the functionality >> >> 1. i think so "ON COMMIT PRESERVE ROWS" should be default mode (like >> local temp tables). >> >> >> ON COMMIT PRESERVE ROWS is default mode now. >> > > Thank you > > * I tried to create global temp table with index. When I tried to drop > this table (and this table was used by second instance), then I got error > message > > postgres=# drop table foo; > ERROR: can not drop index when other backend attached this global temp > table > > It is expected, but it is not too much user friendly. Is better to check > if you can drop table, then lock it, and then drop all objects. > > I don't understand what needs to be improved. Could you describe it in > detail? > the error messages should be some like can not drop table when other backend attached this global temp table. It is little bit messy, when you try to drop table and you got message about index > > * tab complete can be nice for CREATE GLOBAL TEMP table > > Yes, I will improve it. > > > \dt+ \di+ doesn't work correctly, or maybe I don't understand to the > implementation. > > > postgres=# create table t(a int primary key); > CREATE TABLE > postgres=# create global temp table gt(a int primary key); > CREATE TABLE > postgres=# insert into t values(generate_series(1,10000)); > INSERT 0 10000 > postgres=# insert into gt values(generate_series(1,10000)); > INSERT 0 10000 > > postgres=# \dt+ > List of relations > Schema | Name | Type | Owner | Persistence | Size | Description > --------+------+-------+-------------+-------------+--------+------------- > public | gt | table | wenjing.zwj | session | 384 kB | > public | t | table | wenjing.zwj | permanent | 384 kB | > (2 rows) > > postgres=# \di+ > List of relations > Schema | Name | Type | Owner | Table | Persistence | Size | > Description > > --------+---------+-------+-------------+-------+-------------+--------+------------- > public | gt_pkey | index | wenjing.zwj | gt | session | 240 kB | > public | t_pkey | index | wenjing.zwj | t | permanent | 240 kB | > (2 rows) > > > I see same size in all sessions. Global temp tables shares same files? > > No, they use their own files. > But \dt+ \di+ counts the total file sizes in all sessions for each GTT. > I think so it is wrong. The data are independent and the sizes should be independent too > > > Wenjing > > > Regards > > Pavel > > > > >> >> Wenjing >> >> >> >> >> I tested some simple scripts >> >> test01.sql >> >> CREATE TEMP TABLE foo(a int, b int); >> INSERT INTO foo SELECT random()*100, random()*1000 FROM >> generate_series(1,1000); >> ANALYZE foo; >> SELECT sum(a), sum(b) FROM foo; >> DROP TABLE foo; -- simulate disconnect >> >> >> after 100 sec, the table pg_attribute has 3.2MB >> and 64 tps, 6446 transaction >> >> test02.sql >> >> INSERT INTO foo SELECT random()*100, random()*1000 FROM >> generate_series(1,1000); >> ANALYZE foo; >> SELECT sum(a), sum(b) FROM foo; >> DELETE FROM foo; -- simulate disconnect >> >> >> after 100 sec, 1688 tps, 168830 transactions >> >> So performance is absolutely different as we expected. >> >> From my perspective, this functionality is great. >> >> Todo: >> >> pg_table_size function doesn't work >> >> Regards >> >> Pavel >> >> >>> Wenjing >>> >>> >>> >>> >>> >>> 2020年1月6日 上午4:06,Tomas Vondra <[email protected]> 写道: >>> >>> Hi, >>> >>> I think we need to do something with having two patches aiming to add >>> global temporary tables: >>> >>> [1] https://commitfest.postgresql.org/26/2349/ >>> >>> [2] https://commitfest.postgresql.org/26/2233/ >>> >>> As a reviewer I have no idea which of the threads to look at - certainly >>> not without reading both threads, which I doubt anyone will really do. >>> The reviews and discussions are somewhat intermixed between those two >>> threads, which makes it even more confusing. >>> >>> I think we should agree on a minimal patch combining the necessary/good >>> bits from the various patches, and terminate one of the threads (i.e. >>> mark it as rejected or RWF). And we need to do that now, otherwise >>> there's about 0% chance of getting this into v13. >>> >>> In general, I agree with the sentiment Rober expressed in [1] - the >>> patch needs to be as small as possible, not adding "nice to have" >>> features (like support for parallel queries - I very much doubt just >>> using shared instead of local buffers is enough to make it work.) >>> >>> regards >>> >>> -- >>> Tomas Vondra http://www.2ndQuadrant.com >>> <http://www.2ndquadrant.com/; >>> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services >>> >>> >>> >> > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-23 16:22 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-23 16:22 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月22日 下午2:31,Pavel Stehule <[email protected]> 写道: > > > > st 22. 1. 2020 v 7:16 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: > > >> 2020年1月22日 上午2:51,Pavel Stehule <[email protected] <mailto:[email protected]>> 写道: >> >> >> >> út 21. 1. 2020 v 9:46 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: >> >> >>> 2020年1月12日 上午4:27,Pavel Stehule <[email protected] <mailto:[email protected]>> 写道: >>> >>> Hi >>> >>> so 11. 1. 2020 v 15:00 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: >>> Hi all >>> >>> This is the latest patch >>> >>> The updates are as follows: >>> 1. Support global temp Inherit table global temp partition table >>> 2. Support serial column in GTT >>> 3. Provide views pg_gtt_relstats pg_gtt_stats for GTT’s statistics >>> 4. Provide view pg_gtt_attached_pids to manage GTT >>> 5. Provide function pg_list_gtt_relfrozenxids() to manage GTT >>> 6. Alter GTT or rename GTT is allowed under some conditions >>> >>> >>> Please give me feedback. >>> >>> I tested the functionality >>> >>> 1. i think so "ON COMMIT PRESERVE ROWS" should be default mode (like local temp tables). >> >> ON COMMIT PRESERVE ROWS is default mode now. >> >> Thank you >> >> * I tried to create global temp table with index. When I tried to drop this table (and this table was used by second instance), then I got error message >> >> postgres=# drop table foo; >> ERROR: can not drop index when other backend attached this global temp table >> >> It is expected, but it is not too much user friendly. Is better to check if you can drop table, then lock it, and then drop all objects. > I don't understand what needs to be improved. Could you describe it in detail? > > the error messages should be some like > > can not drop table when other backend attached this global temp table. > > It is little bit messy, when you try to drop table and you got message about index It has been repaired in global_temporary_table_v7-pg13.patch > > >> >> * tab complete can be nice for CREATE GLOBAL TEMP table > Yes, I will improve it. It has been repaired in global_temporary_table_v7-pg13.patch >> >> \dt+ \di+ doesn't work correctly, or maybe I don't understand to the implementation. >> > > postgres=# create table t(a int primary key); > CREATE TABLE > postgres=# create global temp table gt(a int primary key); > CREATE TABLE > postgres=# insert into t values(generate_series(1,10000)); > INSERT 0 10000 > postgres=# insert into gt values(generate_series(1,10000)); > INSERT 0 10000 > > postgres=# \dt+ > List of relations > Schema | Name | Type | Owner | Persistence | Size | Description > --------+------+-------+-------------+-------------+--------+------------- > public | gt | table | wenjing.zwj | session | 384 kB | > public | t | table | wenjing.zwj | permanent | 384 kB | > (2 rows) > > postgres=# \di+ > List of relations > Schema | Name | Type | Owner | Table | Persistence | Size | Description > --------+---------+-------+-------------+-------+-------------+--------+------------- > public | gt_pkey | index | wenjing.zwj | gt | session | 240 kB | > public | t_pkey | index | wenjing.zwj | t | permanent | 240 kB | > (2 rows) > > >> I see same size in all sessions. Global temp tables shares same files? > No, they use their own files. > But \dt+ \di+ counts the total file sizes in all sessions for each GTT. > > I think so it is wrong. The data are independent and the sizes should be independent too It has been repaired in global_temporary_table_v7-pg13.patch. Wenjing > > > > > Wenjing > >> >> Regards >> >> Pavel >> >> >> >> >> >> Wenjing >> >> >> >>> >>> I tested some simple scripts >>> >>> test01.sql >>> >>> CREATE TEMP TABLE foo(a int, b int); >>> INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); >>> ANALYZE foo; >>> SELECT sum(a), sum(b) FROM foo; >>> DROP TABLE foo; -- simulate disconnect >>> >>> >>> after 100 sec, the table pg_attribute has 3.2MB >>> and 64 tps, 6446 transaction >>> >>> test02.sql >>> >>> INSERT INTO foo SELECT random()*100, random()*1000 FROM generate_series(1,1000); >>> ANALYZE foo; >>> SELECT sum(a), sum(b) FROM foo; >>> DELETE FROM foo; -- simulate disconnect >>> >>> >>> after 100 sec, 1688 tps, 168830 transactions >>> >>> So performance is absolutely different as we expected. >>> >>> From my perspective, this functionality is great. >>> >>> Todo: >>> >>> pg_table_size function doesn't work >>> >>> Regards >>> >>> Pavel >>> >>> >>> Wenjing >>> >>> >>> >>> >>> >>>> 2020年1月6日 上午4:06,Tomas Vondra <[email protected] <mailto:[email protected]>> 写道: >>>> >>>> Hi, >>>> >>>> I think we need to do something with having two patches aiming to add >>>> global temporary tables: >>>> >>>> [1] https://commitfest.postgresql.org/26/2349/ <https://commitfest.postgresql.org/26/2349/; >>>> >>>> [2] https://commitfest.postgresql.org/26/2233/ <https://commitfest.postgresql.org/26/2233/; >>>> >>>> As a reviewer I have no idea which of the threads to look at - certainly >>>> not without reading both threads, which I doubt anyone will really do. >>>> The reviews and discussions are somewhat intermixed between those two >>>> threads, which makes it even more confusing. >>>> >>>> I think we should agree on a minimal patch combining the necessary/good >>>> bits from the various patches, and terminate one of the threads (i.e. >>>> mark it as rejected or RWF). And we need to do that now, otherwise >>>> there's about 0% chance of getting this into v13. >>>> >>>> In general, I agree with the sentiment Rober expressed in [1] - the >>>> patch needs to be as small as possible, not adding "nice to have" >>>> features (like support for parallel queries - I very much doubt just >>>> using shared instead of local buffers is enough to make it work.) >>>> >>>> regards >>>> >>>> -- >>>> Tomas Vondra http://www.2ndQuadrant.com <http://www.2ndquadrant.com/; >>>> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services >>> >> > Attachments: [application/octet-stream] global_temporary_table_v7-pg13.patch (146.2K, ../../[email protected]/3-global_temporary_table_v7-pg13.patch) download | inline diff: diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 79430d2..b7173c7 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -158,6 +158,19 @@ static relopt_bool boolRelOpts[] = }, true }, + /* + * For global temp table only + * use AccessExclusiveLock for ensure safety + */ + { + { + "on_commit_delete_rows", + "global temp table on commit options", + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, + ShareUpdateExclusiveLock + }, + true + }, /* list terminator */ {{NULL}} }; @@ -1486,6 +1499,8 @@ bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind) { static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)}, {"fillfactor", RELOPT_TYPE_INT, offsetof(StdRdOptions, fillfactor)}, {"autovacuum_enabled", RELOPT_TYPE_BOOL, offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, enabled)}, @@ -1586,13 +1601,18 @@ build_reloptions(Datum reloptions, bool validate, bytea * partitioned_table_reloptions(Datum reloptions, bool validate) { + static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)} + }; + /* * There are no options for partitioned tables yet, but this is able to do * some validation. */ return (bytea *) build_reloptions(reloptions, validate, RELOPT_KIND_PARTITIONED, - 0, NULL, 0); + sizeof(StdRdOptions), tab, lengthof(tab)); } /* diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index dd975b1..1610e7d 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -1013,7 +1013,9 @@ gistGetFakeLSN(Relation rel) { static XLogRecPtr counter = FirstNormalUnloggedLSN; - if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + /* global temp is same as local temp table */ + if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + rel->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { /* * Temporary relations are only accessible in our session, so a simple diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 4871b7f..16b00c9 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -149,7 +149,9 @@ hashbuild(Relation heap, Relation index, IndexInfo *indexInfo) * metapage, nor the first bitmap page. */ sort_threshold = (maintenance_work_mem * 1024L) / BLCKSZ; - if (index->rd_rel->relpersistence != RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + if (!(index->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + index->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) sort_threshold = Min(sort_threshold, NBuffers); else sort_threshold = Min(sort_threshold, NLocBuffer); diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index 1f6f6d0..5727ccd 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -598,7 +598,7 @@ heapam_relation_set_new_filenode(Relation rel, */ *minmulti = GetOldestMultiXactId(); - srel = RelationCreateStorage(*newrnode, persistence); + srel = RelationCreateStorage(*newrnode, persistence, rel); /* * If required, set up an init fork for an unlogged table so that it can @@ -651,7 +651,7 @@ heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index b331f4c..cd02c6b 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -62,6 +62,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/dbcommands.h" #include "commands/progress.h" #include "commands/vacuum.h" @@ -397,8 +398,10 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, Assert(params->truncate != VACOPT_TERNARY_DEFAULT); /* not every AM requires these to be valid, but heap does */ - Assert(TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); - Assert(MultiXactIdIsValid(onerel->rd_rel->relminmxid)); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relfrozenxid == InvalidTransactionId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && TransactionIdIsNormal(onerel->rd_rel->relfrozenxid))); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relminmxid == InvalidMultiXactId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && MultiXactIdIsValid(onerel->rd_rel->relminmxid))); /* measure elapsed time iff autovacuum logging requires it */ if (IsAutoVacuumWorkerProcess() && params->log_min_duration >= 0) diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index f05cbe7..946c9d2 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -763,7 +763,14 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access) /* Read an existing block of the relation */ buf = ReadBuffer(rel, blkno); LockBuffer(buf, access); - _bt_checkpage(rel, buf); + + /* global temp table may be not yet initialized for this backend. */ + if (RELATION_IS_GLOBAL_TEMP(rel) && + blkno == BTREE_METAPAGE && + PageIsNew(BufferGetPage(buf))) + _bt_initmetapage(BufferGetPage(buf), P_NONE, 0); + else + _bt_checkpage(rel, buf); } else { diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 7f4f784..aba8a9f 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6327,6 +6327,10 @@ StartupXLOG(void) else recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID; + /* clean temp relation files */ + if (max_active_gtt > 0) + RemovePgTempFiles(); + /* * Check for signal files, and if so set up state for offline recovery */ diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index d5da81c..c753b0e 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -42,6 +42,7 @@ OBJS = \ pg_subscription.o \ pg_type.o \ storage.o \ + storage_gtt.o \ toasting.o include $(top_srcdir)/src/backend/common.mk diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c index 16cb6d8..f28f2c2 100644 --- a/src/backend/catalog/catalog.c +++ b/src/backend/catalog/catalog.c @@ -398,7 +398,9 @@ GetNewRelFileNode(Oid reltablespace, Relation pg_class, char relpersistence) switch (relpersistence) { + /* global temp table is same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); break; case RELPERSISTENCE_UNLOGGED: diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 0fdff29..bd3cd9d 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -61,6 +61,7 @@ #include "catalog/pg_type.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "commands/tablecmds.h" #include "commands/typecmds.h" #include "executor/executor.h" @@ -99,6 +100,7 @@ static void AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -404,6 +406,10 @@ heap_create(const char *relname, relpersistence, relkind); + /* global temp table not create storage file when catalog create */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + create_storage = false; + /* * Have the storage manager create the relation's disk file, if needed. * @@ -427,7 +433,7 @@ heap_create(const char *relname, case RELKIND_INDEX: case RELKIND_SEQUENCE: - RelationCreateStorage(rel->rd_node, relpersistence); + RelationCreateStorage(rel->rd_node, relpersistence, rel); break; case RELKIND_RELATION: @@ -956,6 +962,7 @@ AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -994,8 +1001,18 @@ AddNewRelationTuple(Relation pg_class_desc, break; } - new_rel_reltup->relfrozenxid = relfrozenxid; - new_rel_reltup->relminmxid = relminmxid; + /* global temp table not remember transaction info in catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + new_rel_reltup->relfrozenxid = InvalidTransactionId; + new_rel_reltup->relminmxid = InvalidMultiXactId; + } + else + { + new_rel_reltup->relfrozenxid = relfrozenxid; + new_rel_reltup->relminmxid = relminmxid; + } + new_rel_reltup->relowner = relowner; new_rel_reltup->reltype = new_type_oid; new_rel_reltup->reloftype = reloftype; @@ -1357,6 +1374,7 @@ heap_create_with_catalog(const char *relname, reloftypeid, ownerid, relkind, + relpersistence, relfrozenxid, relminmxid, PointerGetDatum(relacl), @@ -1441,11 +1459,15 @@ heap_create_with_catalog(const char *relname, */ StoreConstraints(new_rel_desc, cooked_constraints, is_internal); - /* - * If there's a special on-commit action, remember it - */ - if (oncommit != ONCOMMIT_NOOP) - register_on_commit_action(relid, oncommit); + /* global temp table register action when storage init */ + if (relpersistence != RELPERSISTENCE_GLOBAL_TEMP) + { + /* + * If there's a special on-commit action, remember it + */ + if (oncommit != ONCOMMIT_NOOP) + register_on_commit_action(relid, oncommit); + } /* * ok, the relation has been cataloged, so close our relations and return @@ -1937,6 +1959,13 @@ heap_drop_with_catalog(Oid relid) if (relid == defaultPartOid) update_default_partition_oid(parentOid, InvalidOid); + /* We allow to drop global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not drop relation when other backend attached this global temp table"); + } + /* * Schedule unlinking of the relation's physical files at commit. */ @@ -3165,7 +3194,7 @@ RemoveStatistics(Oid relid, AttrNumber attnum) * the specified relation. Caller must hold exclusive lock on rel. */ static void -RelationTruncateIndexes(Relation heapRelation) +RelationTruncateIndexes(Relation heapRelation, LOCKMODE lockmode) { ListCell *indlist; @@ -3177,7 +3206,7 @@ RelationTruncateIndexes(Relation heapRelation) IndexInfo *indexInfo; /* Open the index relation; use exclusive lock, just to be sure */ - currentIndex = index_open(indexId, AccessExclusiveLock); + currentIndex = index_open(indexId, lockmode); /* * Fetch info needed for index_build. Since we know there are no @@ -3223,8 +3252,13 @@ heap_truncate(List *relids) { Oid rid = lfirst_oid(cell); Relation rel; + LOCKMODE lockmode = AccessExclusiveLock; + + /* truncate global temp table only need RowExclusiveLock */ + if (get_rel_persistence(rid) == RELPERSISTENCE_GLOBAL_TEMP) + lockmode = RowExclusiveLock; - rel = table_open(rid, AccessExclusiveLock); + rel = table_open(rid, lockmode); relations = lappend(relations, rel); } @@ -3257,6 +3291,8 @@ void heap_truncate_one_rel(Relation rel) { Oid toastrelid; + LOCKMODE lockmode = AccessExclusiveLock; + bool truncate_toastrel = false; /* * Truncate the relation. Partitioned tables have no storage, so there is @@ -3265,23 +3301,40 @@ heap_truncate_one_rel(Relation rel) if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) return; + toastrelid = rel->rd_rel->reltoastrelid; + + /* + * Truncate global temp table only need RowExclusiveLock + */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + lockmode = RowExclusiveLock; + if (OidIsValid(toastrelid) && + gtt_storage_attached(toastrelid)) + truncate_toastrel = true; + } + else if (OidIsValid(toastrelid)) + truncate_toastrel = true; + /* Truncate the underlying relation */ table_relation_nontransactional_truncate(rel); /* If the relation has indexes, truncate the indexes too */ - RelationTruncateIndexes(rel); + RelationTruncateIndexes(rel, lockmode); /* If there is a toast table, truncate that too */ - toastrelid = rel->rd_rel->reltoastrelid; - if (OidIsValid(toastrelid)) + if (truncate_toastrel) { - Relation toastrel = table_open(toastrelid, AccessExclusiveLock); + Relation toastrel = table_open(toastrelid, lockmode); table_relation_nontransactional_truncate(toastrel); - RelationTruncateIndexes(toastrel); + RelationTruncateIndexes(toastrel, lockmode); /* keep the lock... */ table_close(toastrel, NoLock); } + + if (RELATION_IS_GLOBAL_TEMP(rel)) + up_gtt_relstats(rel, 0, 0, 0, RecentXmin, InvalidMultiXactId); } /* diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 3e59e64..9705b1d 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -52,6 +52,7 @@ #include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/event_trigger.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -877,6 +878,26 @@ index_create(Relation heapRelation, indexRelationName, RelationGetRelationName(heapRelation)))); } + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + if (accessMethodObjectId != BTREE_AM_OID) + elog(ERROR, "only support btree index on global temp table"); + + /* We allow to create index on global temp table only this session use it */ + if (is_other_backend_use_gtt(heapRelation->rd_node)) + elog(ERROR, "can not create index when have other backend attached this global temp table"); + + /* No support create index on global temp table use concurrent mode yet */ + if (concurrent) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot create indexes on global temporary tables using concurrent mode"))); + + /* if global temp table not init storage, then skip build index */ + if (!gtt_storage_attached(heapRelation->rd_node.relNode)) + flags |= INDEX_CREATE_SKIP_BUILD; + } + /* * construct tuple descriptor for index tuples */ @@ -2045,6 +2066,13 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) */ CheckTableNotInUse(userIndexRelation, "DROP INDEX"); + /* We allow to drop index on global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(userHeapRelation)) + { + if (is_other_backend_use_gtt(userHeapRelation->rd_node)) + elog(ERROR, "can not drop index when other backend attached this global temp table."); + } + /* * Drop Index Concurrently is more or less the reverse process of Create * Index Concurrently. @@ -2651,6 +2679,11 @@ index_update_stats(Relation rel, HeapTuple tuple; Form_pg_class rd_rel; bool dirty; + bool is_gtt = false; + + /* update index stats into localhash and rel_rd_rel for global temp table */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + is_gtt = true; /* * We always update the pg_class row using a non-transactional, @@ -2736,21 +2769,35 @@ index_update_stats(Relation rel, else /* don't bother for indexes */ relallvisible = 0; - if (rd_rel->relpages != (int32) relpages) + if (is_gtt) + rel->rd_rel->relpages = (int32) relpages; + else if (rd_rel->relpages != (int32) relpages) { rd_rel->relpages = (int32) relpages; dirty = true; } - if (rd_rel->reltuples != (float4) reltuples) + + if (is_gtt) + rel->rd_rel->reltuples = (float4) reltuples; + else if (rd_rel->reltuples != (float4) reltuples) { rd_rel->reltuples = (float4) reltuples; dirty = true; } - if (rd_rel->relallvisible != (int32) relallvisible) + + if (is_gtt) + rel->rd_rel->relallvisible = (int32) relallvisible; + else if (rd_rel->relallvisible != (int32) relallvisible) { rd_rel->relallvisible = (int32) relallvisible; dirty = true; } + + if (is_gtt) + { + up_gtt_relstats(rel, relpages, reltuples, relallvisible, + InvalidTransactionId, InvalidMultiXactId); + } } /* @@ -2864,6 +2911,12 @@ index_build(Relation heapRelation, pgstat_progress_update_multi_param(6, index, val); } + if (RELATION_IS_GLOBAL_TEMP(indexRelation)) + { + if (!gtt_storage_attached(indexRelation->rd_node.relNode)) + RelationCreateStorage(indexRelation->rd_node, RELPERSISTENCE_GLOBAL_TEMP, indexRelation); + } + /* * Call the access method's build procedure */ @@ -3459,6 +3512,15 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence, errmsg("cannot reindex temporary tables of other sessions"))); /* + * Because global temp table cannot change relfilenode + * no support reindex on global temp table yet. + */ + if (RELATION_IS_GLOBAL_TEMP(iRel)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot reindex global temporary tables"))); + + /* * Also check for active uses of the index in the current transaction; we * don't want to reindex underneath an open indexscan. */ diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index e70243a..301da79 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -647,6 +647,13 @@ RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid) errmsg("cannot create temporary relation in non-temporary schema"))); } break; + /* global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + if (isAnyTempNamespace(nspid)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("cannot create global temp relations in temporary schemas"))); + break; case RELPERSISTENCE_PERMANENT: if (isTempOrTempToastNamespace(nspid)) newRelation->relpersistence = RELPERSISTENCE_TEMP; diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index fddfbf1..671c614 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -26,6 +26,7 @@ #include "access/xlogutils.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "storage/freespace.h" #include "storage/smgr.h" @@ -75,7 +76,7 @@ static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */ * transaction aborts later on, the storage will be destroyed. */ SMgrRelation -RelationCreateStorage(RelFileNode rnode, char relpersistence) +RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel) { PendingRelDelete *pending; SMgrRelation srel; @@ -85,6 +86,8 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) switch (relpersistence) { case RELPERSISTENCE_TEMP: + /* global temp table use same storage strategy as local temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); needs_wal = false; break; @@ -117,6 +120,10 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) pending->next = pendingDeletes; pendingDeletes = pending; + /* remember global temp table storage info to localhash */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && rel) + remember_gtt_storage_info(rnode, rel); + return srel; } @@ -486,8 +493,15 @@ smgrDoPendingDeletes(bool isCommit) smgrdounlinkall(srels, nrels, false); for (i = 0; i < nrels; i++) + { smgrclose(srels[i]); + /* clean global temp table flags when transaction commit or rollback */ + if (SmgrIsTemp(srels[i]) && + gtt_storage_attached(srels[i]->smgr_rnode.node.relNode)) + forget_gtt_storage_info(srels[i]->smgr_rnode.node.relNode); + } + pfree(srels); } } diff --git a/src/backend/catalog/storage_gtt.c b/src/backend/catalog/storage_gtt.c new file mode 100644 index 0000000..f489cd3 --- /dev/null +++ b/src/backend/catalog/storage_gtt.c @@ -0,0 +1,1129 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.c + * code to create and destroy physical storage for global temparary table + * + * IDENTIFICATION + * src/backend/catalog/storage_gtt.c + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "access/table.h" +#include "access/visibilitymap.h" +#include "access/xact.h" +#include "access/xlog.h" +#include "access/xloginsert.h" +#include "access/xlogutils.h" +#include "access/htup_details.h" +#include "access/multixact.h" +#include "catalog/storage.h" +#include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" +#include "catalog/heap.h" +#include "catalog/namespace.h" +#include "catalog/pg_type.h" +#include "catalog/pg_statistic.h" +#include "commands/tablecmds.h" +#include "funcapi.h" +#include "nodes/primnodes.h" +#include "nodes/pg_list.h" +#include "nodes/execnodes.h" +#include "miscadmin.h" +#include "storage/freespace.h" +#include "storage/smgr.h" +#include "storage/ipc.h" +#include "storage/proc.h" +#include "storage/procarray.h" +#include "storage/lwlock.h" +#include "storage/shmem.h" +#include "storage/sinvaladt.h" +#include "utils/memutils.h" +#include "utils/rel.h" +#include "utils/hsearch.h" +#include "utils/catcache.h" +#include "utils/lsyscache.h" +#include <utils/relcache.h> +#include "utils/inval.h" +#include "utils/guc.h" + + +/* Copy from bitmapset.c, because gtt used the function in bitmapset.c */ +#define WORDNUM(x) ((x) / BITS_PER_BITMAPWORD) +#define BITNUM(x) ((x) % BITS_PER_BITMAPWORD) + +#define BITMAPSET_SIZE(nwords) \ + (offsetof(Bitmapset, words) + (nwords) * sizeof(bitmapword)) + +static bool gtt_cleaner_exit_registered = false; +static HTAB *gtt_storage_local_hash = NULL; +static HTAB *active_gtt_shared_hash = NULL; +static MemoryContext gtt_relstats_context = NULL; + +/* relfrozenxid of all gtts in the current session */ +static List *gtt_session_relfrozenxid_list = NIL; +static TransactionId gtt_session_frozenxid = InvalidTransactionId; + +typedef struct gtt_ctl_data +{ + LWLock lock; + int max_entry; + int entry_size; +}gtt_ctl_data; + +static gtt_ctl_data *gtt_shared_ctl = NULL; + +typedef struct +{ + RelFileNode rnode; + Bitmapset *map; + /* bitmap data */ +} gtt_shared_hash_entry; + +typedef struct +{ + Oid relid; + + Oid spcnode; + /* pg_class stat */ + int32 relpages; + float4 reltuples; + int32 relallvisible; + TransactionId relfrozenxid; + TransactionId relminmxid; + char relkind; + bool on_commit_delete; + + /* pg_statistic */ + int natts; + int *attnum; + HeapTuple *att_stat_tups; +} gtt_local_hash_entry; + +static Size action_gtt_shared_hash_entry_size(void); +static void gtt_storage_checkin(RelFileNode rnode); +static void gtt_storage_checkout(RelFileNode rnode, bool skiplock); +static void gtt_storage_removeall(int code, Datum arg); +static void insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid); +static void remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid); +static void set_gtt_session_relfrozenxid(void); + +Datum pg_get_gtt_statistics(PG_FUNCTION_ARGS); +Datum pg_get_gtt_relstats(PG_FUNCTION_ARGS); +Datum pg_gtt_attached_pid(PG_FUNCTION_ARGS); +Datum pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS); + + +static Size +action_gtt_shared_hash_entry_size(void) +{ + int wordnum; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + wordnum = WORDNUM(MaxBackends + 1); + hash_entry_size += MAXALIGN(sizeof(gtt_shared_hash_entry)); + hash_entry_size += MAXALIGN(BITMAPSET_SIZE(wordnum + 1)); + + return hash_entry_size; +} + +Size +active_gtt_shared_hash_size(void) +{ + Size size = 0; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + size = MAXALIGN(sizeof(gtt_ctl_data)); + hash_entry_size = action_gtt_shared_hash_entry_size(); + size += hash_estimate_size(max_active_gtt, hash_entry_size); + + return size; +} + +void +active_gtt_shared_hash_init(void) +{ + HASHCTL info; + bool found; + + if (max_active_gtt <= 0) + return; + + gtt_shared_ctl = + ShmemInitStruct("gtt_shared_ctl", + sizeof(gtt_ctl_data), + &found); + + if (!found) + { + LWLockRegisterTranche(LWTRANCHE_GTT_CTL, "gtt_shared_ctl"); + LWLockInitialize(>t_shared_ctl->lock, LWTRANCHE_GTT_CTL); + gtt_shared_ctl->max_entry = max_active_gtt; + gtt_shared_ctl->entry_size = action_gtt_shared_hash_entry_size(); + } + + info.keysize = sizeof(RelFileNode); + info.entrysize = gtt_shared_ctl->entry_size; + active_gtt_shared_hash = + ShmemInitHash("active gtt shared hash", + gtt_shared_ctl->max_entry, + gtt_shared_ctl->max_entry, + &info, HASH_ELEM | HASH_BLOBS | HASH_FIXED_SIZE); +} + +static void +gtt_storage_checkin(RelFileNode rnode) +{ + gtt_shared_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + entry = (gtt_shared_hash_entry *) hash_search(active_gtt_shared_hash, + &rnode, HASH_ENTER_NULL, &found); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of shared memory"), + errhint("You might need to increase max_active_gtt."))); + } + + if (found == false) + { + int wordnum; + + entry->map = (Bitmapset *)((char *)entry + MAXALIGN(sizeof(gtt_shared_hash_entry))); + wordnum = WORDNUM(MaxBackends + 1); + memset(entry->map, 0, BITMAPSET_SIZE(wordnum + 1)); + entry->map->nwords = wordnum + 1; + } + + bms_add_member(entry->map, MyBackendId); + LWLockRelease(>t_shared_ctl->lock); +} + +static void +gtt_storage_checkout(RelFileNode rnode, bool skiplock) +{ + gtt_shared_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (!skiplock) + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + + entry = hash_search(active_gtt_shared_hash, + (void *) &(rnode), HASH_FIND, NULL); + + if (entry == NULL) + { + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + elog(WARNING, "relfilenode %u/%u/%u not exist in gtt shared hash when forget", + rnode.dbNode, rnode.spcNode, rnode.relNode); + return; + } + + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + bms_del_member(entry->map, MyBackendId); + + if (bms_is_empty(entry->map)) + { + if (!hash_search(active_gtt_shared_hash, &rnode, HASH_REMOVE, NULL)) + elog(PANIC, "gtt shared hash table corrupted"); + } + + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + return; +} + +Bitmapset * +copy_active_gtt_bitmap(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + Bitmapset *map_copy = NULL; + + if (max_active_gtt <= 0) + return NULL; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return NULL; + } + + Assert(entry->map); + if (!bms_is_empty(entry->map)) + map_copy = bms_copy(entry->map); + + LWLockRelease(>t_shared_ctl->lock); + + return map_copy; +} + +bool +is_other_backend_use_gtt(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + bool in_use = false; + int num_use = 0; + + if (max_active_gtt <= 0) + return false; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return false; + } + + Assert(entry->map); + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + + num_use = bms_num_members(entry->map); + if (num_use == 0) + in_use = false; + else if (num_use == 1) + { + if(bms_is_member(MyBackendId, entry->map)) + in_use = false; + else + in_use = true; + } + else + in_use = true; + + LWLockRelease(>t_shared_ctl->lock); + + return in_use; +} + +void +remember_gtt_storage_info(RelFileNode rnode, Relation rel) +{ + gtt_local_hash_entry *entry; + MemoryContext oldcontext; + Oid relid = rnode.relNode; + bool found; + + if (max_active_gtt <= 0) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Global temporary table feature is disable"), + errhint("You might need to increase max_active_gtt to enable this feature."))); + + if (RecoveryInProgress()) + elog(ERROR, "readonly mode not support access global temp table yet"); + + if (gtt_storage_local_hash == NULL) + { +#define GTT_LOCAL_HASH_SIZE 1024 + /* First time through: initialize the hash table */ + HASHCTL ctl; + + MemSet(&ctl, 0, sizeof(ctl)); + ctl.keysize = sizeof(Oid); + ctl.entrysize = sizeof(gtt_local_hash_entry); + gtt_storage_local_hash = + hash_create("global temp relation table", + GTT_LOCAL_HASH_SIZE, + &ctl, HASH_ELEM | HASH_BLOBS); + + if (!CacheMemoryContext) + CreateCacheMemoryContext(); + + gtt_relstats_context = + AllocSetContextCreate(CacheMemoryContext, + "gtt relstats context", + ALLOCSET_DEFAULT_SIZES); + } + + /* Look up or create an entry */ + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_ENTER, &found); + + if (found) + { + elog(ERROR, "backend %d relid %u already exists in global temp table local hash", + MyBackendId, relid); + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + + entry->spcnode = rnode.spcNode; + entry->relpages = 0; + entry->reltuples = 0; + entry->relallvisible = 0; + entry->relkind = rel->rd_rel->relkind; + /* only heap contain transaction information */ + if (entry->relkind == RELKIND_RELATION || entry->relkind == RELKIND_PARTITIONED_TABLE) + { + int natts = RelationGetNumberOfAttributes(rel); + entry->natts = natts; + entry->attnum = palloc0(sizeof(int) * natts); + entry->att_stat_tups = palloc0(sizeof(HeapTuple) * natts); + + if (RELATION_GTT_ON_COMMIT_DELETE(rel)) + { + entry->on_commit_delete = true; + register_on_commit_action(rel->rd_node.relNode, ONCOMMIT_DELETE_ROWS); + } + + entry->relfrozenxid = RecentXmin; + entry->relminmxid = GetOldestMultiXactId(); + insert_gtt_relfrozenxid_to_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + gtt_storage_checkin(rnode); + } + else + { + entry->natts = 0; + entry->attnum = 0; + entry->att_stat_tups = NULL; + entry->on_commit_delete = false; + entry->relfrozenxid = 0; + entry->relminmxid = 0; + } + + MemoryContextSwitchTo(oldcontext); + + if (!gtt_cleaner_exit_registered) + { + before_shmem_exit(gtt_storage_removeall, 0); + gtt_cleaner_exit_registered = true; + } + + return; +} + +void +forget_gtt_storage_info(Oid relid) +{ + gtt_local_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, NULL); + + if (entry && entry->relkind == RELKIND_RELATION) + { + RelFileNode rnode; + int i; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + gtt_storage_checkout(rnode, false); + + Assert(TransactionIdIsNormal(entry->relfrozenxid)); + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + + for (i = 0; i < entry->natts; i++) + { + if (entry->att_stat_tups[i]) + { + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + } + } + } + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_REMOVE, NULL); + + return; +} + +/* is the storage file was created in this backend */ +bool +gtt_storage_attached(Oid relid) +{ + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, &found); + + return found; +} + +static void +gtt_storage_removeall(int code, Datum arg) +{ + HASH_SEQ_STATUS status; + gtt_local_hash_entry *entry; + int nrels = 0, + maxrels = 0; + SMgrRelation *srels = NULL; + RelFileNode *rnodes = NULL; + char *relkinds = NULL; + + if (gtt_storage_local_hash == NULL) + return; + + hash_seq_init(&status, gtt_storage_local_hash); + while ((entry = (gtt_local_hash_entry *) hash_seq_search(&status)) != NULL) + { + SMgrRelation srel; + RelFileNode rnode; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + srel = smgropen(rnode, MyBackendId); + + /* allocate the initial array, or extend it, if needed */ + if (maxrels == 0) + { + maxrels = 32; + srels = palloc(sizeof(SMgrRelation) * maxrels); + rnodes = palloc(sizeof(RelFileNode) * maxrels); + relkinds = palloc(sizeof(char) * maxrels); + } + else if (maxrels <= nrels) + { + maxrels *= 2; + srels = repalloc(srels, sizeof(SMgrRelation) * maxrels); + rnodes = repalloc(rnodes, sizeof(RelFileNode) * maxrels); + relkinds = repalloc(relkinds, sizeof(char) * maxrels); + } + + srels[nrels] = srel; + rnodes[nrels] = rnode; + relkinds[nrels] = entry->relkind; + nrels++; + } + + if (nrels > 0) + { + int i; + + smgrdounlinkall(srels, nrels, false); + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + for (i = 0; i < nrels; i++) + { + smgrclose(srels[i]); + if (relkinds[i] == RELKIND_RELATION) + gtt_storage_checkout(rnodes[i], true); + } + LWLockRelease(>t_shared_ctl->lock); + + pfree(srels); + pfree(rnodes); + pfree(relkinds); + } + + MyProc->session_gtt_frozenxid = InvalidTransactionId; + + return; +} + +/* + * Update global temp table relstats(relpage/reltuple/relallvisible) + * to local hashtable + */ +void +up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid) +{ + Oid relid = RelationGetRelid(relation); + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return; + + Assert(entry->spcnode); + + if (num_pages >= 0 && + entry->relpages != (int32)num_pages) + entry->relpages = (int32)num_pages; + + if (num_tuples >= 0 && + num_tuples != (float4)entry->reltuples) + entry->reltuples = (float4)num_tuples; + + /* only heap contain transaction information and relallvisible */ + if (entry->relkind == RELKIND_RELATION) + { + if (entry->relallvisible >= 0 && + entry->relallvisible != (int32)num_all_visible_pages) + { + entry->relallvisible = (int32)num_all_visible_pages; + } + + if (TransactionIdIsNormal(relfrozenxid) && + entry->relfrozenxid != relfrozenxid && + (TransactionIdPrecedes(entry->relfrozenxid, relfrozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), entry->relfrozenxid))) + { + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + entry->relfrozenxid = relfrozenxid; + insert_gtt_relfrozenxid_to_ordered_list(relfrozenxid); + set_gtt_session_relfrozenxid(); + } + + if (MultiXactIdIsValid(relminmxid) && + entry->relminmxid != relminmxid && + (MultiXactIdPrecedes(entry->relminmxid, relminmxid) || + MultiXactIdPrecedes(ReadNextMultiXactId(), entry->relminmxid))) + { + entry->relminmxid = relminmxid; + } + } + + return; +} + +/* + * Search global temp table relstats(relpage/reltuple/relallvisible) + * from local hashtable. + */ +bool +get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid) +{ + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return false; + + Assert(entry->relid == relid); + + if (relpages) + *relpages = entry->relpages; + + if (reltuples) + *reltuples = entry->reltuples; + + if (relallvisible) + *relallvisible = entry->relallvisible; + + if (relfrozenxid) + *relfrozenxid = entry->relfrozenxid; + + if (relminmxid) + *relminmxid = entry->relminmxid; + + return true; +} + +/* + * Update global temp table statistic info(definition is same as pg_statistic) + * to local hashtable where ananyze global temp table + */ +void +up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull) +{ + gtt_local_hash_entry *entry; + bool found; + MemoryContext oldcontext; + int i = 0; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return; + + if (entry->relkind != RELKIND_RELATION) + { + elog(WARNING, "oid %u not a relation", reloid); + return; + } + + /* todo */ + if (entry->natts < natts) + { + elog(WARNING, "reloid %u not support update attstat after add colunm", reloid); + return; + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + Assert(entry->relid == reloid); + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == 0) + { + entry->attnum[i] = attnum; + break; + } + else if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + break; + } + } + + Assert(i < entry->natts); + Assert(entry->att_stat_tups[i] == NULL); + entry->att_stat_tups[i] = heap_form_tuple(tupleDescriptor, values, isnull); + MemoryContextSwitchTo(oldcontext); + + return; +} + +/* + * Search global temp table statistic info(definition is same as pg_statistic) + * from local hashtable. + */ +HeapTuple +get_gtt_att_statistic(Oid reloid, int attnum, bool inh) +{ + gtt_local_hash_entry *entry; + bool found; + int i = 0; + + if (max_active_gtt <= 0) + return NULL; + + if (gtt_storage_local_hash == NULL) + return NULL; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return NULL; + + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + return entry->att_stat_tups[i]; + } + } + + return NULL; +} + +void +release_gtt_statistic_cache(HeapTuple tup) +{ + /* do nothing */ + return; +} + +static void +insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid) +{ + MemoryContext oldcontext; + ListCell *cell; + int i; + + Assert(TransactionIdIsNormal(relfrozenxid)); + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + /* Does the datum belong at the front? */ + if (gtt_session_relfrozenxid_list == NIL || + TransactionIdFollowsOrEquals(relfrozenxid, + linitial_oid(gtt_session_relfrozenxid_list))) + { + gtt_session_relfrozenxid_list = + lcons_oid(relfrozenxid, gtt_session_relfrozenxid_list); + MemoryContextSwitchTo(oldcontext); + + return; + } + + /* No, so find the entry it belongs after */ + i = 0; + foreach (cell, gtt_session_relfrozenxid_list) + { + if (TransactionIdFollowsOrEquals(relfrozenxid, lfirst_oid(cell))) + break; + + i++; + } + gtt_session_relfrozenxid_list = + list_insert_nth_oid(gtt_session_relfrozenxid_list, i, relfrozenxid); + MemoryContextSwitchTo(oldcontext); + + return; +} + +static void +remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid) +{ + gtt_session_relfrozenxid_list = + list_delete_oid(gtt_session_relfrozenxid_list, relfrozenxid); +} + +static void +set_gtt_session_relfrozenxid(void) +{ + TransactionId gtt_frozenxid = InvalidTransactionId; + + if (gtt_session_relfrozenxid_list) + gtt_frozenxid = llast_oid(gtt_session_relfrozenxid_list); + + gtt_session_frozenxid = gtt_frozenxid; + if (MyProc->session_gtt_frozenxid != gtt_frozenxid) + MyProc->session_gtt_frozenxid = gtt_frozenxid; +} + +Datum +pg_get_gtt_statistics(PG_FUNCTION_ARGS) +{ + HeapTuple tuple; + Relation rel = NULL; + int attnum = PG_GETARG_INT32(1); + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + MemoryContext oldcontext; + Tuplestorestate *tupstore; + Relation pg_tatistic = NULL; + TupleDesc sd; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not " \ + "allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + pg_tatistic = table_open(StatisticRelationId, AccessShareLock); + sd = RelationGetDescr(pg_tatistic); + + tuple = get_gtt_att_statistic(reloid, attnum, false); + if (tuple) + { + Datum values[31]; + bool isnull[31]; + HeapTuple res = NULL; + + memset(&values, 0, sizeof(values)); + memset(&isnull, 0, sizeof(isnull)); + heap_deform_tuple(tuple, sd, values, isnull); + res = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, res); + } + + table_close(rel, NoLock); + table_close(pg_tatistic, AccessShareLock); + tuplestore_donestoring(tupstore); + + return (Datum) 0; +} + +Datum +pg_get_gtt_relstats(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + uint32 relfrozenxid = 0; + uint32 relminmxid = 0; + Relation rel = NULL; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + if (get_gtt_relstats(reloid, + &relpages, &reltuples, &relallvisible, + &relfrozenxid, &relminmxid)) + { + Datum values[5]; + bool isnull[5]; + + memset(isnull, 0, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(relpages); + values[1] = Float4GetDatum((float4)reltuples); + values[2] = Int32GetDatum(relallvisible); + values[3] = UInt32GetDatum(relfrozenxid); + values[4] = UInt32GetDatum(relminmxid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_gtt_attached_pid(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + Relation rel = NULL; + PGPROC *proc = NULL; + Bitmapset *map = NULL; + pid_t pid = 0; + int backendid = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + map = copy_active_gtt_bitmap(rel->rd_node); + if (map) + { + backendid = bms_first_member(map); + + do + { + proc = BackendIdGetProc(backendid); + pid = proc->pid; + if (pid > 0) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = UInt32GetDatum(reloid); + values[1] = Int32GetDatum(pid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + backendid = bms_next_member(map, backendid); + } while (backendid > 0); + + pfree(map); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + int num_xid = MaxBackends + 1; + int *pids = NULL; + uint32 *xids = NULL; + int i = 0; + int j = 0; + uint32 oldest = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + if (max_active_gtt <= 0) + return (Datum) 0; + + if (RecoveryInProgress()) + return (Datum) 0; + + pids = palloc0(sizeof(int) * num_xid); + xids = palloc0(sizeof(int) * num_xid); + oldest = list_all_session_gtt_frozenxids(num_xid, pids, xids, &i); + if (i > 0) + { + if (i > 0) + { + pids[i] = 0; + xids[i] = oldest; + i++; + } + + for(j = 0; j < i; j++) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(pids[j]); + values[1] = UInt32GetDatum(xids[j]); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + } + tuplestore_donestoring(tupstore); + pfree(pids); + pfree(xids); + + return (Datum) 0; +} + diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index c9e75f4..2adde62 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -186,6 +186,91 @@ CREATE OR REPLACE VIEW pg_sequences AS WHERE NOT pg_is_other_temp_schema(N.oid) AND relkind = 'S'; +-- For global temporary table +CREATE VIEW pg_gtt_relstats WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_relstats(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_attached_pids WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_gtt_attached_pid(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_stats WITH (security_barrier) AS +SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN s.stakind1 = 1 THEN s.stavalues1 + WHEN s.stakind2 = 1 THEN s.stavalues2 + WHEN s.stakind3 = 1 THEN s.stavalues3 + WHEN s.stakind4 = 1 THEN s.stavalues4 + WHEN s.stakind5 = 1 THEN s.stavalues5 + END AS most_common_vals, + CASE + WHEN s.stakind1 = 1 THEN s.stanumbers1 + WHEN s.stakind2 = 1 THEN s.stanumbers2 + WHEN s.stakind3 = 1 THEN s.stanumbers3 + WHEN s.stakind4 = 1 THEN s.stanumbers4 + WHEN s.stakind5 = 1 THEN s.stanumbers5 + END AS most_common_freqs, + CASE + WHEN s.stakind1 = 2 THEN s.stavalues1 + WHEN s.stakind2 = 2 THEN s.stavalues2 + WHEN s.stakind3 = 2 THEN s.stavalues3 + WHEN s.stakind4 = 2 THEN s.stavalues4 + WHEN s.stakind5 = 2 THEN s.stavalues5 + END AS histogram_bounds, + CASE + WHEN s.stakind1 = 3 THEN s.stanumbers1[1] + WHEN s.stakind2 = 3 THEN s.stanumbers2[1] + WHEN s.stakind3 = 3 THEN s.stanumbers3[1] + WHEN s.stakind4 = 3 THEN s.stanumbers4[1] + WHEN s.stakind5 = 3 THEN s.stanumbers5[1] + END AS correlation, + CASE + WHEN s.stakind1 = 4 THEN s.stavalues1 + WHEN s.stakind2 = 4 THEN s.stavalues2 + WHEN s.stakind3 = 4 THEN s.stavalues3 + WHEN s.stakind4 = 4 THEN s.stavalues4 + WHEN s.stakind5 = 4 THEN s.stavalues5 + END AS most_common_elems, + CASE + WHEN s.stakind1 = 4 THEN s.stanumbers1 + WHEN s.stakind2 = 4 THEN s.stanumbers2 + WHEN s.stakind3 = 4 THEN s.stanumbers3 + WHEN s.stakind4 = 4 THEN s.stanumbers4 + WHEN s.stakind5 = 4 THEN s.stanumbers5 + END AS most_common_elem_freqs, + CASE + WHEN s.stakind1 = 5 THEN s.stanumbers1 + WHEN s.stakind2 = 5 THEN s.stanumbers2 + WHEN s.stakind3 = 5 THEN s.stanumbers3 + WHEN s.stakind4 = 5 THEN s.stanumbers4 + WHEN s.stakind5 = 5 THEN s.stanumbers5 + END AS elem_count_histogram + FROM + pg_class c + JOIN pg_attribute a ON c.oid = a.attrelid + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_statistics(c.oid, a.attnum, ''::text) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') and NOT a.attisdropped AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + CREATE VIEW pg_stats WITH (security_barrier) AS SELECT nspname AS schemaname, diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index c4420dd..977a984 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -34,6 +34,7 @@ #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "commands/dbcommands.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -103,7 +104,7 @@ static int acquire_inherited_sample_rows(Relation onerel, int elevel, HeapTuple *rows, int targrows, double *totalrows, double *totaldeadrows); static void update_attstats(Oid relid, bool inh, - int natts, VacAttrStats **vacattrstats); + int natts, VacAttrStats **vacattrstats, char relpersistence); static Datum std_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); @@ -586,14 +587,15 @@ do_analyze_rel(Relation onerel, VacuumParams *params, * pg_statistic for columns we didn't process, we leave them alone.) */ update_attstats(RelationGetRelid(onerel), inh, - attr_cnt, vacattrstats); + attr_cnt, vacattrstats, RelationGetRelPersistence(onerel)); for (ind = 0; ind < nindexes; ind++) { AnlIndexData *thisdata = &indexdata[ind]; update_attstats(RelationGetRelid(Irel[ind]), false, - thisdata->attr_cnt, thisdata->vacattrstats); + thisdata->attr_cnt, thisdata->vacattrstats, + RelationGetRelPersistence(Irel[ind])); } /* @@ -1456,7 +1458,7 @@ acquire_inherited_sample_rows(Relation onerel, int elevel, * by taking a self-exclusive lock on the relation in analyze_rel(). */ static void -update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) +update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats, char relpersistence) { Relation sd; int attno; @@ -1558,31 +1560,45 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) } } - /* Is there already a pg_statistic tuple for this attribute? */ - oldtup = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(relid), - Int16GetDatum(stats->attr->attnum), - BoolGetDatum(inh)); - - if (HeapTupleIsValid(oldtup)) + /* Update column statistic to localhash, not catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { - /* Yes, replace it */ - stup = heap_modify_tuple(oldtup, - RelationGetDescr(sd), - values, - nulls, - replaces); - ReleaseSysCache(oldtup); - CatalogTupleUpdate(sd, &stup->t_self, stup); + up_gtt_att_statistic(relid, + stats->attr->attnum, + inh, + natts, + RelationGetDescr(sd), + values, + nulls); } else { - /* No, insert new tuple */ - stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); - CatalogTupleInsert(sd, stup); - } + /* Is there already a pg_statistic tuple for this attribute? */ + oldtup = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(relid), + Int16GetDatum(stats->attr->attnum), + BoolGetDatum(inh)); - heap_freetuple(stup); + if (HeapTupleIsValid(oldtup)) + { + /* Yes, replace it */ + stup = heap_modify_tuple(oldtup, + RelationGetDescr(sd), + values, + nulls, + replaces); + ReleaseSysCache(oldtup); + CatalogTupleUpdate(sd, &stup->t_self, stup); + } + else + { + /* No, insert new tuple */ + stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); + CatalogTupleInsert(sd, stup); + } + + heap_freetuple(stup); + } } table_close(sd, RowExclusiveLock); diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index e9d7a7f..3088e26 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -391,6 +391,12 @@ cluster_rel(Oid tableOid, Oid indexOid, int options) errmsg("cannot vacuum temporary tables of other sessions"))); } + /* not support cluster global temp table yet */ + if (RELATION_IS_GLOBAL_TEMP(OldHeap)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("not support cluster global temporary tables yet"))); + /* * Also check for active uses of the relation in the current transaction, * including open scans and pending AFTER trigger events. diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 52ce02f..3d3f7dc 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2583,6 +2583,16 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind, !isTempNamespace(classtuple->relnamespace)) continue; + /* not support reindex on global temp table, so skip it */ + if (classtuple->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + ereport(WARNING, + (errmsg("global temp table \"%s.%s\" skip reindexed", + get_namespace_name(get_rel_namespace(relid)), + get_rel_name(relid)))); + continue; + } + /* Check user/system classification, and optionally skip */ if (objectKind == REINDEX_OBJECT_SYSTEM && !IsSystemClass(relid, classtuple)) diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c index 329ab84..dfa257c 100644 --- a/src/backend/commands/lockcmds.c +++ b/src/backend/commands/lockcmds.c @@ -96,7 +96,8 @@ RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, * transaction. */ relpersistence = get_rel_persistence(relid); - if (relpersistence == RELPERSISTENCE_TEMP) + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPNAMESPACE; /* Check permissions. */ diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 6aab73b..44f350d 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -94,7 +94,7 @@ static HTAB *seqhashtab = NULL; /* hash table for SeqTable items */ */ static SeqTableData *last_used_seq = NULL; -static void fill_seq_with_data(Relation rel, HeapTuple tuple); +static void fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf); static Relation lock_and_open_sequence(SeqTable seq); static void create_seq_hashtable(void); static void init_sequence(Oid relid, SeqTable *p_elm, Relation *p_rel); @@ -108,6 +108,7 @@ static void init_params(ParseState *pstate, List *options, bool for_identity, List **owned_by); static void do_setval(Oid relid, int64 next, bool iscalled); static void process_owned_by(Relation seqrel, List *owned_by, bool for_identity); +int64 get_seqence_start_value(Oid seqid); /* @@ -222,7 +223,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq) /* now initialize the sequence's data */ tuple = heap_form_tuple(tupDesc, value, null); - fill_seq_with_data(rel, tuple); + fill_seq_with_data(rel, tuple, InvalidBuffer); /* process OWNED BY if given */ if (owned_by) @@ -327,7 +328,7 @@ ResetSequence(Oid seq_relid) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seq_rel, tuple); + fill_seq_with_data(seq_rel, tuple, InvalidBuffer); /* Clear local cache so that we don't think we have cached numbers */ /* Note that we do not change the currval() state */ @@ -340,17 +341,21 @@ ResetSequence(Oid seq_relid) * Initialize a sequence's relation with the specified tuple as content */ static void -fill_seq_with_data(Relation rel, HeapTuple tuple) +fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf) { - Buffer buf; Page page; sequence_magic *sm; OffsetNumber offnum; + bool lockBuffer = false; /* Initialize first page of relation with special magic number */ - buf = ReadBuffer(rel, P_NEW); - Assert(BufferGetBlockNumber(buf) == 0); + if (buf == InvalidBuffer) + { + buf = ReadBuffer(rel, P_NEW); + Assert(BufferGetBlockNumber(buf) == 0); + lockBuffer = true; + } page = BufferGetPage(buf); @@ -360,7 +365,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) /* Now insert sequence tuple */ - LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); + if (lockBuffer) + LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); /* * Since VACUUM does not process sequences, we have to force the tuple to @@ -410,7 +416,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) END_CRIT_SECTION(); - UnlockReleaseBuffer(buf); + if (lockBuffer) + UnlockReleaseBuffer(buf); } /* @@ -502,7 +509,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seqrel, newdatatuple); + fill_seq_with_data(seqrel, newdatatuple, InvalidBuffer); } /* process OWNED BY if given */ @@ -1178,6 +1185,25 @@ read_seq_tuple(Relation rel, Buffer *buf, HeapTuple seqdatatuple) LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); page = BufferGetPage(*buf); + if (GlobalTempRelationPageIsNotInitialized(rel, page)) + { + /* Initialize sequence for global temporary tables */ + Datum value[SEQ_COL_LASTCOL] = {0}; + bool null[SEQ_COL_LASTCOL] = {false}; + HeapTuple tuple; + int64 startv = get_seqence_start_value(RelationGetRelid(rel)); + + /* + * last_value from pg_sequence.seqstart + * log_cnt = 0 + * is_called = false + */ + value[SEQ_COL_LASTVAL-1] = Int64GetDatumFast(startv); /* start sequence with 1 */ + + tuple = heap_form_tuple(RelationGetDescr(rel), value, null); + fill_seq_with_data(rel, tuple, *buf); + heap_freetuple(tuple); + } sm = (sequence_magic *) PageGetSpecialPointer(page); if (sm->magic != SEQ_MAGIC) @@ -1954,3 +1980,23 @@ seq_mask(char *page, BlockNumber blkno) mask_unused_space(page); } + +int64 +get_seqence_start_value(Oid seqid) +{ + HeapTuple seqtuple; + Form_pg_sequence seqform; + int64 start; + + seqtuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(seqid)); + if (!HeapTupleIsValid(seqtuple)) + elog(ERROR, "cache lookup failed for sequence %u", + seqid); + + seqform = (Form_pg_sequence) GETSTRUCT(seqtuple); + start = seqform->seqstart; + ReleaseSysCache(seqtuple); + + return start; +} + diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 30b72b6..cc5b991 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -47,6 +47,7 @@ #include "catalog/storage.h" #include "catalog/storage_xlog.h" #include "catalog/toasting.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/comment.h" #include "commands/defrem.h" @@ -552,6 +553,7 @@ static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTbl); static List *GetParentedForeignKeyRefs(Relation partition); static void ATDetachCheckNoForeignKeyRefs(Relation partition); +static bool has_oncommit_option(List *options); /* ---------------------------------------------------------------- @@ -597,6 +599,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, LOCKMODE parentLockmode; const char *accessMethod = NULL; Oid accessMethodId = InvalidOid; + bool has_oncommit_clause = false; /* * Truncate relname to appropriate length (probably a waste of time, as @@ -607,8 +610,10 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Check consistency of arguments */ + /* global temp table same as local temp table */ if (stmt->oncommit != ONCOMMIT_NOOP - && stmt->relation->relpersistence != RELPERSISTENCE_TEMP) + && !(stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("ON COMMIT can only be used on temporary tables"))); @@ -638,7 +643,9 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, * code. This is needed because calling code might not expect untrusted * tables to appear in pg_temp at the front of its search path. */ - if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP + /* global temp table same as local temp table */ + if ((stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) && InSecurityRestrictedOperation()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -739,6 +746,57 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Parse and validate reloptions, if any. */ + /* global temp table */ + has_oncommit_clause = has_oncommit_option(stmt->options); + if (stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (relkind == RELKIND_RELATION || relkind == RELKIND_PARTITIONED_TABLE)) + { + /* inherit table or parition table inherit on commit property from parent table*/ + if (inheritOids && stmt->oncommit == ONCOMMIT_NOOP && !has_oncommit_clause) + { + Oid parent = linitial_oid(inheritOids); + Relation relation = table_open(parent, NoLock); + + if (!RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "The parent table must be global temporary table"); + + if (RELATION_GTT_ON_COMMIT_DELETE(relation)) + stmt->oncommit = ONCOMMIT_DELETE_ROWS; + else + stmt->oncommit = ONCOMMIT_PRESERVE_ROWS; + table_close(relation, NoLock); + } + + if (has_oncommit_clause) + { + if (stmt->oncommit != ONCOMMIT_NOOP) + elog(ERROR, "can not defeine global temp table with on commit and with clause at same time"); + } + else + { + DefElem *opt = makeNode(DefElem); + + opt->type = T_DefElem; + opt->defnamespace = NULL; + opt->defname = "on_commit_delete_rows"; + opt->defaction = DEFELEM_UNSPEC; + + /* use reloptions to remember on commit clause */ + if (stmt->oncommit == ONCOMMIT_DELETE_ROWS) + opt->arg = (Node *)makeString("true"); + else if (stmt->oncommit == ONCOMMIT_PRESERVE_ROWS) + opt->arg = (Node *)makeString("false"); + else if (stmt->oncommit == ONCOMMIT_NOOP) + opt->arg = (Node *)makeString("false"); + else + elog(ERROR, "global temp table not support on commit drop clause"); + + stmt->options = lappend(stmt->options, opt); + } + } + else if (has_oncommit_clause) + elog(ERROR, "regular table cannot specifie on_commit_delete_rows"); + reloptions = transformRelOptions((Datum) 0, stmt->options, NULL, validnsps, true, false); @@ -1800,7 +1858,8 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged, * table or the current physical file to be thrown away anyway. */ if (rel->rd_createSubid == mySubid || - rel->rd_newRelfilenodeSubid == mySubid) + rel->rd_newRelfilenodeSubid == mySubid || + RELATION_IS_GLOBAL_TEMP(rel)) { /* Immediate, non-rollbackable truncation is OK */ heap_truncate_one_rel(rel); @@ -3359,6 +3418,13 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo * specially. */ targetrelation = relation_open(myrelid, is_index ? ShareUpdateExclusiveLock : AccessExclusiveLock); + + if (RELATION_IS_GLOBAL_TEMP(targetrelation)) + { + if (is_other_backend_use_gtt(targetrelation->rd_node)) + elog(ERROR, "can not rename relation when other backend attached this global temp table"); + } + namespaceId = RelationGetNamespace(targetrelation); /* @@ -3534,6 +3600,13 @@ AlterTable(AlterTableStmt *stmt, LOCKMODE lockmode, /* Caller is required to provide an adequate lock. */ rel = relation_open(context->relid, NoLock); + /* We allow to alter global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not alter relation when other backend attached this global temp table"); + } + CheckTableNotInUse(rel, "ALTER TABLE"); ATController(stmt, rel, stmt->cmds, stmt->relation->inh, lockmode, context); @@ -8099,6 +8172,13 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, errmsg("referenced relation \"%s\" is not a table", RelationGetRelationName(pkrel)))); + /* global temp table not support foreign key constraint yet */ + if (RELATION_IS_GLOBAL_TEMP(pkrel)) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("referenced relation \"%s\" is not a global temp table", + RelationGetRelationName(pkrel)))); + if (!allowSystemTableMods && IsSystemRelation(pkrel)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -8138,6 +8218,12 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("constraints on temporary tables must involve temporary tables of this session"))); break; + /* global temp table not support foreign key constraint yet */ + case RELPERSISTENCE_GLOBAL_TEMP: + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("not support foreign key constraints on global temp table yet"))); + break; } /* @@ -13174,7 +13260,7 @@ index_copy_data(Relation rel, RelFileNode newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, @@ -14581,7 +14667,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged) */ switch (rel->rd_rel->relpersistence) { + /* global temp table same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("cannot change logged status of table \"%s\" because it is temporary", @@ -17221,3 +17309,20 @@ ATDetachCheckNoForeignKeyRefs(Relation partition) table_close(rel, NoLock); } } + +static bool +has_oncommit_option(List *options) +{ + ListCell *listptr; + + foreach(listptr, options) + { + DefElem *def = (DefElem *) lfirst(listptr); + + if (pg_strcasecmp(def->defname, "on_commit_delete_rows") == 0) + return true; + } + + return false; +} + diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index d625d17..69ad24f 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -35,6 +35,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/defrem.h" #include "commands/vacuum.h" @@ -1217,6 +1218,17 @@ vac_update_relstats(Relation relation, HeapTuple ctup; Form_pg_class pgcform; bool dirty; + bool is_gtt = false; + + /* global temp table remember relstats to localhash and rel->rd_rel, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(relation)) + { + is_gtt = true; + up_gtt_relstats(relation, + num_pages, num_tuples, + num_all_visible_pages, + frozenxid, minmulti); + } rd = table_open(RelationRelationId, RowExclusiveLock); @@ -1230,17 +1242,26 @@ vac_update_relstats(Relation relation, /* Apply statistical updates, if any, to copied tuple */ dirty = false; - if (pgcform->relpages != (int32) num_pages) + + if (is_gtt) + relation->rd_rel->relpages = (int32) num_pages; + else if (pgcform->relpages != (int32) num_pages) { pgcform->relpages = (int32) num_pages; dirty = true; } - if (pgcform->reltuples != (float4) num_tuples) + + if (is_gtt) + relation->rd_rel->reltuples = (float4) num_tuples; + else if (pgcform->reltuples != (float4) num_tuples) { pgcform->reltuples = (float4) num_tuples; dirty = true; } - if (pgcform->relallvisible != (int32) num_all_visible_pages) + + if (is_gtt) + relation->rd_rel->relallvisible = (int32) num_all_visible_pages; + else if (pgcform->relallvisible != (int32) num_all_visible_pages) { pgcform->relallvisible = (int32) num_all_visible_pages; dirty = true; @@ -1285,7 +1306,8 @@ vac_update_relstats(Relation relation, * This should match vac_update_datfrozenxid() concerning what we consider * to be "in the future". */ - if (TransactionIdIsNormal(frozenxid) && + if (!is_gtt && + TransactionIdIsNormal(frozenxid) && pgcform->relfrozenxid != frozenxid && (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || TransactionIdPrecedes(ReadNewTransactionId(), @@ -1296,7 +1318,8 @@ vac_update_relstats(Relation relation, } /* Similarly for relminmxid */ - if (MultiXactIdIsValid(minmulti) && + if (!is_gtt && + MultiXactIdIsValid(minmulti) && pgcform->relminmxid != minmulti && (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) @@ -1394,6 +1417,10 @@ vac_update_datfrozenxid(void) continue; } + /* global temp table relstats not in pg_class */ + if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + continue; + /* * Some table AMs might not need per-relation xid / multixid horizons. * It therefore seems reasonable to allow relfrozenxid and relminmxid @@ -1451,6 +1478,25 @@ vac_update_datfrozenxid(void) Assert(TransactionIdIsNormal(newFrozenXid)); Assert(MultiXactIdIsValid(newMinMulti)); + /* + * Global temp table get frozenxid from MyProc + * to avoid the vacuum truncate clog that gtt need. + */ + if (max_active_gtt > 0) + { + TransactionId oldest_gtt_frozenxid = + list_all_session_gtt_frozenxids(0, NULL, NULL, NULL); + + if (TransactionIdIsNormal(oldest_gtt_frozenxid) && + TransactionIdPrecedes(oldest_gtt_frozenxid, newFrozenXid)) + { + ereport(WARNING, + (errmsg("global temp table oldest FrozenXid is far in the past"), + errhint("please truncate them or kill those sessions that use them."))); + newFrozenXid = oldest_gtt_frozenxid; + } + } + /* Now fetch the pg_database tuple we need to update. */ relation = table_open(DatabaseRelationId, RowExclusiveLock); diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 8286d9c..c3992a4 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -591,6 +591,8 @@ static void set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) { + char relpersistence; + /* * The flag has previously been initialized to false, so we can just * return if it becomes clear that we can't safely set it. @@ -618,7 +620,11 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, * the rest of the necessary infrastructure right now anyway. So * for now, bail out if we see a temporary table. */ - if (get_rel_persistence(rte->relid) == RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + relpersistence = get_rel_persistence(rte->relid); + + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) return; /* diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index d6f2153..310a9e2 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -6312,7 +6312,9 @@ plan_create_index_workers(Oid tableOid, Oid indexOid) * Furthermore, any index predicate or index expressions must be parallel * safe. */ + /* global temp table is same as local temp table */ if (heap->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + heap->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP || !is_parallel_safe(root, (Node *) RelationGetIndexExpressions(index)) || !is_parallel_safe(root, (Node *) RelationGetIndexPredicate(index))) { diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 748bebf..a5ddbcd 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2579,6 +2579,11 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("materialized views must not use temporary tables or views"))); + if (is_query_using_gtt(query)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialized views must not use global temporary tables or views"))); + /* * A materialized view would either need to save parameters for use in * maintaining/loading the data or prohibit them entirely. The latter diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index ba5916b..0ee6931 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3290,17 +3290,11 @@ OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; } | LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; } | GLOBAL TEMPORARY { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; } | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; } @@ -11588,19 +11582,13 @@ OptTempTableName: } | GLOBAL TEMPORARY opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED opt_table qualified_name { diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index b875a50..123945b 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -81,6 +81,7 @@ static void expandTupleDesc(TupleDesc tupdesc, Alias *eref, List **colnames, List **colvars); static int specialAttNum(const char *attname); static bool isQueryUsingTempRelation_walker(Node *node, void *context); +static bool is_query_using_gtt_walker(Node *node, void *context); /* @@ -3579,3 +3580,49 @@ isQueryUsingTempRelation_walker(Node *node, void *context) isQueryUsingTempRelation_walker, context); } + +/* check if the query uses global temp table */ +static bool +is_query_using_gtt_walker(Node *node, void *context) +{ + if (node == NULL) + return false; + + if (IsA(node, Query)) + { + Query *query = (Query *) node; + ListCell *rtable; + + foreach(rtable, query->rtable) + { + RangeTblEntry *rte = lfirst(rtable); + + if (rte->rtekind == RTE_RELATION) + { + Relation rel = relation_open(rte->relid, AccessShareLock); + char relpersistence = rel->rd_rel->relpersistence; + + relation_close(rel, AccessShareLock); + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + return true; + } + } + + return query_tree_walker(query, + is_query_using_gtt_walker, + context, + QTW_IGNORE_JOINALIASES); + } + + return expression_tree_walker(node, + is_query_using_gtt_walker, + context); +} + +/* check if the query uses global temp table */ +bool +is_query_using_gtt(Query *query) +{ + return is_query_using_gtt_walker((Node *) query, NULL); +} + diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index ee2d2b5..9c9abaa 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -437,6 +437,9 @@ generateSerialExtraStmts(CreateStmtContext *cxt, ColumnDef *column, seqstmt->sequence = makeRangeVar(snamespace, sname, -1); seqstmt->options = seqoptions; + if (cxt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + seqstmt->sequence->relpersistence = cxt->relation->relpersistence; + /* * If a sequence data type was specified, add it to the options. Prepend * to the list rather than append; in case a user supplied their own AS diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 6d1f28c..ed837d1 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2086,6 +2086,11 @@ do_autovacuum(void) } continue; } + else if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + /* autovacuum skip vacuum global temp table */ + continue; + } /* Fetch reloptions and the pgstat entry for this table */ relopts = extract_autovac_opts(tuple, pg_class_desc); @@ -2152,7 +2157,9 @@ do_autovacuum(void) /* * We cannot safely process other backends' temp tables, so skip 'em. */ - if (classForm->relpersistence == RELPERSISTENCE_TEMP) + /* autovacuum skip vacuum global temp table */ + if (classForm->relpersistence == RELPERSISTENCE_TEMP || + classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) continue; relid = classForm->oid; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index aba3960..3c4b96c 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -37,6 +37,7 @@ #include "access/xlog.h" #include "catalog/catalog.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "executor/instrument.h" #include "lib/binaryheap.h" #include "miscadmin.h" @@ -52,6 +53,7 @@ #include "utils/rel.h" #include "utils/resowner_private.h" #include "utils/timestamp.h" +#include "utils/guc.h" /* Note: these two macros only work on shared buffers, not local ones! */ @@ -432,7 +434,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref) static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, - bool *hit); + bool *hit, Relation rel); static bool PinBuffer(BufferDesc *buf, BufferAccessStrategy strategy); static void PinBuffer_Locked(BufferDesc *buf); static void UnpinBuffer(BufferDesc *buf, bool fixOwner); @@ -664,7 +666,8 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, */ pgstat_count_buffer_read(reln); buf = ReadBuffer_common(reln->rd_smgr, reln->rd_rel->relpersistence, - forkNum, blockNum, mode, strategy, &hit); + forkNum, blockNum, mode, strategy, &hit, + reln); if (hit) pgstat_count_buffer_hit(reln); return buf; @@ -692,7 +695,7 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, Assert(InRecovery); return ReadBuffer_common(smgr, RELPERSISTENCE_PERMANENT, forkNum, blockNum, - mode, strategy, &hit); + mode, strategy, &hit, NULL); } @@ -704,7 +707,8 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, - BufferAccessStrategy strategy, bool *hit) + BufferAccessStrategy strategy, bool *hit, + Relation rel) { BufferDesc *bufHdr; Block bufBlock; @@ -719,6 +723,15 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, isExtend = (blockNum == P_NEW); + /* create storage when first read data page for gtt */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (isExtend || blockNum == 0) && + forkNum == MAIN_FORKNUM && + !gtt_storage_attached(smgr->smgr_rnode.node.relNode)) + { + RelationCreateStorage(smgr->smgr_rnode.node, relpersistence, rel); + } + TRACE_POSTGRESQL_BUFFER_READ_START(forkNum, blockNum, smgr->smgr_rnode.node.spcNode, smgr->smgr_rnode.node.dbNode, @@ -2809,6 +2822,16 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln) BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum) { + /* + * When this backend not init gtt storage + * return 0 + */ + if (RELATION_IS_GLOBAL_TEMP(relation) && + !gtt_storage_attached(relation->rd_node.relNode)) + { + return 0; + } + switch (relation->rd_rel->relkind) { case RELKIND_SEQUENCE: diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c index 427b0d5..7adb969 100644 --- a/src/backend/storage/ipc/ipci.c +++ b/src/backend/storage/ipc/ipci.c @@ -21,6 +21,7 @@ #include "access/nbtree.h" #include "access/subtrans.h" #include "access/twophase.h" +#include "catalog/storage_gtt.h" #include "commands/async.h" #include "miscadmin.h" #include "pgstat.h" @@ -147,6 +148,7 @@ CreateSharedMemoryAndSemaphores(void) size = add_size(size, BTreeShmemSize()); size = add_size(size, SyncScanShmemSize()); size = add_size(size, AsyncShmemSize()); + size = add_size(size, active_gtt_shared_hash_size()); #ifdef EXEC_BACKEND size = add_size(size, ShmemBackendArraySize()); #endif @@ -217,6 +219,8 @@ CreateSharedMemoryAndSemaphores(void) SUBTRANSShmemInit(); MultiXactShmemInit(); InitBufferPool(); + /* global temporary table */ + active_gtt_shared_hash_init(); /* * Set up lock manager diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index c3adb2e..eb95e5f 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -62,6 +62,7 @@ #include "utils/builtins.h" #include "utils/rel.h" #include "utils/snapmgr.h" +#include "utils/guc.h" #define UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) @@ -4087,3 +4088,77 @@ KnownAssignedXidsReset(void) LWLockRelease(ProcArrayLock); } + +/* + * search all active backend to get oldest frozenxid + * for global temp table. + */ +int +list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n) +{ + ProcArrayStruct *arrayP = procArray; + TransactionId result = InvalidTransactionId; + int index; + int flags = 0; + int i = 0; + + if (max_active_gtt <= 0) + return 0; + + if (max_size > 0) + { + Assert(pids); + Assert(xids); + Assert(n); + *n = 0; + } + + if (max_active_gtt <= 0) + return InvalidTransactionId; + + if (RecoveryInProgress()) + return InvalidTransactionId; + + flags |= PROC_IS_AUTOVACUUM; + flags |= PROC_IN_LOGICAL_DECODING; + + LWLockAcquire(ProcArrayLock, LW_SHARED); + if (max_size > 0 && max_size < arrayP->numProcs) + { + LWLockRelease(ProcArrayLock); + elog(ERROR, "list_all_gtt_frozenxids require more array"); + } + + for (index = 0; index < arrayP->numProcs; index++) + { + int pgprocno = arrayP->pgprocnos[index]; + volatile PGPROC *proc = &allProcs[pgprocno]; + volatile PGXACT *pgxact = &allPgXact[pgprocno]; + + if (pgxact->vacuumFlags & flags) + continue; + + if (proc->databaseId == MyDatabaseId && + TransactionIdIsNormal(proc->session_gtt_frozenxid)) + { + if (result == InvalidTransactionId) + result = proc->session_gtt_frozenxid; + else if (TransactionIdPrecedes(proc->session_gtt_frozenxid, result)) + result = proc->session_gtt_frozenxid; + + if (max_size > 0) + { + pids[i] = proc->pid; + xids[i] = proc->session_gtt_frozenxid; + i++; + } + } + } + LWLockRelease(ProcArrayLock); + + if (max_size > 0) + *n = i; + + return result; +} + diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 32df8c8..e4e1125 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -395,6 +395,7 @@ InitProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; @@ -577,6 +578,7 @@ InitAuxiliaryProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index 85b7115..f5eae8c 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -646,6 +646,12 @@ mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, */ if (zero_damaged_pages || InRecovery) MemSet(buffer, 0, BLCKSZ); + else if(SmgrIsTemp(reln) && blocknum == 0 && forknum == MAIN_FORKNUM) + { + /* global temp table init btree meta page */ + MemSet(buffer, 0, BLCKSZ); + mdwrite(reln, forknum, blocknum, buffer, true); + } else ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 7c6f057..eb10cf2 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -112,6 +112,7 @@ #include "catalog/pg_operator.h" #include "catalog/pg_statistic.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "executor/nodeAgg.h" #include "miscadmin.h" #include "nodes/makefuncs.h" @@ -4578,12 +4579,25 @@ examine_variable(PlannerInfo *root, Node *node, int varRelid, } else if (index->indpred == NIL) { - vardata->statsTuple = - SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(index->indexoid), - Int16GetDatum(pos + 1), - BoolGetDatum(false)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(index->indexoid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = + get_gtt_att_statistic(index->indexoid, + Int16GetDatum(pos + 1), + false); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + vardata->statsTuple = + SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(index->indexoid), + Int16GetDatum(pos + 1), + BoolGetDatum(false)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -4708,15 +4722,27 @@ examine_simple_variable(PlannerInfo *root, Var *var, } else if (rte->rtekind == RTE_RELATION) { - /* - * Plain table or parent of an inheritance appendrel, so look up the - * column in pg_statistic - */ - vardata->statsTuple = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(rte->relid), - Int16GetDatum(var->varattno), - BoolGetDatum(rte->inh)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(rte->relid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = get_gtt_att_statistic(rte->relid, + var->varattno, + rte->inh); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + /* + * Plain table or parent of an inheritance appendrel, so look up the + * column in pg_statistic + */ + vardata->statsTuple = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(rte->relid), + Int16GetDatum(var->varattno), + BoolGetDatum(rte->inh)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -6098,6 +6124,7 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, { /* Simple variable --- look to stats for the underlying table */ RangeTblEntry *rte = planner_rt_fetch(index->rel->relid, root); + char rel_persistence = get_rel_persistence(rte->relid); Assert(rte->rtekind == RTE_RELATION); relid = rte->relid; @@ -6115,6 +6142,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + rte->inh); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -6126,6 +6160,8 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* Expression --- maybe there are stats for the index itself */ relid = index->indexoid; colnum = 1; @@ -6141,6 +6177,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -7054,6 +7097,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, /* attempt to lookup stats in relation for this index column */ if (attnum != 0) { + char rel_persistence = get_rel_persistence(rte->relid); + /* Simple variable -- look to stats for the underlying table */ if (get_relation_stats_hook && (*get_relation_stats_hook) (root, rte, attnum, &vardata)) @@ -7066,6 +7111,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(rte->relid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = @@ -7078,6 +7131,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* * Looks like we've found an expression column in the index. Let's * see if there's any stats for it. @@ -7097,6 +7152,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(index->indexoid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 1e3e6d3..345e3e9 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -34,6 +34,7 @@ #include "catalog/pg_statistic.h" #include "catalog/pg_transform.h" #include "catalog/pg_type.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "utils/array.h" @@ -2878,6 +2879,18 @@ get_attavgwidth(Oid relid, AttrNumber attnum) if (stawidth > 0) return stawidth; } + if (get_rel_persistence(relid) == RELPERSISTENCE_GLOBAL_TEMP) + { + tp = get_gtt_att_statistic(relid, attnum, false); + if (!HeapTupleIsValid(tp)) + return 0; + + stawidth = ((Form_pg_statistic) GETSTRUCT(tp))->stawidth; + if (stawidth > 0) + return stawidth; + else + return 0; + } tp = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(relid), Int16GetDatum(attnum), diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index df025a5..1f733f4 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -63,6 +63,7 @@ #include "catalog/pg_type.h" #include "catalog/schemapg.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/policy.h" #include "commands/trigger.h" #include "miscadmin.h" @@ -1124,6 +1125,28 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) relation->rd_islocaltemp = false; } break; + case RELPERSISTENCE_GLOBAL_TEMP: + { + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + + relation->rd_backend = BackendIdForTempRelations(); + /* + * For global temp table, all backend can use + * this relation, so rd_islocaltemp always true. + */ + relation->rd_islocaltemp = true; + get_gtt_relstats(RelationGetRelid(relation), + &relpages, + &reltuples, + &relallvisible, + NULL, NULL); + relation->rd_rel->relpages = (int32)relpages; + relation->rd_rel->reltuples = (float4)reltuples; + relation->rd_rel->relallvisible = (int32)relallvisible; + } + break; default: elog(ERROR, "invalid relpersistence: %c", relation->rd_rel->relpersistence); @@ -3313,6 +3336,10 @@ RelationBuildLocalRelation(const char *relname, rel->rd_backend = BackendIdForTempRelations(); rel->rd_islocaltemp = true; break; + case RELPERSISTENCE_GLOBAL_TEMP: + rel->rd_backend = BackendIdForTempRelations(); + rel->rd_islocaltemp = true; + break; default: elog(ERROR, "invalid relpersistence: %c", relpersistence); break; @@ -3427,6 +3454,9 @@ RelationSetNewRelfilenode(Relation relation, char persistence) TransactionId freezeXid = InvalidTransactionId; RelFileNode newrnode; + if (RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "global temp table does not allow setting new relfilenode"); + /* Allocate a new relfilenode */ newrelfilenode = GetNewRelFileNode(relation->rd_rel->reltablespace, NULL, persistence); @@ -3467,7 +3497,7 @@ RelationSetNewRelfilenode(Relation relation, char persistence) /* handle these directly, at least for now */ SMgrRelation srel; - srel = RelationCreateStorage(newrnode, persistence); + srel = RelationCreateStorage(newrnode, persistence, relation); smgrclose(srel); } break; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index e44f71e..44c86c8 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -139,6 +139,18 @@ char *GUC_check_errmsg_string; char *GUC_check_errdetail_string; char *GUC_check_errhint_string; +/* + * num = 0 means disable global temp table feature. + * global temp table define can still storage in catalog + * just can not use. + * num > 0 means database can management num active global temp table. + */ +#define MIN_NUM_ACTIVE_GTT 0 +#define DEFAULT_NUM_ACTIVE_GTT 1000 +#define MAX_NUM_ACTIVE_GTT 1000000 + +int max_active_gtt = MIN_NUM_ACTIVE_GTT; + static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3, 4); static void set_config_sourcefile(const char *name, char *sourcefile, @@ -1992,6 +2004,15 @@ static struct config_bool ConfigureNamesBool[] = static struct config_int ConfigureNamesInt[] = { { + {"max_active_global_temporary_table", PGC_POSTMASTER, UNGROUPED, + gettext_noop("max active global temporary table."), + NULL + }, + &max_active_gtt, + DEFAULT_NUM_ACTIVE_GTT, MIN_NUM_ACTIVE_GTT, MAX_NUM_ACTIVE_GTT, + NULL, NULL, NULL + }, + { {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Forces a switch to the next WAL file if a " "new file has not been started within N seconds."), diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 799b698..b98d396 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15583,6 +15583,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) { char *ftoptions = NULL; char *srvname = NULL; + char *table_type = NULL; switch (tbinfo->relkind) { @@ -15634,9 +15635,15 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) binary_upgrade_set_pg_class_oids(fout, q, tbinfo->dobj.catId.oid, false); + if (tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED) + table_type = "UNLOGGED "; + else if (tbinfo->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + table_type = "GLOBAL TEMPORARY "; + else + table_type = ""; + appendPQExpBuffer(q, "CREATE %s%s %s", - tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ? - "UNLOGGED " : "", + table_type, reltypename, qualrelname); diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index f3c7eb9..28134e2 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3723,7 +3723,8 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys if (pset.sversion >= 90100) { appendPQExpBuffer(&buf, - ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + ",\n CASE c.relpersistence WHEN 'g' THEN '%s' WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + gettext_noop("session"), gettext_noop("permanent"), gettext_noop("temporary"), gettext_noop("unlogged"), diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 052d98b..f35d9bf 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -1003,6 +1003,8 @@ static const pgsql_thing_t words_after_create[] = { {"FOREIGN TABLE", NULL, NULL, NULL}, {"FUNCTION", NULL, NULL, Query_for_list_of_functions}, {"GROUP", Query_for_list_of_roles}, + {"GLOBAL", NULL, NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE GLOBAL TEMP/TEMPORARY TABLE + * ... */ {"INDEX", NULL, NULL, &Query_for_list_of_indexes}, {"LANGUAGE", Query_for_list_of_languages}, {"LARGE OBJECT", NULL, NULL, NULL, THING_NO_CREATE | THING_NO_DROP}, @@ -2326,6 +2328,9 @@ psql_completion(const char *text, int start, int end) /* CREATE FOREIGN DATA WRAPPER */ else if (Matches("CREATE", "FOREIGN", "DATA", "WRAPPER", MatchAny)) COMPLETE_WITH("HANDLER", "VALIDATOR", "OPTIONS"); + /* CREATE GLOBAL TEMP/TEMPORARY*/ + else if (Matches("CREATE", "GLOBAL")) + COMPLETE_WITH("TEMP", "TEMPORARY"); /* CREATE INDEX --- is allowed inside CREATE SCHEMA, so use TailMatches */ /* First off we complete CREATE UNIQUE with "INDEX" */ @@ -2534,6 +2539,8 @@ psql_completion(const char *text, int start, int end) /* Complete "CREATE TEMP/TEMPORARY" with the possible temp objects */ else if (TailMatches("CREATE", "TEMP|TEMPORARY")) COMPLETE_WITH("SEQUENCE", "TABLE", "VIEW"); + else if (TailMatches("CREATE", "GLOBAL", "TEMP|TEMPORARY")) + COMPLETE_WITH("TABLE"); /* Complete "CREATE UNLOGGED" with TABLE or MATVIEW */ else if (TailMatches("CREATE", "UNLOGGED")) COMPLETE_WITH("TABLE", "MATERIALIZED VIEW"); diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index a12fc1f..78958e4 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -165,6 +165,7 @@ typedef FormData_pg_class *Form_pg_class; #define RELPERSISTENCE_PERMANENT 'p' /* regular table */ #define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */ #define RELPERSISTENCE_TEMP 't' /* temporary table */ +#define RELPERSISTENCE_GLOBAL_TEMP 'g' /* global temporary table */ /* default selection for replica identity (primary key or nothing) */ #define REPLICA_IDENTITY_DEFAULT 'd' diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index fcf2a12..ba0bd5f 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5484,6 +5484,40 @@ proparallel => 'r', prorettype => 'float8', proargtypes => 'oid', prosrc => 'pg_stat_get_xact_function_self_time' }, +# For global temporary table +{ oid => '4191', + descr => 'List local statistics for global temporary table', + proname => 'pg_get_gtt_statistics', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid int4 anyelement', + proallargtypes => '{oid,int4,anyelement,oid,int2,bool,float4,int4,float4,int2,int2,int2,int2,int2,oid,oid,oid,oid,oid,oid,oid,oid,oid,oid,_float4,_float4,_float4,_float4,_float4,anyarray,anyarray,anyarray,anyarray,anyarray}', + proargmodes => '{i,i,i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}', + proargnames => '{relid,att,x,starelid,staattnum,stainherit,stanullfrac,stawidth,stadistinct,stakind1,stakind2,stakind3,stakind4,stakind5,staop1,staop2,staop3,staop4,staop5,stacoll1,stacoll2,stacoll3,stacoll4,stacoll5,stanumbers1,stanumbers2,stanumbers3,stanumbers4,stanumbers5,stavalues1,stavalues2,stavalues3,stavalues4,stavalues5}', + prosrc => 'pg_get_gtt_statistics' }, +{ oid => '4192', + descr => 'List local relstats for global temporary table', + proname => 'pg_get_gtt_relstats', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,int4,float4,int4,xid,xid}', + proargmodes => '{i,o,o,o,o,o}', + proargnames => '{relid,relpages,reltuples,relallvisible,relfrozenxid,relminmxid}', + prosrc => 'pg_get_gtt_relstats' }, +{ oid => '4193', + descr => 'List attached pid for one global temporary table', + proname => 'pg_gtt_attached_pid', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,oid,int4}', + proargmodes => '{i,o,o}', + proargnames => '{relid,relid,pid}', + prosrc => 'pg_gtt_attached_pid' }, +{ oid => '4194', + descr => 'List those backends that have used global temporary table', + proname => 'pg_list_gtt_relfrozenxids', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => '', + proallargtypes => '{int4,xid}', + proargmodes => '{o,o}', + proargnames => '{pid,relfrozenxid}', + prosrc => 'pg_list_gtt_relfrozenxids' }, + { oid => '3788', descr => 'statistics: timestamp of the current statistics snapshot', proname => 'pg_stat_get_snapshot_timestamp', provolatile => 's', diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h index 048003c..af48cdf 100644 --- a/src/include/catalog/storage.h +++ b/src/include/catalog/storage.h @@ -19,7 +19,7 @@ #include "storage/smgr.h" #include "utils/relcache.h" -extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence); +extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel); extern void RelationDropStorage(Relation rel); extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit); extern void RelationTruncate(Relation rel, BlockNumber nblocks); diff --git a/src/include/catalog/storage_gtt.h b/src/include/catalog/storage_gtt.h new file mode 100644 index 0000000..eacc214 --- /dev/null +++ b/src/include/catalog/storage_gtt.h @@ -0,0 +1,39 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.h + * prototypes for functions in backend/catalog/storage_gtt.c + * + * src/include/catalog/storage_gtt.h + * + *------------------------------------------------------------------------- + */ +#ifndef STORAGE_GTT_H +#define STORAGE_GTT_H + +#include "access/htup.h" +#include "storage/block.h" +#include "storage/relfilenode.h" +#include "utils/relcache.h" + +extern Size active_gtt_shared_hash_size(void); +extern void active_gtt_shared_hash_init(void); +extern void remember_gtt_storage_info(RelFileNode rnode, Relation rel); +extern void forget_gtt_storage_info(Oid relid); +extern bool is_other_backend_use_gtt(RelFileNode node); +extern bool gtt_storage_attached(Oid relid); +extern Bitmapset *copy_active_gtt_bitmap(RelFileNode node); +extern void up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull); +extern HeapTuple get_gtt_att_statistic(Oid reloid, int attnum, bool inh); +extern void release_gtt_statistic_cache(HeapTuple tup); +extern void up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid); +extern bool get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid); + +#endif /* STORAGE_H */ diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index 93f9446..14cafae 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -120,4 +120,7 @@ extern Oid attnumTypeId(Relation rd, int attid); extern Oid attnumCollationId(Relation rd, int attid); extern bool isQueryUsingTempRelation(Query *query); +/* global temp table check */ +extern bool is_query_using_gtt(Query *query); + #endif /* PARSE_RELATION_H */ diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 870ecb5..92c590e 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -405,6 +405,8 @@ do { \ #define PageClearPrunable(page) \ (((PageHeader) (page))->pd_prune_xid = InvalidTransactionId) +#define GlobalTempRelationPageIsNotInitialized(rel, page) \ + ((rel)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && PageIsNew(page)) /* ---------------------------------------------------------------- * extern declarations diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 8fda8e4..172eae9 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -220,6 +220,7 @@ typedef enum BuiltinTrancheIds LWTRANCHE_TBM, LWTRANCHE_PARALLEL_APPEND, LWTRANCHE_SXACT, + LWTRANCHE_GTT_CTL, LWTRANCHE_FIRST_USER_DEFINED } BuiltinTrancheIds; diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 5b407e6..f13250a 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -117,6 +117,8 @@ struct PGPROC Oid tempNamespaceId; /* OID of temp schema this backend is * using */ + TransactionId session_gtt_frozenxid; /* session level global temp table relfrozenxid */ + bool isBackgroundWorker; /* true if background worker. */ /* diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index a5c7d0c..a86f61f 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -125,4 +125,6 @@ extern void ProcArraySetReplicationSlotXmin(TransactionId xmin, extern void ProcArrayGetReplicationSlotXmin(TransactionId *xmin, TransactionId *catalog_xmin); +extern int list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n); + #endif /* PROCARRAY_H */ diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index ce93ace..0f7262e 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -281,6 +281,10 @@ extern int tcp_user_timeout; extern bool trace_sort; #endif +/* global temporary table */ +extern int max_active_gtt; +/* end */ + /* * Functions exported by guc.c */ diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 44ed04d..3f9720d 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -277,6 +277,7 @@ typedef struct StdRdOptions int parallel_workers; /* max number of parallel workers */ bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */ bool vacuum_truncate; /* enables vacuum to truncate a relation */ + bool on_commit_delete_rows; /* global temp table */ } StdRdOptions; #define HEAP_MIN_FILLFACTOR 10 @@ -535,7 +536,8 @@ typedef struct ViewOptions * True if relation's pages are stored in local buffers. */ #define RelationUsesLocalBuffers(relation) \ - ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP || \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) /* * RELATION_IS_LOCAL @@ -602,6 +604,17 @@ typedef struct ViewOptions RelationNeedsWAL(relation) && \ !IsCatalogRelation(relation)) +/* global temp table implementations */ +#define RELATION_IS_GLOBAL_TEMP(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + +#define RELATION_GTT_ON_COMMIT_DELETE(relation) \ + ((relation)->rd_options && \ + ((relation)->rd_rel->relkind == RELKIND_RELATION || (relation)->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) && \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP ? \ + ((StdRdOptions *) (relation)->rd_options)->on_commit_delete_rows : false) + +#define RelationGetRelPersistence(relation) ((relation)->rd_rel->relpersistence) + /* routines in utils/cache/relcache.c */ extern void RelationIncrementReferenceCount(Relation rel); extern void RelationDecrementReferenceCount(Relation rel); diff --git a/src/test/regress/expected/gtt_clean.out b/src/test/regress/expected/gtt_clean.out new file mode 100644 index 0000000..50ca9ac --- /dev/null +++ b/src/test/regress/expected/gtt_clean.out @@ -0,0 +1,7 @@ +reset search_path; +drop schema gtt cascade; +NOTICE: drop cascades to 4 other objects +DETAIL: drop cascades to table gtt.gtt1 +drop cascades to table gtt.gtt2 +drop cascades to table gtt.gtt3 +drop cascades to table gtt.gtt_t_kenyon diff --git a/src/test/regress/expected/gtt_function.out b/src/test/regress/expected/gtt_function.out new file mode 100644 index 0000000..a477917 --- /dev/null +++ b/src/test/regress/expected/gtt_function.out @@ -0,0 +1,197 @@ +CREATE SCHEMA IF NOT EXISTS gtt_function; +set search_path=gtt_function,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt_test_rename(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); +ERROR: cannot create indexes on global temporary tables using concurrent mode +-- ERROR +cluster gtt1 using gtt1_pkey; +ERROR: not support cluster global temporary tables yet +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; +ERROR: ON COMMIT can only be used on temporary tables +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); +ERROR: regular table cannot specifie on_commit_delete_rows +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; + count +------- + 2 +(1 row) + +commit; +select count(*) from p_table01; + count +------- + 0 +(1 row) + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +ERROR: The parent table must be global temporary table +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + relname | relkind | relpersistence | reloptions +---------------------------------+---------+----------------+------------------------------- + p_table01 | p | g | {on_commit_delete_rows=true} + p_table01_2017 | r | g | {on_commit_delete_rows=true} + p_table01_2018 | r | g | {on_commit_delete_rows=true} + p_table01_id_seq | S | g | + p_table02 | p | g | {on_commit_delete_rows=false} + p_table02_2017 | r | g | {on_commit_delete_rows=false} + p_table02_2018 | r | g | {on_commit_delete_rows=false} + p_table02_id_seq | S | g | + tbl_inherits_parent | r | p | + tbl_inherits_parent_global_temp | r | g | {on_commit_delete_rows=true} + tbl_inherits_partition | r | g | {on_commit_delete_rows=true} +(11 rows) + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; +ERROR: global temp table not support on commit drop clause +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; +ERROR: can not defeine global temp table with on commit and with clause at same time +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); +--ok +alter table gtt_test_rename rename to gtt_test; +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; + id | a +----+--- + 2 | 1 + 3 | 2 +(2 rows) + +truncate gtt_seq; +select * from gtt_seq order by id; + id | a +----+--- +(0 rows) + +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + id | a +----+--- + 4 | 3 +(1 row) + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; +ERROR: materialized views must not use global temporary tables or views +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +ERROR: only support btree index on global temp table +create index idx_err on gtt1 using gist (a); +ERROR: data type integer has no default operator class for access method "gist" +HINT: You must specify an operator class for the index or define a default operator class for the data type. +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +ERROR: only support btree index on global temp table +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); +ERROR: only support btree index on global temp table +reset search_path; +drop schema gtt_function cascade; +NOTICE: drop cascades to 15 other objects +DETAIL: drop cascades to table gtt_function.gtt1 +drop cascades to table gtt_function.gtt_test +drop cascades to table gtt_function.gtt2 +drop cascades to table gtt_function.gtt3 +drop cascades to table gtt_function.tmp_t0 +drop cascades to table gtt_function.tbl_inherits_parent +drop cascades to table gtt_function.tbl_inherits_parent_global_temp +drop cascades to table gtt_function.products +drop cascades to table gtt_function.measurement +drop cascades to table gtt_function.p_table01 +drop cascades to table gtt_function.p_table02 +drop cascades to table gtt_function.tbl_inherits_partition +drop cascades to table gtt_function.gtt5 +drop cascades to table gtt_function.mytable +drop cascades to table gtt_function.gtt_seq diff --git a/src/test/regress/expected/gtt_parallel_1.out b/src/test/regress/expected/gtt_parallel_1.out new file mode 100644 index 0000000..30d8a7b --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_1.out @@ -0,0 +1,84 @@ +set search_path=gtt,sys; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_parallel_2.out b/src/test/regress/expected/gtt_parallel_2.out new file mode 100644 index 0000000..850ef3e --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_2.out @@ -0,0 +1,161 @@ +set search_path=gtt,sys; +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +commit; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 + 3 | test1 +(3 rows) + +rollback; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test2 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; + a | b +---+------- + 3 | test3 +(1 row) + +rollback; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; + a | b +---+------- + 5 | test5 +(1 row) + +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + a | b +---+------- + 6 | test6 +(1 row) + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; + count +-------- + 100000 +(1 row) + +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + QUERY PLAN +------------------------------------ + Index Scan using gtt3_pkey on gtt3 + Index Cond: (a = 300) +(2 rows) + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; + relname | pg_relation_size | pg_relation_size | pg_table_size | pg_indexes_size | pg_total_relation_size +--------------+------------------+------------------+---------------+-----------------+------------------------ + gtt_t_kenyon | 450560 | 8192 | 499712 | 475136 | 974848 +(1 row) + +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + relname +-------------- + gtt_t_kenyon +(1 row) + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + relname | pg_relation_size | pg_table_size | pg_total_relation_size +--------------------+------------------+---------------+------------------------ + idx_gtt_t_kenyon_1 | 65536 | 65536 | 65536 + idx_gtt_t_kenyon_2 | 409600 | 409600 | 409600 +(2 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_prepare.out b/src/test/regress/expected/gtt_prepare.out new file mode 100644 index 0000000..9fe5fd4 --- /dev/null +++ b/src/test/regress/expected/gtt_prepare.out @@ -0,0 +1,9 @@ +CREATE SCHEMA IF NOT EXISTS gtt; +set search_path=gtt,sys; +create global temp table gtt1(a int primary key, b text) on commit delete rows; +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text); +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; diff --git a/src/test/regress/expected/gtt_stats.out b/src/test/regress/expected/gtt_stats.out new file mode 100644 index 0000000..b258b7c --- /dev/null +++ b/src/test/regress/expected/gtt_stats.out @@ -0,0 +1,76 @@ +CREATE SCHEMA IF NOT EXISTS gtt_stats; +set search_path=gtt_stats,sys; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +insert into gtt values(generate_series(1,10000),'test'); +-- expect 1 +select count(*) from pg_gtt_attached_pids; + count +------- + 1 +(1 row) + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 2 +(1 row) + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 0 | 0 | 0 +(1 row) + +-- expect 0 +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+------------------+-------------+-------------------+------------------------+---------------------- +(0 rows) + +analyze gtt; +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 55 | 10000 | 0 +(1 row) + +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------------------+------------------------+---------------------- + gtt_stats | gtt | a | f | 0 | 4 | -1 | | | {1,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,8700,8800,8900,9000,9100,9200,9300,9400,9500,9600,9700,9800,9900,10000} | 1 | | | + gtt_stats | gtt | b | f | 0 | 5 | 1 | {test} | {1} | | 1 | | | +(2 rows) + +reset search_path; +drop schema gtt_stats cascade; +NOTICE: drop cascades to table gtt_stats.gtt diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 70e1e2f..30cf4bd 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1348,6 +1348,93 @@ pg_group| SELECT pg_authid.rolname AS groname, WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin); +pg_gtt_attached_pids| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relid, + s.pid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_gtt_attached_pid(c.oid) s(relid, pid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_relstats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relpages, + s.reltuples, + s.relallvisible, + s.relfrozenxid, + s.relminmxid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_relstats(c.oid) s(relpages, reltuples, relallvisible, relfrozenxid, relminmxid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_stats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN (s.stakind1 = 1) THEN s.stavalues1 + WHEN (s.stakind2 = 1) THEN s.stavalues2 + WHEN (s.stakind3 = 1) THEN s.stavalues3 + WHEN (s.stakind4 = 1) THEN s.stavalues4 + WHEN (s.stakind5 = 1) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_vals, + CASE + WHEN (s.stakind1 = 1) THEN s.stanumbers1 + WHEN (s.stakind2 = 1) THEN s.stanumbers2 + WHEN (s.stakind3 = 1) THEN s.stanumbers3 + WHEN (s.stakind4 = 1) THEN s.stanumbers4 + WHEN (s.stakind5 = 1) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_freqs, + CASE + WHEN (s.stakind1 = 2) THEN s.stavalues1 + WHEN (s.stakind2 = 2) THEN s.stavalues2 + WHEN (s.stakind3 = 2) THEN s.stavalues3 + WHEN (s.stakind4 = 2) THEN s.stavalues4 + WHEN (s.stakind5 = 2) THEN s.stavalues5 + ELSE NULL::text[] + END AS histogram_bounds, + CASE + WHEN (s.stakind1 = 3) THEN s.stanumbers1[1] + WHEN (s.stakind2 = 3) THEN s.stanumbers2[1] + WHEN (s.stakind3 = 3) THEN s.stanumbers3[1] + WHEN (s.stakind4 = 3) THEN s.stanumbers4[1] + WHEN (s.stakind5 = 3) THEN s.stanumbers5[1] + ELSE NULL::real + END AS correlation, + CASE + WHEN (s.stakind1 = 4) THEN s.stavalues1 + WHEN (s.stakind2 = 4) THEN s.stavalues2 + WHEN (s.stakind3 = 4) THEN s.stavalues3 + WHEN (s.stakind4 = 4) THEN s.stavalues4 + WHEN (s.stakind5 = 4) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_elems, + CASE + WHEN (s.stakind1 = 4) THEN s.stanumbers1 + WHEN (s.stakind2 = 4) THEN s.stanumbers2 + WHEN (s.stakind3 = 4) THEN s.stanumbers3 + WHEN (s.stakind4 = 4) THEN s.stanumbers4 + WHEN (s.stakind5 = 4) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_elem_freqs, + CASE + WHEN (s.stakind1 = 5) THEN s.stanumbers1 + WHEN (s.stakind2 = 5) THEN s.stanumbers2 + WHEN (s.stakind3 = 5) THEN s.stanumbers3 + WHEN (s.stakind4 = 5) THEN s.stanumbers4 + WHEN (s.stakind5 = 5) THEN s.stanumbers5 + ELSE NULL::real[] + END AS elem_count_histogram + FROM ((pg_class c + JOIN pg_attribute a ON ((c.oid = a.attrelid))) + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_statistics(c.oid, (a.attnum)::integer, ''::text) s(starelid, staattnum, stainherit, stanullfrac, stawidth, stadistinct, stakind1, stakind2, stakind3, stakind4, stakind5, staop1, staop2, staop3, staop4, staop5, stacoll1, stacoll2, stacoll3, stacoll4, stacoll5, stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5, stavalues1, stavalues2, stavalues3, stavalues4, stavalues5) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND (NOT a.attisdropped) AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); pg_hba_file_rules| SELECT a.line_number, a.type, a.database, diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index d33a4e1..643afe4 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -121,3 +121,10 @@ test: fast_default # run stats by itself because its delay may be insufficient under heavy load test: stats + +# global temp table test +test: gtt_stats +test: gtt_function +test: gtt_prepare +test: gtt_parallel_1 gtt_parallel_2 +test: gtt_clean diff --git a/src/test/regress/sql/gtt_clean.sql b/src/test/regress/sql/gtt_clean.sql new file mode 100644 index 0000000..f3cf710 --- /dev/null +++ b/src/test/regress/sql/gtt_clean.sql @@ -0,0 +1,6 @@ + + +reset search_path; + +drop schema gtt cascade; + diff --git a/src/test/regress/sql/gtt_function.sql b/src/test/regress/sql/gtt_function.sql new file mode 100644 index 0000000..cfc1879 --- /dev/null +++ b/src/test/regress/sql/gtt_function.sql @@ -0,0 +1,163 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_function; + +set search_path=gtt_function,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt_test_rename(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); + +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; + +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); + +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); + +-- ERROR +cluster gtt1 using gtt1_pkey; + +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; + +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); + +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); + +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; +commit; + +select count(*) from p_table01; + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; + +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; + +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; + +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; + +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); + +--ok +alter table gtt_test_rename rename to gtt_test; + +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); + +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; + +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; +truncate gtt_seq; +select * from gtt_seq order by id; +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; + +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +create index idx_err on gtt1 using gist (a); +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); + +reset search_path; + +drop schema gtt_function cascade; + diff --git a/src/test/regress/sql/gtt_parallel_1.sql b/src/test/regress/sql/gtt_parallel_1.sql new file mode 100644 index 0000000..d7d81de --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_1.sql @@ -0,0 +1,42 @@ + + +set search_path=gtt,sys; + +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +commit; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +rollback; +select * from gtt1 order by a; + +truncate gtt1; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +select * from gtt1 order by a; +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + +begin; +select * from gtt1 order by a; +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +commit; +select * from gtt1 order by a; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_parallel_2.sql b/src/test/regress/sql/gtt_parallel_2.sql new file mode 100644 index 0000000..5203c2b --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_2.sql @@ -0,0 +1,76 @@ + + +set search_path=gtt,sys; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; +commit; +select * from gtt3 order by a; + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +truncate gtt3; +select * from gtt3 order by a; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; +truncate gtt3; +select * from gtt3 order by a; +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +begin; +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_prepare.sql b/src/test/regress/sql/gtt_prepare.sql new file mode 100644 index 0000000..2f4d883 --- /dev/null +++ b/src/test/regress/sql/gtt_prepare.sql @@ -0,0 +1,16 @@ + +CREATE SCHEMA IF NOT EXISTS gtt; + +set search_path=gtt,sys; + +create global temp table gtt1(a int primary key, b text) on commit delete rows; + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text); + +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; + diff --git a/src/test/regress/sql/gtt_stats.sql b/src/test/regress/sql/gtt_stats.sql new file mode 100644 index 0000000..f041892 --- /dev/null +++ b/src/test/regress/sql/gtt_stats.sql @@ -0,0 +1,42 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_stats; + +set search_path=gtt_stats,sys; + +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +insert into gtt values(generate_series(1,10000),'test'); + +-- expect 1 +select count(*) from pg_gtt_attached_pids; + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +-- expect 0 +select * from pg_gtt_stats order by tablename; + +analyze gtt; + +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +select * from pg_gtt_stats order by tablename; + +reset search_path; + +drop schema gtt_stats cascade; + ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-23 16:28 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 0 siblings, 2 replies; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-23 16:28 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Erik Rijkers <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月22日 下午1:29,曾文旌(义从) <[email protected]> 写道: > > > >> 2020年1月21日 下午1:43,Pavel Stehule <[email protected] <mailto:[email protected]>> 写道: >> >> Hi >> >> I have a free time this evening, so I will check this patch >> >> I have a one question >> >> + /* global temp table get relstats from localhash */ >> + if (RELATION_IS_GLOBAL_TEMP(rel)) >> + { >> + get_gtt_relstats(RelationGetRelid(rel), >> + &relpages, &reltuples, &relallvisible, >> + NULL, NULL); >> + } >> + else >> + { >> + /* coerce values in pg_class to more desirable types */ >> + relpages = (BlockNumber) rel->rd_rel->relpages; >> + reltuples = (double) rel->rd_rel->reltuples; >> + relallvisible = (BlockNumber) rel->rd_rel->relallvisible; >> + } >> >> Isbn't possible to fill the rd_rel structure too, so this branching can be reduced? > I'll make some improvements to optimize this part of the code. I'm trying to improve this part of the implementation in global_temporary_table_v7-pg13.patch Please check my patch and give me feedback. Thanks Wenjing > >> >> Regards >> >> Pavel >> >> po 20. 1. 2020 v 17:27 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: >> >> >> > 2020年1月20日 上午1:32,Erik Rijkers <[email protected] <mailto:[email protected]>> 写道: >> > >> > On 2020-01-19 18:04, 曾文旌(义从) wrote: >> >>> 2020年1月14日 下午9:20,Pavel Stehule <[email protected] <mailto:[email protected]>> 写道: >> >>> út 14. 1. 2020 v 14:09 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>> napsal: >> > >> >>> [global_temporary_table_v4-pg13.patch ] >> > >> > Hi, >> > >> > This patch doesn't quiet apply for me: >> > >> > patching file src/backend/access/common/reloptions.c >> > patching file src/backend/access/gist/gistutil.c >> > patching file src/backend/access/hash/hash.c >> > Hunk #1 succeeded at 149 (offset 3 lines). >> > patching file src/backend/access/heap/heapam_handler.c >> > patching file src/backend/access/heap/vacuumlazy.c >> > patching file src/backend/access/nbtree/nbtpage.c >> > patching file src/backend/access/table/tableam.c >> > patching file src/backend/access/transam/xlog.c >> > patching file src/backend/catalog/Makefile >> > Hunk #1 FAILED at 44. >> > 1 out of 1 hunk FAILED -- saving rejects to file src/backend/catalog/Makefile.rej >> > [...] >> > (The rest applies without errors) >> > >> > src/backend/catalog/Makefile.rej contains: >> > >> > ------------------------ >> > --- src/backend/catalog/Makefile >> > +++ src/backend/catalog/Makefile >> > @@ -44,6 +44,8 @@ OBJS = \ >> > storage.o \ >> > toasting.o >> > >> > +OBJS += storage_gtt.o >> > + >> > BKIFILES = postgres.bki postgres.description postgres.shdescription >> > >> > include $(top_srcdir)/src/backend/common.mk <http://common.mk/; >> > ------------------------ >> > >> > Can you have a look? >> I updated the code and remade the patch. >> Please give me feedback if you have any more questions. >> >> >> >> >> > >> > >> > thanks, >> > >> > Erik Rijkers >> > >> > >> > >> > >> > >> > Attachments: [application/octet-stream] global_temporary_table_v7-pg13.patch (146.2K, ../../[email protected]/3-global_temporary_table_v7-pg13.patch) download | inline diff: diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 79430d2..b7173c7 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -158,6 +158,19 @@ static relopt_bool boolRelOpts[] = }, true }, + /* + * For global temp table only + * use AccessExclusiveLock for ensure safety + */ + { + { + "on_commit_delete_rows", + "global temp table on commit options", + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, + ShareUpdateExclusiveLock + }, + true + }, /* list terminator */ {{NULL}} }; @@ -1486,6 +1499,8 @@ bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind) { static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)}, {"fillfactor", RELOPT_TYPE_INT, offsetof(StdRdOptions, fillfactor)}, {"autovacuum_enabled", RELOPT_TYPE_BOOL, offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, enabled)}, @@ -1586,13 +1601,18 @@ build_reloptions(Datum reloptions, bool validate, bytea * partitioned_table_reloptions(Datum reloptions, bool validate) { + static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)} + }; + /* * There are no options for partitioned tables yet, but this is able to do * some validation. */ return (bytea *) build_reloptions(reloptions, validate, RELOPT_KIND_PARTITIONED, - 0, NULL, 0); + sizeof(StdRdOptions), tab, lengthof(tab)); } /* diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index dd975b1..1610e7d 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -1013,7 +1013,9 @@ gistGetFakeLSN(Relation rel) { static XLogRecPtr counter = FirstNormalUnloggedLSN; - if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + /* global temp is same as local temp table */ + if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + rel->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { /* * Temporary relations are only accessible in our session, so a simple diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 4871b7f..16b00c9 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -149,7 +149,9 @@ hashbuild(Relation heap, Relation index, IndexInfo *indexInfo) * metapage, nor the first bitmap page. */ sort_threshold = (maintenance_work_mem * 1024L) / BLCKSZ; - if (index->rd_rel->relpersistence != RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + if (!(index->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + index->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) sort_threshold = Min(sort_threshold, NBuffers); else sort_threshold = Min(sort_threshold, NLocBuffer); diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index 1f6f6d0..5727ccd 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -598,7 +598,7 @@ heapam_relation_set_new_filenode(Relation rel, */ *minmulti = GetOldestMultiXactId(); - srel = RelationCreateStorage(*newrnode, persistence); + srel = RelationCreateStorage(*newrnode, persistence, rel); /* * If required, set up an init fork for an unlogged table so that it can @@ -651,7 +651,7 @@ heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index b331f4c..cd02c6b 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -62,6 +62,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/dbcommands.h" #include "commands/progress.h" #include "commands/vacuum.h" @@ -397,8 +398,10 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, Assert(params->truncate != VACOPT_TERNARY_DEFAULT); /* not every AM requires these to be valid, but heap does */ - Assert(TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); - Assert(MultiXactIdIsValid(onerel->rd_rel->relminmxid)); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relfrozenxid == InvalidTransactionId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && TransactionIdIsNormal(onerel->rd_rel->relfrozenxid))); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relminmxid == InvalidMultiXactId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && MultiXactIdIsValid(onerel->rd_rel->relminmxid))); /* measure elapsed time iff autovacuum logging requires it */ if (IsAutoVacuumWorkerProcess() && params->log_min_duration >= 0) diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index f05cbe7..946c9d2 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -763,7 +763,14 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access) /* Read an existing block of the relation */ buf = ReadBuffer(rel, blkno); LockBuffer(buf, access); - _bt_checkpage(rel, buf); + + /* global temp table may be not yet initialized for this backend. */ + if (RELATION_IS_GLOBAL_TEMP(rel) && + blkno == BTREE_METAPAGE && + PageIsNew(BufferGetPage(buf))) + _bt_initmetapage(BufferGetPage(buf), P_NONE, 0); + else + _bt_checkpage(rel, buf); } else { diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 7f4f784..aba8a9f 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6327,6 +6327,10 @@ StartupXLOG(void) else recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID; + /* clean temp relation files */ + if (max_active_gtt > 0) + RemovePgTempFiles(); + /* * Check for signal files, and if so set up state for offline recovery */ diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index d5da81c..c753b0e 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -42,6 +42,7 @@ OBJS = \ pg_subscription.o \ pg_type.o \ storage.o \ + storage_gtt.o \ toasting.o include $(top_srcdir)/src/backend/common.mk diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c index 16cb6d8..f28f2c2 100644 --- a/src/backend/catalog/catalog.c +++ b/src/backend/catalog/catalog.c @@ -398,7 +398,9 @@ GetNewRelFileNode(Oid reltablespace, Relation pg_class, char relpersistence) switch (relpersistence) { + /* global temp table is same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); break; case RELPERSISTENCE_UNLOGGED: diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 0fdff29..bd3cd9d 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -61,6 +61,7 @@ #include "catalog/pg_type.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "commands/tablecmds.h" #include "commands/typecmds.h" #include "executor/executor.h" @@ -99,6 +100,7 @@ static void AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -404,6 +406,10 @@ heap_create(const char *relname, relpersistence, relkind); + /* global temp table not create storage file when catalog create */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + create_storage = false; + /* * Have the storage manager create the relation's disk file, if needed. * @@ -427,7 +433,7 @@ heap_create(const char *relname, case RELKIND_INDEX: case RELKIND_SEQUENCE: - RelationCreateStorage(rel->rd_node, relpersistence); + RelationCreateStorage(rel->rd_node, relpersistence, rel); break; case RELKIND_RELATION: @@ -956,6 +962,7 @@ AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -994,8 +1001,18 @@ AddNewRelationTuple(Relation pg_class_desc, break; } - new_rel_reltup->relfrozenxid = relfrozenxid; - new_rel_reltup->relminmxid = relminmxid; + /* global temp table not remember transaction info in catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + new_rel_reltup->relfrozenxid = InvalidTransactionId; + new_rel_reltup->relminmxid = InvalidMultiXactId; + } + else + { + new_rel_reltup->relfrozenxid = relfrozenxid; + new_rel_reltup->relminmxid = relminmxid; + } + new_rel_reltup->relowner = relowner; new_rel_reltup->reltype = new_type_oid; new_rel_reltup->reloftype = reloftype; @@ -1357,6 +1374,7 @@ heap_create_with_catalog(const char *relname, reloftypeid, ownerid, relkind, + relpersistence, relfrozenxid, relminmxid, PointerGetDatum(relacl), @@ -1441,11 +1459,15 @@ heap_create_with_catalog(const char *relname, */ StoreConstraints(new_rel_desc, cooked_constraints, is_internal); - /* - * If there's a special on-commit action, remember it - */ - if (oncommit != ONCOMMIT_NOOP) - register_on_commit_action(relid, oncommit); + /* global temp table register action when storage init */ + if (relpersistence != RELPERSISTENCE_GLOBAL_TEMP) + { + /* + * If there's a special on-commit action, remember it + */ + if (oncommit != ONCOMMIT_NOOP) + register_on_commit_action(relid, oncommit); + } /* * ok, the relation has been cataloged, so close our relations and return @@ -1937,6 +1959,13 @@ heap_drop_with_catalog(Oid relid) if (relid == defaultPartOid) update_default_partition_oid(parentOid, InvalidOid); + /* We allow to drop global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not drop relation when other backend attached this global temp table"); + } + /* * Schedule unlinking of the relation's physical files at commit. */ @@ -3165,7 +3194,7 @@ RemoveStatistics(Oid relid, AttrNumber attnum) * the specified relation. Caller must hold exclusive lock on rel. */ static void -RelationTruncateIndexes(Relation heapRelation) +RelationTruncateIndexes(Relation heapRelation, LOCKMODE lockmode) { ListCell *indlist; @@ -3177,7 +3206,7 @@ RelationTruncateIndexes(Relation heapRelation) IndexInfo *indexInfo; /* Open the index relation; use exclusive lock, just to be sure */ - currentIndex = index_open(indexId, AccessExclusiveLock); + currentIndex = index_open(indexId, lockmode); /* * Fetch info needed for index_build. Since we know there are no @@ -3223,8 +3252,13 @@ heap_truncate(List *relids) { Oid rid = lfirst_oid(cell); Relation rel; + LOCKMODE lockmode = AccessExclusiveLock; + + /* truncate global temp table only need RowExclusiveLock */ + if (get_rel_persistence(rid) == RELPERSISTENCE_GLOBAL_TEMP) + lockmode = RowExclusiveLock; - rel = table_open(rid, AccessExclusiveLock); + rel = table_open(rid, lockmode); relations = lappend(relations, rel); } @@ -3257,6 +3291,8 @@ void heap_truncate_one_rel(Relation rel) { Oid toastrelid; + LOCKMODE lockmode = AccessExclusiveLock; + bool truncate_toastrel = false; /* * Truncate the relation. Partitioned tables have no storage, so there is @@ -3265,23 +3301,40 @@ heap_truncate_one_rel(Relation rel) if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) return; + toastrelid = rel->rd_rel->reltoastrelid; + + /* + * Truncate global temp table only need RowExclusiveLock + */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + lockmode = RowExclusiveLock; + if (OidIsValid(toastrelid) && + gtt_storage_attached(toastrelid)) + truncate_toastrel = true; + } + else if (OidIsValid(toastrelid)) + truncate_toastrel = true; + /* Truncate the underlying relation */ table_relation_nontransactional_truncate(rel); /* If the relation has indexes, truncate the indexes too */ - RelationTruncateIndexes(rel); + RelationTruncateIndexes(rel, lockmode); /* If there is a toast table, truncate that too */ - toastrelid = rel->rd_rel->reltoastrelid; - if (OidIsValid(toastrelid)) + if (truncate_toastrel) { - Relation toastrel = table_open(toastrelid, AccessExclusiveLock); + Relation toastrel = table_open(toastrelid, lockmode); table_relation_nontransactional_truncate(toastrel); - RelationTruncateIndexes(toastrel); + RelationTruncateIndexes(toastrel, lockmode); /* keep the lock... */ table_close(toastrel, NoLock); } + + if (RELATION_IS_GLOBAL_TEMP(rel)) + up_gtt_relstats(rel, 0, 0, 0, RecentXmin, InvalidMultiXactId); } /* diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 3e59e64..9705b1d 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -52,6 +52,7 @@ #include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/event_trigger.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -877,6 +878,26 @@ index_create(Relation heapRelation, indexRelationName, RelationGetRelationName(heapRelation)))); } + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + if (accessMethodObjectId != BTREE_AM_OID) + elog(ERROR, "only support btree index on global temp table"); + + /* We allow to create index on global temp table only this session use it */ + if (is_other_backend_use_gtt(heapRelation->rd_node)) + elog(ERROR, "can not create index when have other backend attached this global temp table"); + + /* No support create index on global temp table use concurrent mode yet */ + if (concurrent) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot create indexes on global temporary tables using concurrent mode"))); + + /* if global temp table not init storage, then skip build index */ + if (!gtt_storage_attached(heapRelation->rd_node.relNode)) + flags |= INDEX_CREATE_SKIP_BUILD; + } + /* * construct tuple descriptor for index tuples */ @@ -2045,6 +2066,13 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) */ CheckTableNotInUse(userIndexRelation, "DROP INDEX"); + /* We allow to drop index on global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(userHeapRelation)) + { + if (is_other_backend_use_gtt(userHeapRelation->rd_node)) + elog(ERROR, "can not drop index when other backend attached this global temp table."); + } + /* * Drop Index Concurrently is more or less the reverse process of Create * Index Concurrently. @@ -2651,6 +2679,11 @@ index_update_stats(Relation rel, HeapTuple tuple; Form_pg_class rd_rel; bool dirty; + bool is_gtt = false; + + /* update index stats into localhash and rel_rd_rel for global temp table */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + is_gtt = true; /* * We always update the pg_class row using a non-transactional, @@ -2736,21 +2769,35 @@ index_update_stats(Relation rel, else /* don't bother for indexes */ relallvisible = 0; - if (rd_rel->relpages != (int32) relpages) + if (is_gtt) + rel->rd_rel->relpages = (int32) relpages; + else if (rd_rel->relpages != (int32) relpages) { rd_rel->relpages = (int32) relpages; dirty = true; } - if (rd_rel->reltuples != (float4) reltuples) + + if (is_gtt) + rel->rd_rel->reltuples = (float4) reltuples; + else if (rd_rel->reltuples != (float4) reltuples) { rd_rel->reltuples = (float4) reltuples; dirty = true; } - if (rd_rel->relallvisible != (int32) relallvisible) + + if (is_gtt) + rel->rd_rel->relallvisible = (int32) relallvisible; + else if (rd_rel->relallvisible != (int32) relallvisible) { rd_rel->relallvisible = (int32) relallvisible; dirty = true; } + + if (is_gtt) + { + up_gtt_relstats(rel, relpages, reltuples, relallvisible, + InvalidTransactionId, InvalidMultiXactId); + } } /* @@ -2864,6 +2911,12 @@ index_build(Relation heapRelation, pgstat_progress_update_multi_param(6, index, val); } + if (RELATION_IS_GLOBAL_TEMP(indexRelation)) + { + if (!gtt_storage_attached(indexRelation->rd_node.relNode)) + RelationCreateStorage(indexRelation->rd_node, RELPERSISTENCE_GLOBAL_TEMP, indexRelation); + } + /* * Call the access method's build procedure */ @@ -3459,6 +3512,15 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence, errmsg("cannot reindex temporary tables of other sessions"))); /* + * Because global temp table cannot change relfilenode + * no support reindex on global temp table yet. + */ + if (RELATION_IS_GLOBAL_TEMP(iRel)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot reindex global temporary tables"))); + + /* * Also check for active uses of the index in the current transaction; we * don't want to reindex underneath an open indexscan. */ diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index e70243a..301da79 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -647,6 +647,13 @@ RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid) errmsg("cannot create temporary relation in non-temporary schema"))); } break; + /* global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + if (isAnyTempNamespace(nspid)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("cannot create global temp relations in temporary schemas"))); + break; case RELPERSISTENCE_PERMANENT: if (isTempOrTempToastNamespace(nspid)) newRelation->relpersistence = RELPERSISTENCE_TEMP; diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index fddfbf1..671c614 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -26,6 +26,7 @@ #include "access/xlogutils.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "storage/freespace.h" #include "storage/smgr.h" @@ -75,7 +76,7 @@ static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */ * transaction aborts later on, the storage will be destroyed. */ SMgrRelation -RelationCreateStorage(RelFileNode rnode, char relpersistence) +RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel) { PendingRelDelete *pending; SMgrRelation srel; @@ -85,6 +86,8 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) switch (relpersistence) { case RELPERSISTENCE_TEMP: + /* global temp table use same storage strategy as local temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); needs_wal = false; break; @@ -117,6 +120,10 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) pending->next = pendingDeletes; pendingDeletes = pending; + /* remember global temp table storage info to localhash */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && rel) + remember_gtt_storage_info(rnode, rel); + return srel; } @@ -486,8 +493,15 @@ smgrDoPendingDeletes(bool isCommit) smgrdounlinkall(srels, nrels, false); for (i = 0; i < nrels; i++) + { smgrclose(srels[i]); + /* clean global temp table flags when transaction commit or rollback */ + if (SmgrIsTemp(srels[i]) && + gtt_storage_attached(srels[i]->smgr_rnode.node.relNode)) + forget_gtt_storage_info(srels[i]->smgr_rnode.node.relNode); + } + pfree(srels); } } diff --git a/src/backend/catalog/storage_gtt.c b/src/backend/catalog/storage_gtt.c new file mode 100644 index 0000000..f489cd3 --- /dev/null +++ b/src/backend/catalog/storage_gtt.c @@ -0,0 +1,1129 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.c + * code to create and destroy physical storage for global temparary table + * + * IDENTIFICATION + * src/backend/catalog/storage_gtt.c + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "access/table.h" +#include "access/visibilitymap.h" +#include "access/xact.h" +#include "access/xlog.h" +#include "access/xloginsert.h" +#include "access/xlogutils.h" +#include "access/htup_details.h" +#include "access/multixact.h" +#include "catalog/storage.h" +#include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" +#include "catalog/heap.h" +#include "catalog/namespace.h" +#include "catalog/pg_type.h" +#include "catalog/pg_statistic.h" +#include "commands/tablecmds.h" +#include "funcapi.h" +#include "nodes/primnodes.h" +#include "nodes/pg_list.h" +#include "nodes/execnodes.h" +#include "miscadmin.h" +#include "storage/freespace.h" +#include "storage/smgr.h" +#include "storage/ipc.h" +#include "storage/proc.h" +#include "storage/procarray.h" +#include "storage/lwlock.h" +#include "storage/shmem.h" +#include "storage/sinvaladt.h" +#include "utils/memutils.h" +#include "utils/rel.h" +#include "utils/hsearch.h" +#include "utils/catcache.h" +#include "utils/lsyscache.h" +#include <utils/relcache.h> +#include "utils/inval.h" +#include "utils/guc.h" + + +/* Copy from bitmapset.c, because gtt used the function in bitmapset.c */ +#define WORDNUM(x) ((x) / BITS_PER_BITMAPWORD) +#define BITNUM(x) ((x) % BITS_PER_BITMAPWORD) + +#define BITMAPSET_SIZE(nwords) \ + (offsetof(Bitmapset, words) + (nwords) * sizeof(bitmapword)) + +static bool gtt_cleaner_exit_registered = false; +static HTAB *gtt_storage_local_hash = NULL; +static HTAB *active_gtt_shared_hash = NULL; +static MemoryContext gtt_relstats_context = NULL; + +/* relfrozenxid of all gtts in the current session */ +static List *gtt_session_relfrozenxid_list = NIL; +static TransactionId gtt_session_frozenxid = InvalidTransactionId; + +typedef struct gtt_ctl_data +{ + LWLock lock; + int max_entry; + int entry_size; +}gtt_ctl_data; + +static gtt_ctl_data *gtt_shared_ctl = NULL; + +typedef struct +{ + RelFileNode rnode; + Bitmapset *map; + /* bitmap data */ +} gtt_shared_hash_entry; + +typedef struct +{ + Oid relid; + + Oid spcnode; + /* pg_class stat */ + int32 relpages; + float4 reltuples; + int32 relallvisible; + TransactionId relfrozenxid; + TransactionId relminmxid; + char relkind; + bool on_commit_delete; + + /* pg_statistic */ + int natts; + int *attnum; + HeapTuple *att_stat_tups; +} gtt_local_hash_entry; + +static Size action_gtt_shared_hash_entry_size(void); +static void gtt_storage_checkin(RelFileNode rnode); +static void gtt_storage_checkout(RelFileNode rnode, bool skiplock); +static void gtt_storage_removeall(int code, Datum arg); +static void insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid); +static void remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid); +static void set_gtt_session_relfrozenxid(void); + +Datum pg_get_gtt_statistics(PG_FUNCTION_ARGS); +Datum pg_get_gtt_relstats(PG_FUNCTION_ARGS); +Datum pg_gtt_attached_pid(PG_FUNCTION_ARGS); +Datum pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS); + + +static Size +action_gtt_shared_hash_entry_size(void) +{ + int wordnum; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + wordnum = WORDNUM(MaxBackends + 1); + hash_entry_size += MAXALIGN(sizeof(gtt_shared_hash_entry)); + hash_entry_size += MAXALIGN(BITMAPSET_SIZE(wordnum + 1)); + + return hash_entry_size; +} + +Size +active_gtt_shared_hash_size(void) +{ + Size size = 0; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + size = MAXALIGN(sizeof(gtt_ctl_data)); + hash_entry_size = action_gtt_shared_hash_entry_size(); + size += hash_estimate_size(max_active_gtt, hash_entry_size); + + return size; +} + +void +active_gtt_shared_hash_init(void) +{ + HASHCTL info; + bool found; + + if (max_active_gtt <= 0) + return; + + gtt_shared_ctl = + ShmemInitStruct("gtt_shared_ctl", + sizeof(gtt_ctl_data), + &found); + + if (!found) + { + LWLockRegisterTranche(LWTRANCHE_GTT_CTL, "gtt_shared_ctl"); + LWLockInitialize(>t_shared_ctl->lock, LWTRANCHE_GTT_CTL); + gtt_shared_ctl->max_entry = max_active_gtt; + gtt_shared_ctl->entry_size = action_gtt_shared_hash_entry_size(); + } + + info.keysize = sizeof(RelFileNode); + info.entrysize = gtt_shared_ctl->entry_size; + active_gtt_shared_hash = + ShmemInitHash("active gtt shared hash", + gtt_shared_ctl->max_entry, + gtt_shared_ctl->max_entry, + &info, HASH_ELEM | HASH_BLOBS | HASH_FIXED_SIZE); +} + +static void +gtt_storage_checkin(RelFileNode rnode) +{ + gtt_shared_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + entry = (gtt_shared_hash_entry *) hash_search(active_gtt_shared_hash, + &rnode, HASH_ENTER_NULL, &found); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of shared memory"), + errhint("You might need to increase max_active_gtt."))); + } + + if (found == false) + { + int wordnum; + + entry->map = (Bitmapset *)((char *)entry + MAXALIGN(sizeof(gtt_shared_hash_entry))); + wordnum = WORDNUM(MaxBackends + 1); + memset(entry->map, 0, BITMAPSET_SIZE(wordnum + 1)); + entry->map->nwords = wordnum + 1; + } + + bms_add_member(entry->map, MyBackendId); + LWLockRelease(>t_shared_ctl->lock); +} + +static void +gtt_storage_checkout(RelFileNode rnode, bool skiplock) +{ + gtt_shared_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (!skiplock) + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + + entry = hash_search(active_gtt_shared_hash, + (void *) &(rnode), HASH_FIND, NULL); + + if (entry == NULL) + { + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + elog(WARNING, "relfilenode %u/%u/%u not exist in gtt shared hash when forget", + rnode.dbNode, rnode.spcNode, rnode.relNode); + return; + } + + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + bms_del_member(entry->map, MyBackendId); + + if (bms_is_empty(entry->map)) + { + if (!hash_search(active_gtt_shared_hash, &rnode, HASH_REMOVE, NULL)) + elog(PANIC, "gtt shared hash table corrupted"); + } + + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + return; +} + +Bitmapset * +copy_active_gtt_bitmap(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + Bitmapset *map_copy = NULL; + + if (max_active_gtt <= 0) + return NULL; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return NULL; + } + + Assert(entry->map); + if (!bms_is_empty(entry->map)) + map_copy = bms_copy(entry->map); + + LWLockRelease(>t_shared_ctl->lock); + + return map_copy; +} + +bool +is_other_backend_use_gtt(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + bool in_use = false; + int num_use = 0; + + if (max_active_gtt <= 0) + return false; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return false; + } + + Assert(entry->map); + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + + num_use = bms_num_members(entry->map); + if (num_use == 0) + in_use = false; + else if (num_use == 1) + { + if(bms_is_member(MyBackendId, entry->map)) + in_use = false; + else + in_use = true; + } + else + in_use = true; + + LWLockRelease(>t_shared_ctl->lock); + + return in_use; +} + +void +remember_gtt_storage_info(RelFileNode rnode, Relation rel) +{ + gtt_local_hash_entry *entry; + MemoryContext oldcontext; + Oid relid = rnode.relNode; + bool found; + + if (max_active_gtt <= 0) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Global temporary table feature is disable"), + errhint("You might need to increase max_active_gtt to enable this feature."))); + + if (RecoveryInProgress()) + elog(ERROR, "readonly mode not support access global temp table yet"); + + if (gtt_storage_local_hash == NULL) + { +#define GTT_LOCAL_HASH_SIZE 1024 + /* First time through: initialize the hash table */ + HASHCTL ctl; + + MemSet(&ctl, 0, sizeof(ctl)); + ctl.keysize = sizeof(Oid); + ctl.entrysize = sizeof(gtt_local_hash_entry); + gtt_storage_local_hash = + hash_create("global temp relation table", + GTT_LOCAL_HASH_SIZE, + &ctl, HASH_ELEM | HASH_BLOBS); + + if (!CacheMemoryContext) + CreateCacheMemoryContext(); + + gtt_relstats_context = + AllocSetContextCreate(CacheMemoryContext, + "gtt relstats context", + ALLOCSET_DEFAULT_SIZES); + } + + /* Look up or create an entry */ + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_ENTER, &found); + + if (found) + { + elog(ERROR, "backend %d relid %u already exists in global temp table local hash", + MyBackendId, relid); + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + + entry->spcnode = rnode.spcNode; + entry->relpages = 0; + entry->reltuples = 0; + entry->relallvisible = 0; + entry->relkind = rel->rd_rel->relkind; + /* only heap contain transaction information */ + if (entry->relkind == RELKIND_RELATION || entry->relkind == RELKIND_PARTITIONED_TABLE) + { + int natts = RelationGetNumberOfAttributes(rel); + entry->natts = natts; + entry->attnum = palloc0(sizeof(int) * natts); + entry->att_stat_tups = palloc0(sizeof(HeapTuple) * natts); + + if (RELATION_GTT_ON_COMMIT_DELETE(rel)) + { + entry->on_commit_delete = true; + register_on_commit_action(rel->rd_node.relNode, ONCOMMIT_DELETE_ROWS); + } + + entry->relfrozenxid = RecentXmin; + entry->relminmxid = GetOldestMultiXactId(); + insert_gtt_relfrozenxid_to_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + gtt_storage_checkin(rnode); + } + else + { + entry->natts = 0; + entry->attnum = 0; + entry->att_stat_tups = NULL; + entry->on_commit_delete = false; + entry->relfrozenxid = 0; + entry->relminmxid = 0; + } + + MemoryContextSwitchTo(oldcontext); + + if (!gtt_cleaner_exit_registered) + { + before_shmem_exit(gtt_storage_removeall, 0); + gtt_cleaner_exit_registered = true; + } + + return; +} + +void +forget_gtt_storage_info(Oid relid) +{ + gtt_local_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, NULL); + + if (entry && entry->relkind == RELKIND_RELATION) + { + RelFileNode rnode; + int i; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + gtt_storage_checkout(rnode, false); + + Assert(TransactionIdIsNormal(entry->relfrozenxid)); + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + + for (i = 0; i < entry->natts; i++) + { + if (entry->att_stat_tups[i]) + { + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + } + } + } + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_REMOVE, NULL); + + return; +} + +/* is the storage file was created in this backend */ +bool +gtt_storage_attached(Oid relid) +{ + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, &found); + + return found; +} + +static void +gtt_storage_removeall(int code, Datum arg) +{ + HASH_SEQ_STATUS status; + gtt_local_hash_entry *entry; + int nrels = 0, + maxrels = 0; + SMgrRelation *srels = NULL; + RelFileNode *rnodes = NULL; + char *relkinds = NULL; + + if (gtt_storage_local_hash == NULL) + return; + + hash_seq_init(&status, gtt_storage_local_hash); + while ((entry = (gtt_local_hash_entry *) hash_seq_search(&status)) != NULL) + { + SMgrRelation srel; + RelFileNode rnode; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + srel = smgropen(rnode, MyBackendId); + + /* allocate the initial array, or extend it, if needed */ + if (maxrels == 0) + { + maxrels = 32; + srels = palloc(sizeof(SMgrRelation) * maxrels); + rnodes = palloc(sizeof(RelFileNode) * maxrels); + relkinds = palloc(sizeof(char) * maxrels); + } + else if (maxrels <= nrels) + { + maxrels *= 2; + srels = repalloc(srels, sizeof(SMgrRelation) * maxrels); + rnodes = repalloc(rnodes, sizeof(RelFileNode) * maxrels); + relkinds = repalloc(relkinds, sizeof(char) * maxrels); + } + + srels[nrels] = srel; + rnodes[nrels] = rnode; + relkinds[nrels] = entry->relkind; + nrels++; + } + + if (nrels > 0) + { + int i; + + smgrdounlinkall(srels, nrels, false); + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + for (i = 0; i < nrels; i++) + { + smgrclose(srels[i]); + if (relkinds[i] == RELKIND_RELATION) + gtt_storage_checkout(rnodes[i], true); + } + LWLockRelease(>t_shared_ctl->lock); + + pfree(srels); + pfree(rnodes); + pfree(relkinds); + } + + MyProc->session_gtt_frozenxid = InvalidTransactionId; + + return; +} + +/* + * Update global temp table relstats(relpage/reltuple/relallvisible) + * to local hashtable + */ +void +up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid) +{ + Oid relid = RelationGetRelid(relation); + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return; + + Assert(entry->spcnode); + + if (num_pages >= 0 && + entry->relpages != (int32)num_pages) + entry->relpages = (int32)num_pages; + + if (num_tuples >= 0 && + num_tuples != (float4)entry->reltuples) + entry->reltuples = (float4)num_tuples; + + /* only heap contain transaction information and relallvisible */ + if (entry->relkind == RELKIND_RELATION) + { + if (entry->relallvisible >= 0 && + entry->relallvisible != (int32)num_all_visible_pages) + { + entry->relallvisible = (int32)num_all_visible_pages; + } + + if (TransactionIdIsNormal(relfrozenxid) && + entry->relfrozenxid != relfrozenxid && + (TransactionIdPrecedes(entry->relfrozenxid, relfrozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), entry->relfrozenxid))) + { + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + entry->relfrozenxid = relfrozenxid; + insert_gtt_relfrozenxid_to_ordered_list(relfrozenxid); + set_gtt_session_relfrozenxid(); + } + + if (MultiXactIdIsValid(relminmxid) && + entry->relminmxid != relminmxid && + (MultiXactIdPrecedes(entry->relminmxid, relminmxid) || + MultiXactIdPrecedes(ReadNextMultiXactId(), entry->relminmxid))) + { + entry->relminmxid = relminmxid; + } + } + + return; +} + +/* + * Search global temp table relstats(relpage/reltuple/relallvisible) + * from local hashtable. + */ +bool +get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid) +{ + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return false; + + Assert(entry->relid == relid); + + if (relpages) + *relpages = entry->relpages; + + if (reltuples) + *reltuples = entry->reltuples; + + if (relallvisible) + *relallvisible = entry->relallvisible; + + if (relfrozenxid) + *relfrozenxid = entry->relfrozenxid; + + if (relminmxid) + *relminmxid = entry->relminmxid; + + return true; +} + +/* + * Update global temp table statistic info(definition is same as pg_statistic) + * to local hashtable where ananyze global temp table + */ +void +up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull) +{ + gtt_local_hash_entry *entry; + bool found; + MemoryContext oldcontext; + int i = 0; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return; + + if (entry->relkind != RELKIND_RELATION) + { + elog(WARNING, "oid %u not a relation", reloid); + return; + } + + /* todo */ + if (entry->natts < natts) + { + elog(WARNING, "reloid %u not support update attstat after add colunm", reloid); + return; + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + Assert(entry->relid == reloid); + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == 0) + { + entry->attnum[i] = attnum; + break; + } + else if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + break; + } + } + + Assert(i < entry->natts); + Assert(entry->att_stat_tups[i] == NULL); + entry->att_stat_tups[i] = heap_form_tuple(tupleDescriptor, values, isnull); + MemoryContextSwitchTo(oldcontext); + + return; +} + +/* + * Search global temp table statistic info(definition is same as pg_statistic) + * from local hashtable. + */ +HeapTuple +get_gtt_att_statistic(Oid reloid, int attnum, bool inh) +{ + gtt_local_hash_entry *entry; + bool found; + int i = 0; + + if (max_active_gtt <= 0) + return NULL; + + if (gtt_storage_local_hash == NULL) + return NULL; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return NULL; + + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + return entry->att_stat_tups[i]; + } + } + + return NULL; +} + +void +release_gtt_statistic_cache(HeapTuple tup) +{ + /* do nothing */ + return; +} + +static void +insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid) +{ + MemoryContext oldcontext; + ListCell *cell; + int i; + + Assert(TransactionIdIsNormal(relfrozenxid)); + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + /* Does the datum belong at the front? */ + if (gtt_session_relfrozenxid_list == NIL || + TransactionIdFollowsOrEquals(relfrozenxid, + linitial_oid(gtt_session_relfrozenxid_list))) + { + gtt_session_relfrozenxid_list = + lcons_oid(relfrozenxid, gtt_session_relfrozenxid_list); + MemoryContextSwitchTo(oldcontext); + + return; + } + + /* No, so find the entry it belongs after */ + i = 0; + foreach (cell, gtt_session_relfrozenxid_list) + { + if (TransactionIdFollowsOrEquals(relfrozenxid, lfirst_oid(cell))) + break; + + i++; + } + gtt_session_relfrozenxid_list = + list_insert_nth_oid(gtt_session_relfrozenxid_list, i, relfrozenxid); + MemoryContextSwitchTo(oldcontext); + + return; +} + +static void +remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid) +{ + gtt_session_relfrozenxid_list = + list_delete_oid(gtt_session_relfrozenxid_list, relfrozenxid); +} + +static void +set_gtt_session_relfrozenxid(void) +{ + TransactionId gtt_frozenxid = InvalidTransactionId; + + if (gtt_session_relfrozenxid_list) + gtt_frozenxid = llast_oid(gtt_session_relfrozenxid_list); + + gtt_session_frozenxid = gtt_frozenxid; + if (MyProc->session_gtt_frozenxid != gtt_frozenxid) + MyProc->session_gtt_frozenxid = gtt_frozenxid; +} + +Datum +pg_get_gtt_statistics(PG_FUNCTION_ARGS) +{ + HeapTuple tuple; + Relation rel = NULL; + int attnum = PG_GETARG_INT32(1); + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + MemoryContext oldcontext; + Tuplestorestate *tupstore; + Relation pg_tatistic = NULL; + TupleDesc sd; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not " \ + "allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + pg_tatistic = table_open(StatisticRelationId, AccessShareLock); + sd = RelationGetDescr(pg_tatistic); + + tuple = get_gtt_att_statistic(reloid, attnum, false); + if (tuple) + { + Datum values[31]; + bool isnull[31]; + HeapTuple res = NULL; + + memset(&values, 0, sizeof(values)); + memset(&isnull, 0, sizeof(isnull)); + heap_deform_tuple(tuple, sd, values, isnull); + res = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, res); + } + + table_close(rel, NoLock); + table_close(pg_tatistic, AccessShareLock); + tuplestore_donestoring(tupstore); + + return (Datum) 0; +} + +Datum +pg_get_gtt_relstats(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + uint32 relfrozenxid = 0; + uint32 relminmxid = 0; + Relation rel = NULL; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + if (get_gtt_relstats(reloid, + &relpages, &reltuples, &relallvisible, + &relfrozenxid, &relminmxid)) + { + Datum values[5]; + bool isnull[5]; + + memset(isnull, 0, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(relpages); + values[1] = Float4GetDatum((float4)reltuples); + values[2] = Int32GetDatum(relallvisible); + values[3] = UInt32GetDatum(relfrozenxid); + values[4] = UInt32GetDatum(relminmxid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_gtt_attached_pid(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + Relation rel = NULL; + PGPROC *proc = NULL; + Bitmapset *map = NULL; + pid_t pid = 0; + int backendid = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + map = copy_active_gtt_bitmap(rel->rd_node); + if (map) + { + backendid = bms_first_member(map); + + do + { + proc = BackendIdGetProc(backendid); + pid = proc->pid; + if (pid > 0) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = UInt32GetDatum(reloid); + values[1] = Int32GetDatum(pid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + backendid = bms_next_member(map, backendid); + } while (backendid > 0); + + pfree(map); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + int num_xid = MaxBackends + 1; + int *pids = NULL; + uint32 *xids = NULL; + int i = 0; + int j = 0; + uint32 oldest = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + if (max_active_gtt <= 0) + return (Datum) 0; + + if (RecoveryInProgress()) + return (Datum) 0; + + pids = palloc0(sizeof(int) * num_xid); + xids = palloc0(sizeof(int) * num_xid); + oldest = list_all_session_gtt_frozenxids(num_xid, pids, xids, &i); + if (i > 0) + { + if (i > 0) + { + pids[i] = 0; + xids[i] = oldest; + i++; + } + + for(j = 0; j < i; j++) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(pids[j]); + values[1] = UInt32GetDatum(xids[j]); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + } + tuplestore_donestoring(tupstore); + pfree(pids); + pfree(xids); + + return (Datum) 0; +} + diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index c9e75f4..2adde62 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -186,6 +186,91 @@ CREATE OR REPLACE VIEW pg_sequences AS WHERE NOT pg_is_other_temp_schema(N.oid) AND relkind = 'S'; +-- For global temporary table +CREATE VIEW pg_gtt_relstats WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_relstats(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_attached_pids WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_gtt_attached_pid(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_stats WITH (security_barrier) AS +SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN s.stakind1 = 1 THEN s.stavalues1 + WHEN s.stakind2 = 1 THEN s.stavalues2 + WHEN s.stakind3 = 1 THEN s.stavalues3 + WHEN s.stakind4 = 1 THEN s.stavalues4 + WHEN s.stakind5 = 1 THEN s.stavalues5 + END AS most_common_vals, + CASE + WHEN s.stakind1 = 1 THEN s.stanumbers1 + WHEN s.stakind2 = 1 THEN s.stanumbers2 + WHEN s.stakind3 = 1 THEN s.stanumbers3 + WHEN s.stakind4 = 1 THEN s.stanumbers4 + WHEN s.stakind5 = 1 THEN s.stanumbers5 + END AS most_common_freqs, + CASE + WHEN s.stakind1 = 2 THEN s.stavalues1 + WHEN s.stakind2 = 2 THEN s.stavalues2 + WHEN s.stakind3 = 2 THEN s.stavalues3 + WHEN s.stakind4 = 2 THEN s.stavalues4 + WHEN s.stakind5 = 2 THEN s.stavalues5 + END AS histogram_bounds, + CASE + WHEN s.stakind1 = 3 THEN s.stanumbers1[1] + WHEN s.stakind2 = 3 THEN s.stanumbers2[1] + WHEN s.stakind3 = 3 THEN s.stanumbers3[1] + WHEN s.stakind4 = 3 THEN s.stanumbers4[1] + WHEN s.stakind5 = 3 THEN s.stanumbers5[1] + END AS correlation, + CASE + WHEN s.stakind1 = 4 THEN s.stavalues1 + WHEN s.stakind2 = 4 THEN s.stavalues2 + WHEN s.stakind3 = 4 THEN s.stavalues3 + WHEN s.stakind4 = 4 THEN s.stavalues4 + WHEN s.stakind5 = 4 THEN s.stavalues5 + END AS most_common_elems, + CASE + WHEN s.stakind1 = 4 THEN s.stanumbers1 + WHEN s.stakind2 = 4 THEN s.stanumbers2 + WHEN s.stakind3 = 4 THEN s.stanumbers3 + WHEN s.stakind4 = 4 THEN s.stanumbers4 + WHEN s.stakind5 = 4 THEN s.stanumbers5 + END AS most_common_elem_freqs, + CASE + WHEN s.stakind1 = 5 THEN s.stanumbers1 + WHEN s.stakind2 = 5 THEN s.stanumbers2 + WHEN s.stakind3 = 5 THEN s.stanumbers3 + WHEN s.stakind4 = 5 THEN s.stanumbers4 + WHEN s.stakind5 = 5 THEN s.stanumbers5 + END AS elem_count_histogram + FROM + pg_class c + JOIN pg_attribute a ON c.oid = a.attrelid + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_statistics(c.oid, a.attnum, ''::text) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') and NOT a.attisdropped AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + CREATE VIEW pg_stats WITH (security_barrier) AS SELECT nspname AS schemaname, diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index c4420dd..977a984 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -34,6 +34,7 @@ #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "commands/dbcommands.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -103,7 +104,7 @@ static int acquire_inherited_sample_rows(Relation onerel, int elevel, HeapTuple *rows, int targrows, double *totalrows, double *totaldeadrows); static void update_attstats(Oid relid, bool inh, - int natts, VacAttrStats **vacattrstats); + int natts, VacAttrStats **vacattrstats, char relpersistence); static Datum std_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); @@ -586,14 +587,15 @@ do_analyze_rel(Relation onerel, VacuumParams *params, * pg_statistic for columns we didn't process, we leave them alone.) */ update_attstats(RelationGetRelid(onerel), inh, - attr_cnt, vacattrstats); + attr_cnt, vacattrstats, RelationGetRelPersistence(onerel)); for (ind = 0; ind < nindexes; ind++) { AnlIndexData *thisdata = &indexdata[ind]; update_attstats(RelationGetRelid(Irel[ind]), false, - thisdata->attr_cnt, thisdata->vacattrstats); + thisdata->attr_cnt, thisdata->vacattrstats, + RelationGetRelPersistence(Irel[ind])); } /* @@ -1456,7 +1458,7 @@ acquire_inherited_sample_rows(Relation onerel, int elevel, * by taking a self-exclusive lock on the relation in analyze_rel(). */ static void -update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) +update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats, char relpersistence) { Relation sd; int attno; @@ -1558,31 +1560,45 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) } } - /* Is there already a pg_statistic tuple for this attribute? */ - oldtup = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(relid), - Int16GetDatum(stats->attr->attnum), - BoolGetDatum(inh)); - - if (HeapTupleIsValid(oldtup)) + /* Update column statistic to localhash, not catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { - /* Yes, replace it */ - stup = heap_modify_tuple(oldtup, - RelationGetDescr(sd), - values, - nulls, - replaces); - ReleaseSysCache(oldtup); - CatalogTupleUpdate(sd, &stup->t_self, stup); + up_gtt_att_statistic(relid, + stats->attr->attnum, + inh, + natts, + RelationGetDescr(sd), + values, + nulls); } else { - /* No, insert new tuple */ - stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); - CatalogTupleInsert(sd, stup); - } + /* Is there already a pg_statistic tuple for this attribute? */ + oldtup = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(relid), + Int16GetDatum(stats->attr->attnum), + BoolGetDatum(inh)); - heap_freetuple(stup); + if (HeapTupleIsValid(oldtup)) + { + /* Yes, replace it */ + stup = heap_modify_tuple(oldtup, + RelationGetDescr(sd), + values, + nulls, + replaces); + ReleaseSysCache(oldtup); + CatalogTupleUpdate(sd, &stup->t_self, stup); + } + else + { + /* No, insert new tuple */ + stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); + CatalogTupleInsert(sd, stup); + } + + heap_freetuple(stup); + } } table_close(sd, RowExclusiveLock); diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index e9d7a7f..3088e26 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -391,6 +391,12 @@ cluster_rel(Oid tableOid, Oid indexOid, int options) errmsg("cannot vacuum temporary tables of other sessions"))); } + /* not support cluster global temp table yet */ + if (RELATION_IS_GLOBAL_TEMP(OldHeap)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("not support cluster global temporary tables yet"))); + /* * Also check for active uses of the relation in the current transaction, * including open scans and pending AFTER trigger events. diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 52ce02f..3d3f7dc 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2583,6 +2583,16 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind, !isTempNamespace(classtuple->relnamespace)) continue; + /* not support reindex on global temp table, so skip it */ + if (classtuple->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + ereport(WARNING, + (errmsg("global temp table \"%s.%s\" skip reindexed", + get_namespace_name(get_rel_namespace(relid)), + get_rel_name(relid)))); + continue; + } + /* Check user/system classification, and optionally skip */ if (objectKind == REINDEX_OBJECT_SYSTEM && !IsSystemClass(relid, classtuple)) diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c index 329ab84..dfa257c 100644 --- a/src/backend/commands/lockcmds.c +++ b/src/backend/commands/lockcmds.c @@ -96,7 +96,8 @@ RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, * transaction. */ relpersistence = get_rel_persistence(relid); - if (relpersistence == RELPERSISTENCE_TEMP) + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPNAMESPACE; /* Check permissions. */ diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 6aab73b..44f350d 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -94,7 +94,7 @@ static HTAB *seqhashtab = NULL; /* hash table for SeqTable items */ */ static SeqTableData *last_used_seq = NULL; -static void fill_seq_with_data(Relation rel, HeapTuple tuple); +static void fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf); static Relation lock_and_open_sequence(SeqTable seq); static void create_seq_hashtable(void); static void init_sequence(Oid relid, SeqTable *p_elm, Relation *p_rel); @@ -108,6 +108,7 @@ static void init_params(ParseState *pstate, List *options, bool for_identity, List **owned_by); static void do_setval(Oid relid, int64 next, bool iscalled); static void process_owned_by(Relation seqrel, List *owned_by, bool for_identity); +int64 get_seqence_start_value(Oid seqid); /* @@ -222,7 +223,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq) /* now initialize the sequence's data */ tuple = heap_form_tuple(tupDesc, value, null); - fill_seq_with_data(rel, tuple); + fill_seq_with_data(rel, tuple, InvalidBuffer); /* process OWNED BY if given */ if (owned_by) @@ -327,7 +328,7 @@ ResetSequence(Oid seq_relid) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seq_rel, tuple); + fill_seq_with_data(seq_rel, tuple, InvalidBuffer); /* Clear local cache so that we don't think we have cached numbers */ /* Note that we do not change the currval() state */ @@ -340,17 +341,21 @@ ResetSequence(Oid seq_relid) * Initialize a sequence's relation with the specified tuple as content */ static void -fill_seq_with_data(Relation rel, HeapTuple tuple) +fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf) { - Buffer buf; Page page; sequence_magic *sm; OffsetNumber offnum; + bool lockBuffer = false; /* Initialize first page of relation with special magic number */ - buf = ReadBuffer(rel, P_NEW); - Assert(BufferGetBlockNumber(buf) == 0); + if (buf == InvalidBuffer) + { + buf = ReadBuffer(rel, P_NEW); + Assert(BufferGetBlockNumber(buf) == 0); + lockBuffer = true; + } page = BufferGetPage(buf); @@ -360,7 +365,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) /* Now insert sequence tuple */ - LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); + if (lockBuffer) + LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); /* * Since VACUUM does not process sequences, we have to force the tuple to @@ -410,7 +416,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) END_CRIT_SECTION(); - UnlockReleaseBuffer(buf); + if (lockBuffer) + UnlockReleaseBuffer(buf); } /* @@ -502,7 +509,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seqrel, newdatatuple); + fill_seq_with_data(seqrel, newdatatuple, InvalidBuffer); } /* process OWNED BY if given */ @@ -1178,6 +1185,25 @@ read_seq_tuple(Relation rel, Buffer *buf, HeapTuple seqdatatuple) LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); page = BufferGetPage(*buf); + if (GlobalTempRelationPageIsNotInitialized(rel, page)) + { + /* Initialize sequence for global temporary tables */ + Datum value[SEQ_COL_LASTCOL] = {0}; + bool null[SEQ_COL_LASTCOL] = {false}; + HeapTuple tuple; + int64 startv = get_seqence_start_value(RelationGetRelid(rel)); + + /* + * last_value from pg_sequence.seqstart + * log_cnt = 0 + * is_called = false + */ + value[SEQ_COL_LASTVAL-1] = Int64GetDatumFast(startv); /* start sequence with 1 */ + + tuple = heap_form_tuple(RelationGetDescr(rel), value, null); + fill_seq_with_data(rel, tuple, *buf); + heap_freetuple(tuple); + } sm = (sequence_magic *) PageGetSpecialPointer(page); if (sm->magic != SEQ_MAGIC) @@ -1954,3 +1980,23 @@ seq_mask(char *page, BlockNumber blkno) mask_unused_space(page); } + +int64 +get_seqence_start_value(Oid seqid) +{ + HeapTuple seqtuple; + Form_pg_sequence seqform; + int64 start; + + seqtuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(seqid)); + if (!HeapTupleIsValid(seqtuple)) + elog(ERROR, "cache lookup failed for sequence %u", + seqid); + + seqform = (Form_pg_sequence) GETSTRUCT(seqtuple); + start = seqform->seqstart; + ReleaseSysCache(seqtuple); + + return start; +} + diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 30b72b6..cc5b991 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -47,6 +47,7 @@ #include "catalog/storage.h" #include "catalog/storage_xlog.h" #include "catalog/toasting.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/comment.h" #include "commands/defrem.h" @@ -552,6 +553,7 @@ static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTbl); static List *GetParentedForeignKeyRefs(Relation partition); static void ATDetachCheckNoForeignKeyRefs(Relation partition); +static bool has_oncommit_option(List *options); /* ---------------------------------------------------------------- @@ -597,6 +599,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, LOCKMODE parentLockmode; const char *accessMethod = NULL; Oid accessMethodId = InvalidOid; + bool has_oncommit_clause = false; /* * Truncate relname to appropriate length (probably a waste of time, as @@ -607,8 +610,10 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Check consistency of arguments */ + /* global temp table same as local temp table */ if (stmt->oncommit != ONCOMMIT_NOOP - && stmt->relation->relpersistence != RELPERSISTENCE_TEMP) + && !(stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("ON COMMIT can only be used on temporary tables"))); @@ -638,7 +643,9 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, * code. This is needed because calling code might not expect untrusted * tables to appear in pg_temp at the front of its search path. */ - if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP + /* global temp table same as local temp table */ + if ((stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) && InSecurityRestrictedOperation()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -739,6 +746,57 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Parse and validate reloptions, if any. */ + /* global temp table */ + has_oncommit_clause = has_oncommit_option(stmt->options); + if (stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (relkind == RELKIND_RELATION || relkind == RELKIND_PARTITIONED_TABLE)) + { + /* inherit table or parition table inherit on commit property from parent table*/ + if (inheritOids && stmt->oncommit == ONCOMMIT_NOOP && !has_oncommit_clause) + { + Oid parent = linitial_oid(inheritOids); + Relation relation = table_open(parent, NoLock); + + if (!RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "The parent table must be global temporary table"); + + if (RELATION_GTT_ON_COMMIT_DELETE(relation)) + stmt->oncommit = ONCOMMIT_DELETE_ROWS; + else + stmt->oncommit = ONCOMMIT_PRESERVE_ROWS; + table_close(relation, NoLock); + } + + if (has_oncommit_clause) + { + if (stmt->oncommit != ONCOMMIT_NOOP) + elog(ERROR, "can not defeine global temp table with on commit and with clause at same time"); + } + else + { + DefElem *opt = makeNode(DefElem); + + opt->type = T_DefElem; + opt->defnamespace = NULL; + opt->defname = "on_commit_delete_rows"; + opt->defaction = DEFELEM_UNSPEC; + + /* use reloptions to remember on commit clause */ + if (stmt->oncommit == ONCOMMIT_DELETE_ROWS) + opt->arg = (Node *)makeString("true"); + else if (stmt->oncommit == ONCOMMIT_PRESERVE_ROWS) + opt->arg = (Node *)makeString("false"); + else if (stmt->oncommit == ONCOMMIT_NOOP) + opt->arg = (Node *)makeString("false"); + else + elog(ERROR, "global temp table not support on commit drop clause"); + + stmt->options = lappend(stmt->options, opt); + } + } + else if (has_oncommit_clause) + elog(ERROR, "regular table cannot specifie on_commit_delete_rows"); + reloptions = transformRelOptions((Datum) 0, stmt->options, NULL, validnsps, true, false); @@ -1800,7 +1858,8 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged, * table or the current physical file to be thrown away anyway. */ if (rel->rd_createSubid == mySubid || - rel->rd_newRelfilenodeSubid == mySubid) + rel->rd_newRelfilenodeSubid == mySubid || + RELATION_IS_GLOBAL_TEMP(rel)) { /* Immediate, non-rollbackable truncation is OK */ heap_truncate_one_rel(rel); @@ -3359,6 +3418,13 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo * specially. */ targetrelation = relation_open(myrelid, is_index ? ShareUpdateExclusiveLock : AccessExclusiveLock); + + if (RELATION_IS_GLOBAL_TEMP(targetrelation)) + { + if (is_other_backend_use_gtt(targetrelation->rd_node)) + elog(ERROR, "can not rename relation when other backend attached this global temp table"); + } + namespaceId = RelationGetNamespace(targetrelation); /* @@ -3534,6 +3600,13 @@ AlterTable(AlterTableStmt *stmt, LOCKMODE lockmode, /* Caller is required to provide an adequate lock. */ rel = relation_open(context->relid, NoLock); + /* We allow to alter global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not alter relation when other backend attached this global temp table"); + } + CheckTableNotInUse(rel, "ALTER TABLE"); ATController(stmt, rel, stmt->cmds, stmt->relation->inh, lockmode, context); @@ -8099,6 +8172,13 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, errmsg("referenced relation \"%s\" is not a table", RelationGetRelationName(pkrel)))); + /* global temp table not support foreign key constraint yet */ + if (RELATION_IS_GLOBAL_TEMP(pkrel)) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("referenced relation \"%s\" is not a global temp table", + RelationGetRelationName(pkrel)))); + if (!allowSystemTableMods && IsSystemRelation(pkrel)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -8138,6 +8218,12 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("constraints on temporary tables must involve temporary tables of this session"))); break; + /* global temp table not support foreign key constraint yet */ + case RELPERSISTENCE_GLOBAL_TEMP: + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("not support foreign key constraints on global temp table yet"))); + break; } /* @@ -13174,7 +13260,7 @@ index_copy_data(Relation rel, RelFileNode newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, @@ -14581,7 +14667,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged) */ switch (rel->rd_rel->relpersistence) { + /* global temp table same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("cannot change logged status of table \"%s\" because it is temporary", @@ -17221,3 +17309,20 @@ ATDetachCheckNoForeignKeyRefs(Relation partition) table_close(rel, NoLock); } } + +static bool +has_oncommit_option(List *options) +{ + ListCell *listptr; + + foreach(listptr, options) + { + DefElem *def = (DefElem *) lfirst(listptr); + + if (pg_strcasecmp(def->defname, "on_commit_delete_rows") == 0) + return true; + } + + return false; +} + diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index d625d17..69ad24f 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -35,6 +35,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/defrem.h" #include "commands/vacuum.h" @@ -1217,6 +1218,17 @@ vac_update_relstats(Relation relation, HeapTuple ctup; Form_pg_class pgcform; bool dirty; + bool is_gtt = false; + + /* global temp table remember relstats to localhash and rel->rd_rel, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(relation)) + { + is_gtt = true; + up_gtt_relstats(relation, + num_pages, num_tuples, + num_all_visible_pages, + frozenxid, minmulti); + } rd = table_open(RelationRelationId, RowExclusiveLock); @@ -1230,17 +1242,26 @@ vac_update_relstats(Relation relation, /* Apply statistical updates, if any, to copied tuple */ dirty = false; - if (pgcform->relpages != (int32) num_pages) + + if (is_gtt) + relation->rd_rel->relpages = (int32) num_pages; + else if (pgcform->relpages != (int32) num_pages) { pgcform->relpages = (int32) num_pages; dirty = true; } - if (pgcform->reltuples != (float4) num_tuples) + + if (is_gtt) + relation->rd_rel->reltuples = (float4) num_tuples; + else if (pgcform->reltuples != (float4) num_tuples) { pgcform->reltuples = (float4) num_tuples; dirty = true; } - if (pgcform->relallvisible != (int32) num_all_visible_pages) + + if (is_gtt) + relation->rd_rel->relallvisible = (int32) num_all_visible_pages; + else if (pgcform->relallvisible != (int32) num_all_visible_pages) { pgcform->relallvisible = (int32) num_all_visible_pages; dirty = true; @@ -1285,7 +1306,8 @@ vac_update_relstats(Relation relation, * This should match vac_update_datfrozenxid() concerning what we consider * to be "in the future". */ - if (TransactionIdIsNormal(frozenxid) && + if (!is_gtt && + TransactionIdIsNormal(frozenxid) && pgcform->relfrozenxid != frozenxid && (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || TransactionIdPrecedes(ReadNewTransactionId(), @@ -1296,7 +1318,8 @@ vac_update_relstats(Relation relation, } /* Similarly for relminmxid */ - if (MultiXactIdIsValid(minmulti) && + if (!is_gtt && + MultiXactIdIsValid(minmulti) && pgcform->relminmxid != minmulti && (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) @@ -1394,6 +1417,10 @@ vac_update_datfrozenxid(void) continue; } + /* global temp table relstats not in pg_class */ + if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + continue; + /* * Some table AMs might not need per-relation xid / multixid horizons. * It therefore seems reasonable to allow relfrozenxid and relminmxid @@ -1451,6 +1478,25 @@ vac_update_datfrozenxid(void) Assert(TransactionIdIsNormal(newFrozenXid)); Assert(MultiXactIdIsValid(newMinMulti)); + /* + * Global temp table get frozenxid from MyProc + * to avoid the vacuum truncate clog that gtt need. + */ + if (max_active_gtt > 0) + { + TransactionId oldest_gtt_frozenxid = + list_all_session_gtt_frozenxids(0, NULL, NULL, NULL); + + if (TransactionIdIsNormal(oldest_gtt_frozenxid) && + TransactionIdPrecedes(oldest_gtt_frozenxid, newFrozenXid)) + { + ereport(WARNING, + (errmsg("global temp table oldest FrozenXid is far in the past"), + errhint("please truncate them or kill those sessions that use them."))); + newFrozenXid = oldest_gtt_frozenxid; + } + } + /* Now fetch the pg_database tuple we need to update. */ relation = table_open(DatabaseRelationId, RowExclusiveLock); diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 8286d9c..c3992a4 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -591,6 +591,8 @@ static void set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) { + char relpersistence; + /* * The flag has previously been initialized to false, so we can just * return if it becomes clear that we can't safely set it. @@ -618,7 +620,11 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, * the rest of the necessary infrastructure right now anyway. So * for now, bail out if we see a temporary table. */ - if (get_rel_persistence(rte->relid) == RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + relpersistence = get_rel_persistence(rte->relid); + + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) return; /* diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index d6f2153..310a9e2 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -6312,7 +6312,9 @@ plan_create_index_workers(Oid tableOid, Oid indexOid) * Furthermore, any index predicate or index expressions must be parallel * safe. */ + /* global temp table is same as local temp table */ if (heap->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + heap->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP || !is_parallel_safe(root, (Node *) RelationGetIndexExpressions(index)) || !is_parallel_safe(root, (Node *) RelationGetIndexPredicate(index))) { diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 748bebf..a5ddbcd 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2579,6 +2579,11 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("materialized views must not use temporary tables or views"))); + if (is_query_using_gtt(query)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialized views must not use global temporary tables or views"))); + /* * A materialized view would either need to save parameters for use in * maintaining/loading the data or prohibit them entirely. The latter diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index ba5916b..0ee6931 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3290,17 +3290,11 @@ OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; } | LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; } | GLOBAL TEMPORARY { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; } | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; } @@ -11588,19 +11582,13 @@ OptTempTableName: } | GLOBAL TEMPORARY opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED opt_table qualified_name { diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index b875a50..123945b 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -81,6 +81,7 @@ static void expandTupleDesc(TupleDesc tupdesc, Alias *eref, List **colnames, List **colvars); static int specialAttNum(const char *attname); static bool isQueryUsingTempRelation_walker(Node *node, void *context); +static bool is_query_using_gtt_walker(Node *node, void *context); /* @@ -3579,3 +3580,49 @@ isQueryUsingTempRelation_walker(Node *node, void *context) isQueryUsingTempRelation_walker, context); } + +/* check if the query uses global temp table */ +static bool +is_query_using_gtt_walker(Node *node, void *context) +{ + if (node == NULL) + return false; + + if (IsA(node, Query)) + { + Query *query = (Query *) node; + ListCell *rtable; + + foreach(rtable, query->rtable) + { + RangeTblEntry *rte = lfirst(rtable); + + if (rte->rtekind == RTE_RELATION) + { + Relation rel = relation_open(rte->relid, AccessShareLock); + char relpersistence = rel->rd_rel->relpersistence; + + relation_close(rel, AccessShareLock); + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + return true; + } + } + + return query_tree_walker(query, + is_query_using_gtt_walker, + context, + QTW_IGNORE_JOINALIASES); + } + + return expression_tree_walker(node, + is_query_using_gtt_walker, + context); +} + +/* check if the query uses global temp table */ +bool +is_query_using_gtt(Query *query) +{ + return is_query_using_gtt_walker((Node *) query, NULL); +} + diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index ee2d2b5..9c9abaa 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -437,6 +437,9 @@ generateSerialExtraStmts(CreateStmtContext *cxt, ColumnDef *column, seqstmt->sequence = makeRangeVar(snamespace, sname, -1); seqstmt->options = seqoptions; + if (cxt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + seqstmt->sequence->relpersistence = cxt->relation->relpersistence; + /* * If a sequence data type was specified, add it to the options. Prepend * to the list rather than append; in case a user supplied their own AS diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 6d1f28c..ed837d1 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2086,6 +2086,11 @@ do_autovacuum(void) } continue; } + else if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + /* autovacuum skip vacuum global temp table */ + continue; + } /* Fetch reloptions and the pgstat entry for this table */ relopts = extract_autovac_opts(tuple, pg_class_desc); @@ -2152,7 +2157,9 @@ do_autovacuum(void) /* * We cannot safely process other backends' temp tables, so skip 'em. */ - if (classForm->relpersistence == RELPERSISTENCE_TEMP) + /* autovacuum skip vacuum global temp table */ + if (classForm->relpersistence == RELPERSISTENCE_TEMP || + classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) continue; relid = classForm->oid; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index aba3960..3c4b96c 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -37,6 +37,7 @@ #include "access/xlog.h" #include "catalog/catalog.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "executor/instrument.h" #include "lib/binaryheap.h" #include "miscadmin.h" @@ -52,6 +53,7 @@ #include "utils/rel.h" #include "utils/resowner_private.h" #include "utils/timestamp.h" +#include "utils/guc.h" /* Note: these two macros only work on shared buffers, not local ones! */ @@ -432,7 +434,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref) static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, - bool *hit); + bool *hit, Relation rel); static bool PinBuffer(BufferDesc *buf, BufferAccessStrategy strategy); static void PinBuffer_Locked(BufferDesc *buf); static void UnpinBuffer(BufferDesc *buf, bool fixOwner); @@ -664,7 +666,8 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, */ pgstat_count_buffer_read(reln); buf = ReadBuffer_common(reln->rd_smgr, reln->rd_rel->relpersistence, - forkNum, blockNum, mode, strategy, &hit); + forkNum, blockNum, mode, strategy, &hit, + reln); if (hit) pgstat_count_buffer_hit(reln); return buf; @@ -692,7 +695,7 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, Assert(InRecovery); return ReadBuffer_common(smgr, RELPERSISTENCE_PERMANENT, forkNum, blockNum, - mode, strategy, &hit); + mode, strategy, &hit, NULL); } @@ -704,7 +707,8 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, - BufferAccessStrategy strategy, bool *hit) + BufferAccessStrategy strategy, bool *hit, + Relation rel) { BufferDesc *bufHdr; Block bufBlock; @@ -719,6 +723,15 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, isExtend = (blockNum == P_NEW); + /* create storage when first read data page for gtt */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (isExtend || blockNum == 0) && + forkNum == MAIN_FORKNUM && + !gtt_storage_attached(smgr->smgr_rnode.node.relNode)) + { + RelationCreateStorage(smgr->smgr_rnode.node, relpersistence, rel); + } + TRACE_POSTGRESQL_BUFFER_READ_START(forkNum, blockNum, smgr->smgr_rnode.node.spcNode, smgr->smgr_rnode.node.dbNode, @@ -2809,6 +2822,16 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln) BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum) { + /* + * When this backend not init gtt storage + * return 0 + */ + if (RELATION_IS_GLOBAL_TEMP(relation) && + !gtt_storage_attached(relation->rd_node.relNode)) + { + return 0; + } + switch (relation->rd_rel->relkind) { case RELKIND_SEQUENCE: diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c index 427b0d5..7adb969 100644 --- a/src/backend/storage/ipc/ipci.c +++ b/src/backend/storage/ipc/ipci.c @@ -21,6 +21,7 @@ #include "access/nbtree.h" #include "access/subtrans.h" #include "access/twophase.h" +#include "catalog/storage_gtt.h" #include "commands/async.h" #include "miscadmin.h" #include "pgstat.h" @@ -147,6 +148,7 @@ CreateSharedMemoryAndSemaphores(void) size = add_size(size, BTreeShmemSize()); size = add_size(size, SyncScanShmemSize()); size = add_size(size, AsyncShmemSize()); + size = add_size(size, active_gtt_shared_hash_size()); #ifdef EXEC_BACKEND size = add_size(size, ShmemBackendArraySize()); #endif @@ -217,6 +219,8 @@ CreateSharedMemoryAndSemaphores(void) SUBTRANSShmemInit(); MultiXactShmemInit(); InitBufferPool(); + /* global temporary table */ + active_gtt_shared_hash_init(); /* * Set up lock manager diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index c3adb2e..eb95e5f 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -62,6 +62,7 @@ #include "utils/builtins.h" #include "utils/rel.h" #include "utils/snapmgr.h" +#include "utils/guc.h" #define UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) @@ -4087,3 +4088,77 @@ KnownAssignedXidsReset(void) LWLockRelease(ProcArrayLock); } + +/* + * search all active backend to get oldest frozenxid + * for global temp table. + */ +int +list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n) +{ + ProcArrayStruct *arrayP = procArray; + TransactionId result = InvalidTransactionId; + int index; + int flags = 0; + int i = 0; + + if (max_active_gtt <= 0) + return 0; + + if (max_size > 0) + { + Assert(pids); + Assert(xids); + Assert(n); + *n = 0; + } + + if (max_active_gtt <= 0) + return InvalidTransactionId; + + if (RecoveryInProgress()) + return InvalidTransactionId; + + flags |= PROC_IS_AUTOVACUUM; + flags |= PROC_IN_LOGICAL_DECODING; + + LWLockAcquire(ProcArrayLock, LW_SHARED); + if (max_size > 0 && max_size < arrayP->numProcs) + { + LWLockRelease(ProcArrayLock); + elog(ERROR, "list_all_gtt_frozenxids require more array"); + } + + for (index = 0; index < arrayP->numProcs; index++) + { + int pgprocno = arrayP->pgprocnos[index]; + volatile PGPROC *proc = &allProcs[pgprocno]; + volatile PGXACT *pgxact = &allPgXact[pgprocno]; + + if (pgxact->vacuumFlags & flags) + continue; + + if (proc->databaseId == MyDatabaseId && + TransactionIdIsNormal(proc->session_gtt_frozenxid)) + { + if (result == InvalidTransactionId) + result = proc->session_gtt_frozenxid; + else if (TransactionIdPrecedes(proc->session_gtt_frozenxid, result)) + result = proc->session_gtt_frozenxid; + + if (max_size > 0) + { + pids[i] = proc->pid; + xids[i] = proc->session_gtt_frozenxid; + i++; + } + } + } + LWLockRelease(ProcArrayLock); + + if (max_size > 0) + *n = i; + + return result; +} + diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 32df8c8..e4e1125 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -395,6 +395,7 @@ InitProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; @@ -577,6 +578,7 @@ InitAuxiliaryProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index 85b7115..f5eae8c 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -646,6 +646,12 @@ mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, */ if (zero_damaged_pages || InRecovery) MemSet(buffer, 0, BLCKSZ); + else if(SmgrIsTemp(reln) && blocknum == 0 && forknum == MAIN_FORKNUM) + { + /* global temp table init btree meta page */ + MemSet(buffer, 0, BLCKSZ); + mdwrite(reln, forknum, blocknum, buffer, true); + } else ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 7c6f057..eb10cf2 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -112,6 +112,7 @@ #include "catalog/pg_operator.h" #include "catalog/pg_statistic.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "executor/nodeAgg.h" #include "miscadmin.h" #include "nodes/makefuncs.h" @@ -4578,12 +4579,25 @@ examine_variable(PlannerInfo *root, Node *node, int varRelid, } else if (index->indpred == NIL) { - vardata->statsTuple = - SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(index->indexoid), - Int16GetDatum(pos + 1), - BoolGetDatum(false)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(index->indexoid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = + get_gtt_att_statistic(index->indexoid, + Int16GetDatum(pos + 1), + false); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + vardata->statsTuple = + SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(index->indexoid), + Int16GetDatum(pos + 1), + BoolGetDatum(false)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -4708,15 +4722,27 @@ examine_simple_variable(PlannerInfo *root, Var *var, } else if (rte->rtekind == RTE_RELATION) { - /* - * Plain table or parent of an inheritance appendrel, so look up the - * column in pg_statistic - */ - vardata->statsTuple = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(rte->relid), - Int16GetDatum(var->varattno), - BoolGetDatum(rte->inh)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(rte->relid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = get_gtt_att_statistic(rte->relid, + var->varattno, + rte->inh); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + /* + * Plain table or parent of an inheritance appendrel, so look up the + * column in pg_statistic + */ + vardata->statsTuple = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(rte->relid), + Int16GetDatum(var->varattno), + BoolGetDatum(rte->inh)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -6098,6 +6124,7 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, { /* Simple variable --- look to stats for the underlying table */ RangeTblEntry *rte = planner_rt_fetch(index->rel->relid, root); + char rel_persistence = get_rel_persistence(rte->relid); Assert(rte->rtekind == RTE_RELATION); relid = rte->relid; @@ -6115,6 +6142,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + rte->inh); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -6126,6 +6160,8 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* Expression --- maybe there are stats for the index itself */ relid = index->indexoid; colnum = 1; @@ -6141,6 +6177,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -7054,6 +7097,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, /* attempt to lookup stats in relation for this index column */ if (attnum != 0) { + char rel_persistence = get_rel_persistence(rte->relid); + /* Simple variable -- look to stats for the underlying table */ if (get_relation_stats_hook && (*get_relation_stats_hook) (root, rte, attnum, &vardata)) @@ -7066,6 +7111,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(rte->relid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = @@ -7078,6 +7131,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* * Looks like we've found an expression column in the index. Let's * see if there's any stats for it. @@ -7097,6 +7152,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(index->indexoid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 1e3e6d3..345e3e9 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -34,6 +34,7 @@ #include "catalog/pg_statistic.h" #include "catalog/pg_transform.h" #include "catalog/pg_type.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "utils/array.h" @@ -2878,6 +2879,18 @@ get_attavgwidth(Oid relid, AttrNumber attnum) if (stawidth > 0) return stawidth; } + if (get_rel_persistence(relid) == RELPERSISTENCE_GLOBAL_TEMP) + { + tp = get_gtt_att_statistic(relid, attnum, false); + if (!HeapTupleIsValid(tp)) + return 0; + + stawidth = ((Form_pg_statistic) GETSTRUCT(tp))->stawidth; + if (stawidth > 0) + return stawidth; + else + return 0; + } tp = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(relid), Int16GetDatum(attnum), diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index df025a5..1f733f4 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -63,6 +63,7 @@ #include "catalog/pg_type.h" #include "catalog/schemapg.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/policy.h" #include "commands/trigger.h" #include "miscadmin.h" @@ -1124,6 +1125,28 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) relation->rd_islocaltemp = false; } break; + case RELPERSISTENCE_GLOBAL_TEMP: + { + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + + relation->rd_backend = BackendIdForTempRelations(); + /* + * For global temp table, all backend can use + * this relation, so rd_islocaltemp always true. + */ + relation->rd_islocaltemp = true; + get_gtt_relstats(RelationGetRelid(relation), + &relpages, + &reltuples, + &relallvisible, + NULL, NULL); + relation->rd_rel->relpages = (int32)relpages; + relation->rd_rel->reltuples = (float4)reltuples; + relation->rd_rel->relallvisible = (int32)relallvisible; + } + break; default: elog(ERROR, "invalid relpersistence: %c", relation->rd_rel->relpersistence); @@ -3313,6 +3336,10 @@ RelationBuildLocalRelation(const char *relname, rel->rd_backend = BackendIdForTempRelations(); rel->rd_islocaltemp = true; break; + case RELPERSISTENCE_GLOBAL_TEMP: + rel->rd_backend = BackendIdForTempRelations(); + rel->rd_islocaltemp = true; + break; default: elog(ERROR, "invalid relpersistence: %c", relpersistence); break; @@ -3427,6 +3454,9 @@ RelationSetNewRelfilenode(Relation relation, char persistence) TransactionId freezeXid = InvalidTransactionId; RelFileNode newrnode; + if (RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "global temp table does not allow setting new relfilenode"); + /* Allocate a new relfilenode */ newrelfilenode = GetNewRelFileNode(relation->rd_rel->reltablespace, NULL, persistence); @@ -3467,7 +3497,7 @@ RelationSetNewRelfilenode(Relation relation, char persistence) /* handle these directly, at least for now */ SMgrRelation srel; - srel = RelationCreateStorage(newrnode, persistence); + srel = RelationCreateStorage(newrnode, persistence, relation); smgrclose(srel); } break; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index e44f71e..44c86c8 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -139,6 +139,18 @@ char *GUC_check_errmsg_string; char *GUC_check_errdetail_string; char *GUC_check_errhint_string; +/* + * num = 0 means disable global temp table feature. + * global temp table define can still storage in catalog + * just can not use. + * num > 0 means database can management num active global temp table. + */ +#define MIN_NUM_ACTIVE_GTT 0 +#define DEFAULT_NUM_ACTIVE_GTT 1000 +#define MAX_NUM_ACTIVE_GTT 1000000 + +int max_active_gtt = MIN_NUM_ACTIVE_GTT; + static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3, 4); static void set_config_sourcefile(const char *name, char *sourcefile, @@ -1992,6 +2004,15 @@ static struct config_bool ConfigureNamesBool[] = static struct config_int ConfigureNamesInt[] = { { + {"max_active_global_temporary_table", PGC_POSTMASTER, UNGROUPED, + gettext_noop("max active global temporary table."), + NULL + }, + &max_active_gtt, + DEFAULT_NUM_ACTIVE_GTT, MIN_NUM_ACTIVE_GTT, MAX_NUM_ACTIVE_GTT, + NULL, NULL, NULL + }, + { {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Forces a switch to the next WAL file if a " "new file has not been started within N seconds."), diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 799b698..b98d396 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15583,6 +15583,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) { char *ftoptions = NULL; char *srvname = NULL; + char *table_type = NULL; switch (tbinfo->relkind) { @@ -15634,9 +15635,15 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) binary_upgrade_set_pg_class_oids(fout, q, tbinfo->dobj.catId.oid, false); + if (tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED) + table_type = "UNLOGGED "; + else if (tbinfo->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + table_type = "GLOBAL TEMPORARY "; + else + table_type = ""; + appendPQExpBuffer(q, "CREATE %s%s %s", - tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ? - "UNLOGGED " : "", + table_type, reltypename, qualrelname); diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index f3c7eb9..28134e2 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3723,7 +3723,8 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys if (pset.sversion >= 90100) { appendPQExpBuffer(&buf, - ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + ",\n CASE c.relpersistence WHEN 'g' THEN '%s' WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + gettext_noop("session"), gettext_noop("permanent"), gettext_noop("temporary"), gettext_noop("unlogged"), diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 052d98b..f35d9bf 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -1003,6 +1003,8 @@ static const pgsql_thing_t words_after_create[] = { {"FOREIGN TABLE", NULL, NULL, NULL}, {"FUNCTION", NULL, NULL, Query_for_list_of_functions}, {"GROUP", Query_for_list_of_roles}, + {"GLOBAL", NULL, NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE GLOBAL TEMP/TEMPORARY TABLE + * ... */ {"INDEX", NULL, NULL, &Query_for_list_of_indexes}, {"LANGUAGE", Query_for_list_of_languages}, {"LARGE OBJECT", NULL, NULL, NULL, THING_NO_CREATE | THING_NO_DROP}, @@ -2326,6 +2328,9 @@ psql_completion(const char *text, int start, int end) /* CREATE FOREIGN DATA WRAPPER */ else if (Matches("CREATE", "FOREIGN", "DATA", "WRAPPER", MatchAny)) COMPLETE_WITH("HANDLER", "VALIDATOR", "OPTIONS"); + /* CREATE GLOBAL TEMP/TEMPORARY*/ + else if (Matches("CREATE", "GLOBAL")) + COMPLETE_WITH("TEMP", "TEMPORARY"); /* CREATE INDEX --- is allowed inside CREATE SCHEMA, so use TailMatches */ /* First off we complete CREATE UNIQUE with "INDEX" */ @@ -2534,6 +2539,8 @@ psql_completion(const char *text, int start, int end) /* Complete "CREATE TEMP/TEMPORARY" with the possible temp objects */ else if (TailMatches("CREATE", "TEMP|TEMPORARY")) COMPLETE_WITH("SEQUENCE", "TABLE", "VIEW"); + else if (TailMatches("CREATE", "GLOBAL", "TEMP|TEMPORARY")) + COMPLETE_WITH("TABLE"); /* Complete "CREATE UNLOGGED" with TABLE or MATVIEW */ else if (TailMatches("CREATE", "UNLOGGED")) COMPLETE_WITH("TABLE", "MATERIALIZED VIEW"); diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index a12fc1f..78958e4 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -165,6 +165,7 @@ typedef FormData_pg_class *Form_pg_class; #define RELPERSISTENCE_PERMANENT 'p' /* regular table */ #define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */ #define RELPERSISTENCE_TEMP 't' /* temporary table */ +#define RELPERSISTENCE_GLOBAL_TEMP 'g' /* global temporary table */ /* default selection for replica identity (primary key or nothing) */ #define REPLICA_IDENTITY_DEFAULT 'd' diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index fcf2a12..ba0bd5f 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5484,6 +5484,40 @@ proparallel => 'r', prorettype => 'float8', proargtypes => 'oid', prosrc => 'pg_stat_get_xact_function_self_time' }, +# For global temporary table +{ oid => '4191', + descr => 'List local statistics for global temporary table', + proname => 'pg_get_gtt_statistics', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid int4 anyelement', + proallargtypes => '{oid,int4,anyelement,oid,int2,bool,float4,int4,float4,int2,int2,int2,int2,int2,oid,oid,oid,oid,oid,oid,oid,oid,oid,oid,_float4,_float4,_float4,_float4,_float4,anyarray,anyarray,anyarray,anyarray,anyarray}', + proargmodes => '{i,i,i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}', + proargnames => '{relid,att,x,starelid,staattnum,stainherit,stanullfrac,stawidth,stadistinct,stakind1,stakind2,stakind3,stakind4,stakind5,staop1,staop2,staop3,staop4,staop5,stacoll1,stacoll2,stacoll3,stacoll4,stacoll5,stanumbers1,stanumbers2,stanumbers3,stanumbers4,stanumbers5,stavalues1,stavalues2,stavalues3,stavalues4,stavalues5}', + prosrc => 'pg_get_gtt_statistics' }, +{ oid => '4192', + descr => 'List local relstats for global temporary table', + proname => 'pg_get_gtt_relstats', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,int4,float4,int4,xid,xid}', + proargmodes => '{i,o,o,o,o,o}', + proargnames => '{relid,relpages,reltuples,relallvisible,relfrozenxid,relminmxid}', + prosrc => 'pg_get_gtt_relstats' }, +{ oid => '4193', + descr => 'List attached pid for one global temporary table', + proname => 'pg_gtt_attached_pid', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,oid,int4}', + proargmodes => '{i,o,o}', + proargnames => '{relid,relid,pid}', + prosrc => 'pg_gtt_attached_pid' }, +{ oid => '4194', + descr => 'List those backends that have used global temporary table', + proname => 'pg_list_gtt_relfrozenxids', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => '', + proallargtypes => '{int4,xid}', + proargmodes => '{o,o}', + proargnames => '{pid,relfrozenxid}', + prosrc => 'pg_list_gtt_relfrozenxids' }, + { oid => '3788', descr => 'statistics: timestamp of the current statistics snapshot', proname => 'pg_stat_get_snapshot_timestamp', provolatile => 's', diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h index 048003c..af48cdf 100644 --- a/src/include/catalog/storage.h +++ b/src/include/catalog/storage.h @@ -19,7 +19,7 @@ #include "storage/smgr.h" #include "utils/relcache.h" -extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence); +extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel); extern void RelationDropStorage(Relation rel); extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit); extern void RelationTruncate(Relation rel, BlockNumber nblocks); diff --git a/src/include/catalog/storage_gtt.h b/src/include/catalog/storage_gtt.h new file mode 100644 index 0000000..eacc214 --- /dev/null +++ b/src/include/catalog/storage_gtt.h @@ -0,0 +1,39 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.h + * prototypes for functions in backend/catalog/storage_gtt.c + * + * src/include/catalog/storage_gtt.h + * + *------------------------------------------------------------------------- + */ +#ifndef STORAGE_GTT_H +#define STORAGE_GTT_H + +#include "access/htup.h" +#include "storage/block.h" +#include "storage/relfilenode.h" +#include "utils/relcache.h" + +extern Size active_gtt_shared_hash_size(void); +extern void active_gtt_shared_hash_init(void); +extern void remember_gtt_storage_info(RelFileNode rnode, Relation rel); +extern void forget_gtt_storage_info(Oid relid); +extern bool is_other_backend_use_gtt(RelFileNode node); +extern bool gtt_storage_attached(Oid relid); +extern Bitmapset *copy_active_gtt_bitmap(RelFileNode node); +extern void up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull); +extern HeapTuple get_gtt_att_statistic(Oid reloid, int attnum, bool inh); +extern void release_gtt_statistic_cache(HeapTuple tup); +extern void up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid); +extern bool get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid); + +#endif /* STORAGE_H */ diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index 93f9446..14cafae 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -120,4 +120,7 @@ extern Oid attnumTypeId(Relation rd, int attid); extern Oid attnumCollationId(Relation rd, int attid); extern bool isQueryUsingTempRelation(Query *query); +/* global temp table check */ +extern bool is_query_using_gtt(Query *query); + #endif /* PARSE_RELATION_H */ diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 870ecb5..92c590e 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -405,6 +405,8 @@ do { \ #define PageClearPrunable(page) \ (((PageHeader) (page))->pd_prune_xid = InvalidTransactionId) +#define GlobalTempRelationPageIsNotInitialized(rel, page) \ + ((rel)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && PageIsNew(page)) /* ---------------------------------------------------------------- * extern declarations diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 8fda8e4..172eae9 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -220,6 +220,7 @@ typedef enum BuiltinTrancheIds LWTRANCHE_TBM, LWTRANCHE_PARALLEL_APPEND, LWTRANCHE_SXACT, + LWTRANCHE_GTT_CTL, LWTRANCHE_FIRST_USER_DEFINED } BuiltinTrancheIds; diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 5b407e6..f13250a 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -117,6 +117,8 @@ struct PGPROC Oid tempNamespaceId; /* OID of temp schema this backend is * using */ + TransactionId session_gtt_frozenxid; /* session level global temp table relfrozenxid */ + bool isBackgroundWorker; /* true if background worker. */ /* diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index a5c7d0c..a86f61f 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -125,4 +125,6 @@ extern void ProcArraySetReplicationSlotXmin(TransactionId xmin, extern void ProcArrayGetReplicationSlotXmin(TransactionId *xmin, TransactionId *catalog_xmin); +extern int list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n); + #endif /* PROCARRAY_H */ diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index ce93ace..0f7262e 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -281,6 +281,10 @@ extern int tcp_user_timeout; extern bool trace_sort; #endif +/* global temporary table */ +extern int max_active_gtt; +/* end */ + /* * Functions exported by guc.c */ diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 44ed04d..3f9720d 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -277,6 +277,7 @@ typedef struct StdRdOptions int parallel_workers; /* max number of parallel workers */ bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */ bool vacuum_truncate; /* enables vacuum to truncate a relation */ + bool on_commit_delete_rows; /* global temp table */ } StdRdOptions; #define HEAP_MIN_FILLFACTOR 10 @@ -535,7 +536,8 @@ typedef struct ViewOptions * True if relation's pages are stored in local buffers. */ #define RelationUsesLocalBuffers(relation) \ - ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP || \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) /* * RELATION_IS_LOCAL @@ -602,6 +604,17 @@ typedef struct ViewOptions RelationNeedsWAL(relation) && \ !IsCatalogRelation(relation)) +/* global temp table implementations */ +#define RELATION_IS_GLOBAL_TEMP(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + +#define RELATION_GTT_ON_COMMIT_DELETE(relation) \ + ((relation)->rd_options && \ + ((relation)->rd_rel->relkind == RELKIND_RELATION || (relation)->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) && \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP ? \ + ((StdRdOptions *) (relation)->rd_options)->on_commit_delete_rows : false) + +#define RelationGetRelPersistence(relation) ((relation)->rd_rel->relpersistence) + /* routines in utils/cache/relcache.c */ extern void RelationIncrementReferenceCount(Relation rel); extern void RelationDecrementReferenceCount(Relation rel); diff --git a/src/test/regress/expected/gtt_clean.out b/src/test/regress/expected/gtt_clean.out new file mode 100644 index 0000000..50ca9ac --- /dev/null +++ b/src/test/regress/expected/gtt_clean.out @@ -0,0 +1,7 @@ +reset search_path; +drop schema gtt cascade; +NOTICE: drop cascades to 4 other objects +DETAIL: drop cascades to table gtt.gtt1 +drop cascades to table gtt.gtt2 +drop cascades to table gtt.gtt3 +drop cascades to table gtt.gtt_t_kenyon diff --git a/src/test/regress/expected/gtt_function.out b/src/test/regress/expected/gtt_function.out new file mode 100644 index 0000000..a477917 --- /dev/null +++ b/src/test/regress/expected/gtt_function.out @@ -0,0 +1,197 @@ +CREATE SCHEMA IF NOT EXISTS gtt_function; +set search_path=gtt_function,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt_test_rename(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); +ERROR: cannot create indexes on global temporary tables using concurrent mode +-- ERROR +cluster gtt1 using gtt1_pkey; +ERROR: not support cluster global temporary tables yet +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; +ERROR: ON COMMIT can only be used on temporary tables +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); +ERROR: regular table cannot specifie on_commit_delete_rows +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; + count +------- + 2 +(1 row) + +commit; +select count(*) from p_table01; + count +------- + 0 +(1 row) + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +ERROR: The parent table must be global temporary table +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + relname | relkind | relpersistence | reloptions +---------------------------------+---------+----------------+------------------------------- + p_table01 | p | g | {on_commit_delete_rows=true} + p_table01_2017 | r | g | {on_commit_delete_rows=true} + p_table01_2018 | r | g | {on_commit_delete_rows=true} + p_table01_id_seq | S | g | + p_table02 | p | g | {on_commit_delete_rows=false} + p_table02_2017 | r | g | {on_commit_delete_rows=false} + p_table02_2018 | r | g | {on_commit_delete_rows=false} + p_table02_id_seq | S | g | + tbl_inherits_parent | r | p | + tbl_inherits_parent_global_temp | r | g | {on_commit_delete_rows=true} + tbl_inherits_partition | r | g | {on_commit_delete_rows=true} +(11 rows) + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; +ERROR: global temp table not support on commit drop clause +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; +ERROR: can not defeine global temp table with on commit and with clause at same time +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); +--ok +alter table gtt_test_rename rename to gtt_test; +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; + id | a +----+--- + 2 | 1 + 3 | 2 +(2 rows) + +truncate gtt_seq; +select * from gtt_seq order by id; + id | a +----+--- +(0 rows) + +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + id | a +----+--- + 4 | 3 +(1 row) + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; +ERROR: materialized views must not use global temporary tables or views +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +ERROR: only support btree index on global temp table +create index idx_err on gtt1 using gist (a); +ERROR: data type integer has no default operator class for access method "gist" +HINT: You must specify an operator class for the index or define a default operator class for the data type. +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +ERROR: only support btree index on global temp table +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); +ERROR: only support btree index on global temp table +reset search_path; +drop schema gtt_function cascade; +NOTICE: drop cascades to 15 other objects +DETAIL: drop cascades to table gtt_function.gtt1 +drop cascades to table gtt_function.gtt_test +drop cascades to table gtt_function.gtt2 +drop cascades to table gtt_function.gtt3 +drop cascades to table gtt_function.tmp_t0 +drop cascades to table gtt_function.tbl_inherits_parent +drop cascades to table gtt_function.tbl_inherits_parent_global_temp +drop cascades to table gtt_function.products +drop cascades to table gtt_function.measurement +drop cascades to table gtt_function.p_table01 +drop cascades to table gtt_function.p_table02 +drop cascades to table gtt_function.tbl_inherits_partition +drop cascades to table gtt_function.gtt5 +drop cascades to table gtt_function.mytable +drop cascades to table gtt_function.gtt_seq diff --git a/src/test/regress/expected/gtt_parallel_1.out b/src/test/regress/expected/gtt_parallel_1.out new file mode 100644 index 0000000..30d8a7b --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_1.out @@ -0,0 +1,84 @@ +set search_path=gtt,sys; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_parallel_2.out b/src/test/regress/expected/gtt_parallel_2.out new file mode 100644 index 0000000..850ef3e --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_2.out @@ -0,0 +1,161 @@ +set search_path=gtt,sys; +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +commit; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 + 3 | test1 +(3 rows) + +rollback; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test2 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; + a | b +---+------- + 3 | test3 +(1 row) + +rollback; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; + a | b +---+------- + 5 | test5 +(1 row) + +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + a | b +---+------- + 6 | test6 +(1 row) + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; + count +-------- + 100000 +(1 row) + +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + QUERY PLAN +------------------------------------ + Index Scan using gtt3_pkey on gtt3 + Index Cond: (a = 300) +(2 rows) + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; + relname | pg_relation_size | pg_relation_size | pg_table_size | pg_indexes_size | pg_total_relation_size +--------------+------------------+------------------+---------------+-----------------+------------------------ + gtt_t_kenyon | 450560 | 8192 | 499712 | 475136 | 974848 +(1 row) + +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + relname +-------------- + gtt_t_kenyon +(1 row) + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + relname | pg_relation_size | pg_table_size | pg_total_relation_size +--------------------+------------------+---------------+------------------------ + idx_gtt_t_kenyon_1 | 65536 | 65536 | 65536 + idx_gtt_t_kenyon_2 | 409600 | 409600 | 409600 +(2 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_prepare.out b/src/test/regress/expected/gtt_prepare.out new file mode 100644 index 0000000..9fe5fd4 --- /dev/null +++ b/src/test/regress/expected/gtt_prepare.out @@ -0,0 +1,9 @@ +CREATE SCHEMA IF NOT EXISTS gtt; +set search_path=gtt,sys; +create global temp table gtt1(a int primary key, b text) on commit delete rows; +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text); +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; diff --git a/src/test/regress/expected/gtt_stats.out b/src/test/regress/expected/gtt_stats.out new file mode 100644 index 0000000..b258b7c --- /dev/null +++ b/src/test/regress/expected/gtt_stats.out @@ -0,0 +1,76 @@ +CREATE SCHEMA IF NOT EXISTS gtt_stats; +set search_path=gtt_stats,sys; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +insert into gtt values(generate_series(1,10000),'test'); +-- expect 1 +select count(*) from pg_gtt_attached_pids; + count +------- + 1 +(1 row) + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 2 +(1 row) + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 0 | 0 | 0 +(1 row) + +-- expect 0 +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+------------------+-------------+-------------------+------------------------+---------------------- +(0 rows) + +analyze gtt; +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 55 | 10000 | 0 +(1 row) + +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------------------+------------------------+---------------------- + gtt_stats | gtt | a | f | 0 | 4 | -1 | | | {1,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,8700,8800,8900,9000,9100,9200,9300,9400,9500,9600,9700,9800,9900,10000} | 1 | | | + gtt_stats | gtt | b | f | 0 | 5 | 1 | {test} | {1} | | 1 | | | +(2 rows) + +reset search_path; +drop schema gtt_stats cascade; +NOTICE: drop cascades to table gtt_stats.gtt diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 70e1e2f..30cf4bd 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1348,6 +1348,93 @@ pg_group| SELECT pg_authid.rolname AS groname, WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin); +pg_gtt_attached_pids| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relid, + s.pid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_gtt_attached_pid(c.oid) s(relid, pid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_relstats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relpages, + s.reltuples, + s.relallvisible, + s.relfrozenxid, + s.relminmxid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_relstats(c.oid) s(relpages, reltuples, relallvisible, relfrozenxid, relminmxid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_stats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN (s.stakind1 = 1) THEN s.stavalues1 + WHEN (s.stakind2 = 1) THEN s.stavalues2 + WHEN (s.stakind3 = 1) THEN s.stavalues3 + WHEN (s.stakind4 = 1) THEN s.stavalues4 + WHEN (s.stakind5 = 1) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_vals, + CASE + WHEN (s.stakind1 = 1) THEN s.stanumbers1 + WHEN (s.stakind2 = 1) THEN s.stanumbers2 + WHEN (s.stakind3 = 1) THEN s.stanumbers3 + WHEN (s.stakind4 = 1) THEN s.stanumbers4 + WHEN (s.stakind5 = 1) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_freqs, + CASE + WHEN (s.stakind1 = 2) THEN s.stavalues1 + WHEN (s.stakind2 = 2) THEN s.stavalues2 + WHEN (s.stakind3 = 2) THEN s.stavalues3 + WHEN (s.stakind4 = 2) THEN s.stavalues4 + WHEN (s.stakind5 = 2) THEN s.stavalues5 + ELSE NULL::text[] + END AS histogram_bounds, + CASE + WHEN (s.stakind1 = 3) THEN s.stanumbers1[1] + WHEN (s.stakind2 = 3) THEN s.stanumbers2[1] + WHEN (s.stakind3 = 3) THEN s.stanumbers3[1] + WHEN (s.stakind4 = 3) THEN s.stanumbers4[1] + WHEN (s.stakind5 = 3) THEN s.stanumbers5[1] + ELSE NULL::real + END AS correlation, + CASE + WHEN (s.stakind1 = 4) THEN s.stavalues1 + WHEN (s.stakind2 = 4) THEN s.stavalues2 + WHEN (s.stakind3 = 4) THEN s.stavalues3 + WHEN (s.stakind4 = 4) THEN s.stavalues4 + WHEN (s.stakind5 = 4) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_elems, + CASE + WHEN (s.stakind1 = 4) THEN s.stanumbers1 + WHEN (s.stakind2 = 4) THEN s.stanumbers2 + WHEN (s.stakind3 = 4) THEN s.stanumbers3 + WHEN (s.stakind4 = 4) THEN s.stanumbers4 + WHEN (s.stakind5 = 4) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_elem_freqs, + CASE + WHEN (s.stakind1 = 5) THEN s.stanumbers1 + WHEN (s.stakind2 = 5) THEN s.stanumbers2 + WHEN (s.stakind3 = 5) THEN s.stanumbers3 + WHEN (s.stakind4 = 5) THEN s.stanumbers4 + WHEN (s.stakind5 = 5) THEN s.stanumbers5 + ELSE NULL::real[] + END AS elem_count_histogram + FROM ((pg_class c + JOIN pg_attribute a ON ((c.oid = a.attrelid))) + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_statistics(c.oid, (a.attnum)::integer, ''::text) s(starelid, staattnum, stainherit, stanullfrac, stawidth, stadistinct, stakind1, stakind2, stakind3, stakind4, stakind5, staop1, staop2, staop3, staop4, staop5, stacoll1, stacoll2, stacoll3, stacoll4, stacoll5, stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5, stavalues1, stavalues2, stavalues3, stavalues4, stavalues5) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND (NOT a.attisdropped) AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); pg_hba_file_rules| SELECT a.line_number, a.type, a.database, diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index d33a4e1..643afe4 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -121,3 +121,10 @@ test: fast_default # run stats by itself because its delay may be insufficient under heavy load test: stats + +# global temp table test +test: gtt_stats +test: gtt_function +test: gtt_prepare +test: gtt_parallel_1 gtt_parallel_2 +test: gtt_clean diff --git a/src/test/regress/sql/gtt_clean.sql b/src/test/regress/sql/gtt_clean.sql new file mode 100644 index 0000000..f3cf710 --- /dev/null +++ b/src/test/regress/sql/gtt_clean.sql @@ -0,0 +1,6 @@ + + +reset search_path; + +drop schema gtt cascade; + diff --git a/src/test/regress/sql/gtt_function.sql b/src/test/regress/sql/gtt_function.sql new file mode 100644 index 0000000..cfc1879 --- /dev/null +++ b/src/test/regress/sql/gtt_function.sql @@ -0,0 +1,163 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_function; + +set search_path=gtt_function,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt_test_rename(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); + +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; + +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); + +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); + +-- ERROR +cluster gtt1 using gtt1_pkey; + +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; + +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); + +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); + +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; +commit; + +select count(*) from p_table01; + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; + +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; + +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; + +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; + +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); + +--ok +alter table gtt_test_rename rename to gtt_test; + +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); + +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; + +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; +truncate gtt_seq; +select * from gtt_seq order by id; +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; + +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +create index idx_err on gtt1 using gist (a); +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); + +reset search_path; + +drop schema gtt_function cascade; + diff --git a/src/test/regress/sql/gtt_parallel_1.sql b/src/test/regress/sql/gtt_parallel_1.sql new file mode 100644 index 0000000..d7d81de --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_1.sql @@ -0,0 +1,42 @@ + + +set search_path=gtt,sys; + +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +commit; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +rollback; +select * from gtt1 order by a; + +truncate gtt1; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +select * from gtt1 order by a; +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + +begin; +select * from gtt1 order by a; +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +commit; +select * from gtt1 order by a; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_parallel_2.sql b/src/test/regress/sql/gtt_parallel_2.sql new file mode 100644 index 0000000..5203c2b --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_2.sql @@ -0,0 +1,76 @@ + + +set search_path=gtt,sys; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; +commit; +select * from gtt3 order by a; + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +truncate gtt3; +select * from gtt3 order by a; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; +truncate gtt3; +select * from gtt3 order by a; +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +begin; +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_prepare.sql b/src/test/regress/sql/gtt_prepare.sql new file mode 100644 index 0000000..2f4d883 --- /dev/null +++ b/src/test/regress/sql/gtt_prepare.sql @@ -0,0 +1,16 @@ + +CREATE SCHEMA IF NOT EXISTS gtt; + +set search_path=gtt,sys; + +create global temp table gtt1(a int primary key, b text) on commit delete rows; + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text); + +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; + diff --git a/src/test/regress/sql/gtt_stats.sql b/src/test/regress/sql/gtt_stats.sql new file mode 100644 index 0000000..f041892 --- /dev/null +++ b/src/test/regress/sql/gtt_stats.sql @@ -0,0 +1,42 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_stats; + +set search_path=gtt_stats,sys; + +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +insert into gtt values(generate_series(1,10000),'test'); + +-- expect 1 +select count(*) from pg_gtt_attached_pids; + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +-- expect 0 +select * from pg_gtt_stats order by tablename; + +analyze gtt; + +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +select * from pg_gtt_stats order by tablename; + +reset search_path; + +drop schema gtt_stats cascade; + ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-23 17:21 Pavel Stehule <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 1 sibling, 0 replies; 1038+ messages in thread From: Pavel Stehule @ 2020-01-23 17:21 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Erik Rijkers <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> čt 23. 1. 2020 v 17:28 odesílatel 曾文旌(义从) <[email protected]> napsal: > > > 2020年1月22日 下午1:29,曾文旌(义从) <[email protected]> 写道: > > > > 2020年1月21日 下午1:43,Pavel Stehule <[email protected]> 写道: > > Hi > > I have a free time this evening, so I will check this patch > > I have a one question > > + /* global temp table get relstats from localhash */ > + if (RELATION_IS_GLOBAL_TEMP(rel)) > + { > + get_gtt_relstats(RelationGetRelid(rel), > + &relpages, &reltuples, &relallvisible, > + NULL, NULL); > + } > + else > + { > + /* coerce values in pg_class to more desirable types */ > + relpages = (BlockNumber) rel->rd_rel->relpages; > + reltuples = (double) rel->rd_rel->reltuples; > + relallvisible = (BlockNumber) rel->rd_rel->relallvisible; > + } > > Isbn't possible to fill the rd_rel structure too, so this branching can be > reduced? > > I'll make some improvements to optimize this part of the code. > > I'm trying to improve this part of the implementation in > global_temporary_table_v7-pg13.patch > Please check my patch and give me feedback. > > It is looking better, still there are some strange things (I didn't tested functionality yet) elog(ERROR, "invalid relpersistence: %c", relation->rd_rel->relpersistence); @@ -3313,6 +3336,10 @@ RelationBuildLocalRelation(const char *relname, rel->rd_backend = BackendIdForTempRelations(); rel->rd_islocaltemp = true; break; + case RELPERSISTENCE_GLOBAL_TEMP: + rel->rd_backend = BackendIdForTempRelations(); + rel->rd_islocaltemp = true; + break; default: + rel->rd_islocaltemp = true; <<<<<<< if this is valid, then the name of field "rd_islocaltemp" is not probably best regards Pavel > > Thanks > > Wenjing > > > > > > Regards > > Pavel > > po 20. 1. 2020 v 17:27 odesílatel 曾文旌(义从) <[email protected]> > napsal: > >> >> >> > 2020年1月20日 上午1:32,Erik Rijkers <[email protected]> 写道: >> > >> > On 2020-01-19 18:04, 曾文旌(义从) wrote: >> >>> 2020年1月14日 下午9:20,Pavel Stehule <[email protected]> 写道: >> >>> út 14. 1. 2020 v 14:09 odesílatel 曾文旌(义从) < >> [email protected] <mailto:[email protected]>> napsal: >> > >> >>> [global_temporary_table_v4-pg13.patch ] >> > >> > Hi, >> > >> > This patch doesn't quiet apply for me: >> > >> > patching file src/backend/access/common/reloptions.c >> > patching file src/backend/access/gist/gistutil.c >> > patching file src/backend/access/hash/hash.c >> > Hunk #1 succeeded at 149 (offset 3 lines). >> > patching file src/backend/access/heap/heapam_handler.c >> > patching file src/backend/access/heap/vacuumlazy.c >> > patching file src/backend/access/nbtree/nbtpage.c >> > patching file src/backend/access/table/tableam.c >> > patching file src/backend/access/transam/xlog.c >> > patching file src/backend/catalog/Makefile >> > Hunk #1 FAILED at 44. >> > 1 out of 1 hunk FAILED -- saving rejects to file >> src/backend/catalog/Makefile.rej >> > [...] >> > (The rest applies without errors) >> > >> > src/backend/catalog/Makefile.rej contains: >> > >> > ------------------------ >> > --- src/backend/catalog/Makefile >> > +++ src/backend/catalog/Makefile >> > @@ -44,6 +44,8 @@ OBJS = \ >> > storage.o \ >> > toasting.o >> > >> > +OBJS += storage_gtt.o >> > + >> > BKIFILES = postgres.bki postgres.description postgres.shdescription >> > >> > include $(top_srcdir)/src/backend/common.mk >> > ------------------------ >> > >> > Can you have a look? >> I updated the code and remade the patch. >> Please give me feedback if you have any more questions. >> >> >> >> >> > >> > >> > thanks, >> > >> > Erik Rijkers >> > >> > >> > >> > >> > >> >> > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-23 20:47 Robert Haas <[email protected]> parent: Tomas Vondra <[email protected]> 1 sibling, 2 replies; 1038+ messages in thread From: Robert Haas @ 2020-01-23 20:47 UTC (permalink / raw) To: Tomas Vondra <[email protected]>; +Cc: Konstantin Knizhnik <[email protected]>; 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Sat, Jan 11, 2020 at 8:51 PM Tomas Vondra <[email protected]> wrote: > I proposed just ignoring those new indexes because it seems much simpler > than alternative solutions that I can think of, and it's not like those > other solutions don't have other issues. +1. > For example, I've looked at the "on demand" building as implemented in > global_private_temp-8.patch, I kinda doubt adding a bunch of index build > calls into various places in index code seems somewht suspicious. +1. I can't imagine that's a safe or sane thing to do. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-24 08:20 Konstantin Knizhnik <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-24 08:20 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; +Cc: Erik Rijkers <[email protected]>; Tomas Vondra <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 23.01.2020 19:28, 曾文旌(义从) wrote: > > I'm trying to improve this part of the implementation in > global_temporary_table_v7-pg13.patch > Please check my patch and give me feedback. > > > Thanks > > Wenjing > > Below is my short review of the patch: + /* + * For global temp table only + * use AccessExclusiveLock for ensure safety + */ + { + { + "on_commit_delete_rows", + "global temp table on commit options", + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, + ShareUpdateExclusiveLock + }, + true + }, The comment seems to be confusing: it says about AccessExclusiveLock but actually uses ShareUpdateExclusiveLock. - Assert(TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); - Assert(MultiXactIdIsValid(onerel->rd_rel->relminmxid)); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relfrozenxid == InvalidTransactionId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && TransactionIdIsNormal(onerel->rd_rel->relfrozenxid))); + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relminmxid == InvalidMultiXactId) || + (!RELATION_IS_GLOBAL_TEMP(onerel) && MultiXactIdIsValid(onerel->rd_rel->relminmxid))); It is actually equivalent to: Assert(RELATION_IS_GLOBAL_TEMP(onerel) ^ TransactionIdIsNormal(onerel->rd_rel->relfrozenxid); Assert(RELATION_IS_GLOBAL_TEMP(onerel) ^ MultiXactIdIsValid(onerel->rd_rel->relminmxid)); + /* clean temp relation files */ + if (max_active_gtt > 0) + RemovePgTempFiles(); + /* I wonder why do we need some special check for GTT here. From my point of view cleanup at startup of local storage of temp tables should be performed in the same way for local and global temp tables. - new_rel_reltup->relfrozenxid = relfrozenxid; - new_rel_reltup->relminmxid = relminmxid; + /* global temp table not remember transaction info in catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + new_rel_reltup->relfrozenxid = InvalidTransactionId; + new_rel_reltup->relminmxid = InvalidMultiXactId; + } + else + { + new_rel_reltup->relfrozenxid = relfrozenxid; + new_rel_reltup->relminmxid = relminmxid; + } + Why do we need to do it for GTT? Did you check that there will be no problems with GTT in case of XID wraparound? Right now if you create temp table and keep session open, then it will block XID wraparound. + /* We allow to drop global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not drop relation when other backend attached this global temp table"); + } + Here we once again introduce incompatibility with normal (permanent) tables. Assume that DBA or programmer need to change format of GTT. But there are some active sessions which have used this GTT sometime in the past. We will not be able to drop this GTT until all this sessions are terminated. I do not think that it is acceptable behaviour. + LOCKMODE lockmode = AccessExclusiveLock; + + /* truncate global temp table only need RowExclusiveLock */ + if (get_rel_persistence(rid) == RELPERSISTENCE_GLOBAL_TEMP) + lockmode = RowExclusiveLock; What are the reasons of using RowExclusiveLock for GTT instead of AccessExclusiveLock? Yes, GTT data is access only by one backend so no locking here seems to be needed at all. But I wonder what are the motivations/benefits of using weaker lock level here? There should be no conflicts in any case... + /* We allow to create index on global temp table only this session use it */ + if (is_other_backend_use_gtt(heapRelation->rd_node)) + elog(ERROR, "can not create index when have other backend attached this global temp table"); + The same argument as in case of dropping GTT: I do not think that prohibiting DLL operations on GTT used by more than one backend is bad idea. + /* global temp table not support foreign key constraint yet */ + if (RELATION_IS_GLOBAL_TEMP(pkrel)) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("referenced relation \"%s\" is not a global temp table", + RelationGetRelationName(pkrel)))); + Why do we need to prohibit foreign key constraint on GTT? + /* + * Global temp table get frozenxid from MyProc + * to avoid the vacuum truncate clog that gtt need. + */ + if (max_active_gtt > 0) + { + TransactionId oldest_gtt_frozenxid = + list_all_session_gtt_frozenxids(0, NULL, NULL, NULL); + + if (TransactionIdIsNormal(oldest_gtt_frozenxid) && + TransactionIdPrecedes(oldest_gtt_frozenxid, newFrozenXid)) + { + ereport(WARNING, + (errmsg("global temp table oldest FrozenXid is far in the past"), + errhint("please truncate them or kill those sessions that use them."))); + newFrozenXid = oldest_gtt_frozenxid; + } + } + As far as I understand, content of GTT will never be processes by autovacuum. So who will update frozenxid of GTT? I see that up_gtt_relstats is invoked when: - index is created on GTT - GTT is truncated - GTT is vacuumed So unless GTT is explicitly vacuumed by user, its GTT is and them will not be taken in account when computing new frozen xid value. Autovacumm will produce this warnings (which will ton be visible by end user and only appended to the log). And at some moment of time wrap around happen and if there still some old active GTT, we will get incorrect results. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-24 08:39 Konstantin Knizhnik <[email protected]> parent: Robert Haas <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-24 08:39 UTC (permalink / raw) To: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; +Cc: 曾文旌(义从) <[email protected]>; Pavel Stehule <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 23.01.2020 23:47, Robert Haas wrote: > On Sat, Jan 11, 2020 at 8:51 PM Tomas Vondra > <[email protected]> wrote: >> I proposed just ignoring those new indexes because it seems much simpler >> than alternative solutions that I can think of, and it's not like those >> other solutions don't have other issues. > +1. > >> For example, I've looked at the "on demand" building as implemented in >> global_private_temp-8.patch, I kinda doubt adding a bunch of index build >> calls into various places in index code seems somewht suspicious. > +1. I can't imagine that's a safe or sane thing to do. > As far as you know there are two versions of GTT implementations now. And we are going to merge them into single patch. But there are some principle question concerning provided functionality which has to be be discussed: should we prohibit DDL on GTT if there are more than one sessions using it. It includes creation/dropping indexes, dropping table, altering table... If the answer is "yes", then the question whether to populate new indexes with data is no relevant at all, because such situation will not be possible. But in this case we will get incompatible behavior with normal (permanent) tables and it seems to be very inconvenient from DBA point of view: it will be necessary to enforce all clients to close their sessions to perform some DDL manipulations with GTT. Some DDLs will be very difficult to implement if GTT is used by more than one backend, for example altering table schema. My current solution is to allow creation/droping index on GTT and dropping table itself, while prohibit alter schema at all for GTT. Wenjing's approach is to prohibit any DDL if GTT is used by more than one backend. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-24 09:09 Pavel Stehule <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-24 09:09 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> pá 24. 1. 2020 v 9:39 odesílatel Konstantin Knizhnik < [email protected]> napsal: > > > On 23.01.2020 23:47, Robert Haas wrote: > > On Sat, Jan 11, 2020 at 8:51 PM Tomas Vondra > > <[email protected]> wrote: > >> I proposed just ignoring those new indexes because it seems much simpler > >> than alternative solutions that I can think of, and it's not like those > >> other solutions don't have other issues. > > +1. > > > >> For example, I've looked at the "on demand" building as implemented in > >> global_private_temp-8.patch, I kinda doubt adding a bunch of index build > >> calls into various places in index code seems somewht suspicious. > > +1. I can't imagine that's a safe or sane thing to do. > > > > As far as you know there are two versions of GTT implementations now. > And we are going to merge them into single patch. > But there are some principle question concerning provided functionality > which has to be be discussed: > should we prohibit DDL on GTT if there are more than one sessions using > it. It includes creation/dropping indexes, dropping table, altering > table... > > If the answer is "yes", then the question whether to populate new > indexes with data is no relevant at all, because such situation will not > be possible. > But in this case we will get incompatible behavior with normal > (permanent) tables and it seems to be very inconvenient from DBA point > of view: > it will be necessary to enforce all clients to close their sessions to > perform some DDL manipulations with GTT. > Some DDLs will be very difficult to implement if GTT is used by more > than one backend, for example altering table schema. > > My current solution is to allow creation/droping index on GTT and > dropping table itself, while prohibit alter schema at all for GTT. > Wenjing's approach is to prohibit any DDL if GTT is used by more than > one backend. > When I create index on GTT in one session, then I don't expect creating same index in all other sessions that uses same GTT. But I can imagine to creating index on GTT enforces index in current session, and for other sessions this index will be invalid to end of session. Regards Pavel > > -- > Konstantin Knizhnik > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-24 09:43 Konstantin Knizhnik <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-24 09:43 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 24.01.2020 12:09, Pavel Stehule wrote: > > > pá 24. 1. 2020 v 9:39 odesílatel Konstantin Knizhnik > <[email protected] <mailto:[email protected]>> napsal: > > > > On 23.01.2020 23:47, Robert Haas wrote: > > On Sat, Jan 11, 2020 at 8:51 PM Tomas Vondra > > <[email protected] > <mailto:[email protected]>> wrote: > >> I proposed just ignoring those new indexes because it seems > much simpler > >> than alternative solutions that I can think of, and it's not > like those > >> other solutions don't have other issues. > > +1. > > > >> For example, I've looked at the "on demand" building as > implemented in > >> global_private_temp-8.patch, I kinda doubt adding a bunch of > index build > >> calls into various places in index code seems somewht suspicious. > > +1. I can't imagine that's a safe or sane thing to do. > > > > As far as you know there are two versions of GTT implementations now. > And we are going to merge them into single patch. > But there are some principle question concerning provided > functionality > which has to be be discussed: > should we prohibit DDL on GTT if there are more than one sessions > using > it. It includes creation/dropping indexes, dropping table, > altering table... > > If the answer is "yes", then the question whether to populate new > indexes with data is no relevant at all, because such situation > will not > be possible. > But in this case we will get incompatible behavior with normal > (permanent) tables and it seems to be very inconvenient from DBA > point > of view: > it will be necessary to enforce all clients to close their > sessions to > perform some DDL manipulations with GTT. > Some DDLs will be very difficult to implement if GTT is used by more > than one backend, for example altering table schema. > > My current solution is to allow creation/droping index on GTT and > dropping table itself, while prohibit alter schema at all for GTT. > Wenjing's approach is to prohibit any DDL if GTT is used by more than > one backend. > > > When I create index on GTT in one session, then I don't expect > creating same index in all other sessions that uses same GTT. > > But I can imagine to creating index on GTT enforces index in current > session, and for other sessions this index will be invalid to end of > session. So there are three possible alternatives: 1. Prohibit index creation of GTT when it used by more than once session. 2. Create index and populate them with data in all sessions using this GTT. 3. Create index only in current session and do not allow to use it in all other sessions already using this GTT (but definitely allow to use it in new sessions). 1 is Wenjing's approach, 2 - is my approach, 3 - is your suggestion :) I can construct the following table with pro/cons of each approach: Approach Compatibility with normal table User (DBA) friendly Complexity of implementation Consistency 1 - 1: requires restart of all sessions to perform operation 2: requires global cache of GTT 3/: /no man, no problem 2 + 3: if index is created then it is actually needed, isn't it? 1: use existed functionality to create index 2: if alter schema is prohibited 3 - 2: requires restart of all sessions to use created index 3: requires some mechanism for prohibiting index created after first session access to GTT 1: can perform DDL but do no see effect of it -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-24 12:15 Pavel Stehule <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-24 12:15 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> pá 24. 1. 2020 v 10:43 odesílatel Konstantin Knizhnik < [email protected]> napsal: > > > On 24.01.2020 12:09, Pavel Stehule wrote: > > > > pá 24. 1. 2020 v 9:39 odesílatel Konstantin Knizhnik < > [email protected]> napsal: > >> >> >> On 23.01.2020 23:47, Robert Haas wrote: >> > On Sat, Jan 11, 2020 at 8:51 PM Tomas Vondra >> > <[email protected]> wrote: >> >> I proposed just ignoring those new indexes because it seems much >> simpler >> >> than alternative solutions that I can think of, and it's not like those >> >> other solutions don't have other issues. >> > +1. >> > >> >> For example, I've looked at the "on demand" building as implemented in >> >> global_private_temp-8.patch, I kinda doubt adding a bunch of index >> build >> >> calls into various places in index code seems somewht suspicious. >> > +1. I can't imagine that's a safe or sane thing to do. >> > >> >> As far as you know there are two versions of GTT implementations now. >> And we are going to merge them into single patch. >> But there are some principle question concerning provided functionality >> which has to be be discussed: >> should we prohibit DDL on GTT if there are more than one sessions using >> it. It includes creation/dropping indexes, dropping table, altering >> table... >> >> If the answer is "yes", then the question whether to populate new >> indexes with data is no relevant at all, because such situation will not >> be possible. >> But in this case we will get incompatible behavior with normal >> (permanent) tables and it seems to be very inconvenient from DBA point >> of view: >> it will be necessary to enforce all clients to close their sessions to >> perform some DDL manipulations with GTT. >> Some DDLs will be very difficult to implement if GTT is used by more >> than one backend, for example altering table schema. >> >> My current solution is to allow creation/droping index on GTT and >> dropping table itself, while prohibit alter schema at all for GTT. >> Wenjing's approach is to prohibit any DDL if GTT is used by more than >> one backend. >> > > When I create index on GTT in one session, then I don't expect creating > same index in all other sessions that uses same GTT. > > But I can imagine to creating index on GTT enforces index in current > session, and for other sessions this index will be invalid to end of > session. > > > So there are three possible alternatives: > > 1. Prohibit index creation of GTT when it used by more than once session. > 2. Create index and populate them with data in all sessions using this GTT. > 3. Create index only in current session and do not allow to use it in all > other sessions already using this GTT (but definitely allow to use it in > new sessions). > > 1 is Wenjing's approach, 2 - is my approach, 3 - is your suggestion :) > > I can construct the following table with pro/cons of each approach: > > Approach > Compatibility with normal table > User (DBA) friendly > Complexity of implementation > Consistency > 1 > - > 1: requires restart of all sessions to perform operation > 2: requires global cache of GTT > 3*: *no man, no problem > 2 > + > 3: if index is created then it is actually needed, isn't it? 1: use > existed functionality to create index > 2: if alter schema is prohibited > 3 > - > 2: requires restart of all sessions to use created index > 3: requires some mechanism for prohibiting index created after first > session access to GTT > 1: can perform DDL but do no see effect of it > > You will see a effect of DDL in current session (where you did the change), all other sessions should to live without any any change do reconnect or to RESET connect I don't like 2 - when I do index on global temp table, I don't would to wait on indexing on all other sessions. These operations should be maximally independent. Regards Pavel > > > -- > Konstantin Knizhnik > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-24 13:17 Konstantin Knizhnik <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-24 13:17 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 24.01.2020 15:15, Pavel Stehule wrote: > You will see a effect of DDL in current session (where you did the > change), all other sessions should to live without any any change do > reconnect or to RESET connect > Why? I found this requirement quit unnatural and contradicting to the behavior of normal tables. Actually one of motivation for adding global tempo tables to Postgres is to provide compatibility with Oracle. Although I know that Oracle design decisions were never considered as axioms by Postgres community, but ni case of GTT design I think that we should take in account Oracle approach. And GTT in Oracle behaves exactly as in my implementation: https://www.oracletutorial.com/oracle-basics/oracle-global-temporary-table/ It is not clear from this documentation whether index created for GTT in one session can be used in another session which already has some data in this GTT. But I did experiment with install Oracle server and can confirm that actually works in this way. So I do not understand why do we need to complicate our GTT implementation in order to prohibit useful functionality and introduce inconsistency between behavior of normal and global temp tables. > I don't like 2 - when I do index on global temp table, I don't would > to wait on indexing on all other sessions. These operations should be > maximally independent. > Nobody suggest to wait building index in all sessions. Indexes will be constructed on demand when session access this table. If session will no access this table at all, then index will never be constructed. Once again: logic of dealing with indexes in GTT is very simple. For normal tables, indexes are initialized at the tame when them are created. For GTT it is not true. We have to initialize index on demand when it is accessed first time in session. So it has to be handled in any way. The question is only whether we should allow creation of index for table already populated with some data? Actually doesn't require some additional efforts. We can use existed build_index function which initialize index and populates it with data. So the solution proposed for me is most natural, convenient and simplest solution at the same time. And compatible with Oracle. > Regards > > Pavel > > > > -- > Konstantin Knizhnik > Postgres Professional:http://www.postgrespro.com > The Russian Postgres Company > -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-24 19:39 Pavel Stehule <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-24 19:39 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> pá 24. 1. 2020 v 14:17 odesílatel Konstantin Knizhnik < [email protected]> napsal: > > > On 24.01.2020 15:15, Pavel Stehule wrote: > > You will see a effect of DDL in current session (where you did the > change), all other sessions should to live without any any change do > reconnect or to RESET connect > > Why? I found this requirement quit unnatural and contradicting to the > behavior of normal tables. > Actually one of motivation for adding global tempo tables to Postgres is > to provide compatibility with Oracle. > Although I know that Oracle design decisions were never considered as > axioms by Postgres community, > but ni case of GTT design I think that we should take in account Oracle > approach. > And GTT in Oracle behaves exactly as in my implementation: > > https://www.oracletutorial.com/oracle-basics/oracle-global-temporary-table/ > > It is not clear from this documentation whether index created for GTT in > one session can be used in another session which already has some data in > this GTT. > But I did experiment with install Oracle server and can confirm that > actually works in this way. > > So I do not understand why do we need to complicate our GTT implementation > in order to prohibit useful functionality and introduce inconsistency > between behavior of normal and global temp tables. > > > > I don't like 2 - when I do index on global temp table, I don't would to > wait on indexing on all other sessions. These operations should be > maximally independent. > > > Nobody suggest to wait building index in all sessions. > Indexes will be constructed on demand when session access this table. > If session will no access this table at all, then index will never be > constructed. > > Once again: logic of dealing with indexes in GTT is very simple. > For normal tables, indexes are initialized at the tame when them are > created. > For GTT it is not true. We have to initialize index on demand when it is > accessed first time in session. > > So it has to be handled in any way. > The question is only whether we should allow creation of index for table > already populated with some data? > Actually doesn't require some additional efforts. We can use existed > build_index function which initialize index and populates it with data. > So the solution proposed for me is most natural, convenient and simplest > solution at the same time. And compatible with Oracle. > I cannot to evaluate your proposal, and I am sure, so you know more about this code. There is a question if we can allow to build local temp index on global temp table. It is different situation. When I work with global properties personally I prefer total asynchronous implementation of any DDL operations for other than current session. When it is true, then I have not any objection. For me, good enough design of any DDL can be based on catalog change without forcing to living tables. I see following disadvantage of your proposal. See scenario 1. I have two sessions A - small GTT with active owner B - big GTT with some active application. session A will do new index - it is fast, but if creating index is forced on B on demand (when B was touched), then this operation have to wait after index will be created. So I afraid build a index on other sessions on GTT when GTT tables in other sessions will not be empty. Regards Pavel > > > > > Regards > > Pavel > > >> >> >> -- >> Konstantin Knizhnik >> Postgres Professional: http://www.postgrespro.com >> The Russian Postgres Company >> >> > -- > Konstantin Knizhnik > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-25 15:15 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-25 15:15 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Tomas Vondra <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> Thank you for review patch. > 2020年1月24日 下午4:20,Konstantin Knizhnik <[email protected]> 写道: > > > > On 23.01.2020 19:28, 曾文旌(义从) wrote: >> >> I'm trying to improve this part of the implementation in global_temporary_table_v7-pg13.patch >> Please check my patch and give me feedback. >> >> >> Thanks >> >> Wenjing >> >> > > Below is my short review of the patch: > > + /* > + * For global temp table only > + * use AccessExclusiveLock for ensure safety > + */ > + { > + { > + "on_commit_delete_rows", > + "global temp table on commit options", > + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, > + ShareUpdateExclusiveLock > + }, > + true > + }, > > > The comment seems to be confusing: it says about AccessExclusiveLock but actually uses ShareUpdateExclusiveLock. There is a problem with the comment description, I will fix it. > > - Assert(TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); > - Assert(MultiXactIdIsValid(onerel->rd_rel->relminmxid)); > + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relfrozenxid == InvalidTransactionId) || > + (!RELATION_IS_GLOBAL_TEMP(onerel) && TransactionIdIsNormal(onerel->rd_rel->relfrozenxid))); > + Assert((RELATION_IS_GLOBAL_TEMP(onerel) && onerel->rd_rel->relminmxid == InvalidMultiXactId) || > + (!RELATION_IS_GLOBAL_TEMP(onerel) && MultiXactIdIsValid(onerel->rd_rel->relminmxid))); > > It is actually equivalent to: > > Assert(RELATION_IS_GLOBAL_TEMP(onerel) ^ TransactionIdIsNormal(onerel->rd_rel->relfrozenxid); > Assert(RELATION_IS_GLOBAL_TEMP(onerel) ^ MultiXactIdIsValid(onerel->rd_rel->relminmxid)); Yes, Thank you for your points out, It's simpler. > > + /* clean temp relation files */ > + if (max_active_gtt > 0) > + RemovePgTempFiles(); > + > /* > > I wonder why do we need some special check for GTT here. > From my point of view cleanup at startup of local storage of temp tables should be performed in the same way for local and global temp tables. After oom kill, In autovacuum, the Isolated local temp table will be cleaned like orphan temporary tables. The definition of local temp table is deleted with the storage file. But GTT can not do that. So we have the this implementation in my patch. If you have other solutions, please let me know. > > > - new_rel_reltup->relfrozenxid = relfrozenxid; > - new_rel_reltup->relminmxid = relminmxid; > + /* global temp table not remember transaction info in catalog */ > + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) > + { > + new_rel_reltup->relfrozenxid = InvalidTransactionId; > + new_rel_reltup->relminmxid = InvalidMultiXactId; > + } > + else > + { > + new_rel_reltup->relfrozenxid = relfrozenxid; > + new_rel_reltup->relminmxid = relminmxid; > + } > + > > > Why do we need to do it for GTT? > Did you check that there will be no problems with GTT in case of XID wraparound? > Right now if you create temp table and keep session open, then it will block XID wraparound. In my design 1 Because different sessions have different transaction information, I choose to store the transaction information of GTT in MyProc,not catalog. 2 About the XID wraparound problem, the reason is the design of the temp table storage(local temp table and global temp table) that makes it can not to do vacuum by autovacuum. It should be completely solve at the storage level. > > + /* We allow to drop global temp table only this session use it */ > + if (RELATION_IS_GLOBAL_TEMP(rel)) > + { > + if (is_other_backend_use_gtt(rel->rd_node)) > + elog(ERROR, "can not drop relation when other backend attached this global temp table"); > + } > + > > Here we once again introduce incompatibility with normal (permanent) tables. > Assume that DBA or programmer need to change format of GTT. But there are some active sessions which have used this GTT sometime in the past. > We will not be able to drop this GTT until all this sessions are terminated. > I do not think that it is acceptable behaviour. In fact, The dba can still complete the DDL of the GTT. I've provided a set of functions for this case. If the dba needs to modify a GTT A(or drop GTT or create index on GTT), he needs to do: 1 Use the pg_gtt_attached_pids view to list the pids for the session that is using the GTT A. 2 Use pg_terminate_backend(pid)terminate they except itself. 3 Do alter GTT A. > > + LOCKMODE lockmode = AccessExclusiveLock; > + > + /* truncate global temp table only need RowExclusiveLock */ > + if (get_rel_persistence(rid) == RELPERSISTENCE_GLOBAL_TEMP) > + lockmode = RowExclusiveLock; > > > What are the reasons of using RowExclusiveLock for GTT instead of AccessExclusiveLock? > Yes, GTT data is access only by one backend so no locking here seems to be needed at all. > But I wonder what are the motivations/benefits of using weaker lock level here? 1 Truncate GTT deletes only the data in the session, so no need use high-level lock. 2 I think it still needs to be block by DDL of GTT, which is why I use RowExclusiveLock. > There should be no conflicts in any case... > > + /* We allow to create index on global temp table only this session use it */ > + if (is_other_backend_use_gtt(heapRelation->rd_node)) > + elog(ERROR, "can not create index when have other backend attached this global temp table"); > + > > The same argument as in case of dropping GTT: I do not think that prohibiting DLL operations on GTT used by more than one backend is bad idea. The idea was to give the GTT almost all the features of a regular table with few code changes. The current version DBA can still do all DDL for GTT, I've already described. > > + /* global temp table not support foreign key constraint yet */ > + if (RELATION_IS_GLOBAL_TEMP(pkrel)) > + ereport(ERROR, > + (errcode(ERRCODE_WRONG_OBJECT_TYPE), > + errmsg("referenced relation \"%s\" is not a global temp table", > + RelationGetRelationName(pkrel)))); > + > > Why do we need to prohibit foreign key constraint on GTT? It may be possible to support FK on GTT in later versions. Before that, I need to check some code. > > + /* > + * Global temp table get frozenxid from MyProc > + * to avoid the vacuum truncate clog that gtt need. > + */ > + if (max_active_gtt > 0) > + { > + TransactionId oldest_gtt_frozenxid = > + list_all_session_gtt_frozenxids(0, NULL, NULL, NULL); > + > + if (TransactionIdIsNormal(oldest_gtt_frozenxid) && > + TransactionIdPrecedes(oldest_gtt_frozenxid, newFrozenXid)) > + { > + ereport(WARNING, > + (errmsg("global temp table oldest FrozenXid is far in the past"), > + errhint("please truncate them or kill those sessions that use them."))); > + newFrozenXid = oldest_gtt_frozenxid; > + } > + } > + > > As far as I understand, content of GTT will never be processes by autovacuum. > So who will update frozenxid of GTT? > I see that up_gtt_relstats is invoked when: > - index is created on GTT > - GTT is truncated > - GTT is vacuumed > So unless GTT is explicitly vacuumed by user, its GTT is and them will not be taken in account > when computing new frozen xid value. Autovacumm will produce this warnings (which will ton be visible by end user and only appended to the log). > And at some moment of time wrap around happen and if there still some old active GTT, we will get incorrect results. I have already described my point in previous emails. 1. The core problem is that the data contains transaction information (xid), which needs to be vacuum(freeze) regularly to avoid running out of xid. The autovacuum supports vacuum regular table but local temp does not. autovacuum also does not support GTT. 2. However, the difference between the local temp table and the global temp table(GTT) is that a) For local temp table: one table hava one piece of data. the frozenxid of one local temp table is store in the catalog(pg_class). b) For global temp table: each session has a separate copy of data, one GTT may contain maxbackend frozenxid. and I don't think it's a good idea to keep frozenxid of GTT in the catalog(pg_class). It becomes a question: how to handle GTT transaction information? I agree that problem 1 should be completely solved by a some feature, such as local transactions. It is definitely not included in the GTT patch. But, I think we need to ensure the durability of GTT data. For example, data in GTT cannot be lost due to the clog being cleaned up. It belongs to problem 2. For problem 2 If we ignore the frozenxid of GTT, when vacuum truncates the clog that GTT need, the GTT data in some sessions is completely lost. Perhaps we could consider let aotuvacuum terminate those sessions that contain "too old" data, But It's not very friendly, so I didn't choose to implement it in the first version. Maybe you have a better idea. Wenjing > > > > -- > Konstantin Knizhnik > Postgres Professional: http://www.postgrespro.com <http://www.postgrespro.com/; > The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-27 09:11 Konstantin Knizhnik <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 2 replies; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-27 09:11 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 24.01.2020 22:39, Pavel Stehule wrote: > I cannot to evaluate your proposal, and I am sure, so you know more > about this code. > > There is a question if we can allow to build local temp index on > global temp table. It is different situation. When I work with global > properties personally I prefer total asynchronous implementation of > any DDL operations for other than current session. When it is true, > then I have not any objection. For me, good enough design of any DDL > can be based on catalog change without forcing to living tables. > From my point of view there are two difference uses cases of temp tables: 1. Backend needs some private data source which is specific to this session and has no relation with activities of other sessions. 2. We need a table containing private session data, but which is used in the same way by all database users. In the first case current Postgres temp tables works well (if we forget for a moment about all known issues related with temp tables). Global temp tables are used to address the second scenario. Assume that we write some stored procedure or implement some business logic outside database and what to perform some complex analtic query which requires tepmp table for storing intermediate results. In this case we can create GTT with all needed index at the moment of database initialization and do not perform any extra DDL during query execution. If will prevent catalog bloating and makes execution of query more efficient. I do not see any reasons to allow build local indexes for global table. Yes,it can happen that some session will have small amount of data in particular GTT and another - small amount of data in this table. But if access pattern is the same (and nature of GTT assumes it), then index in either appreciate, either useless in both cases. > I see following disadvantage of your proposal. See scenario > > 1. I have two sessions > > A - small GTT with active owner > B - big GTT with some active application. > > session A will do new index - it is fast, but if creating index is > forced on B on demand (when B was touched), then this operation have > to wait after index will be created. > > So I afraid build a index on other sessions on GTT when GTT tables in > other sessions will not be empty. Yes, it is true. But is is not the most realistic scenario from my point of view. As I explained above, GTT should be used when we need temporary storage accessed in the same way by all clients. If (as with normal tables) at some moment of time DBA realizes, that efficient execution of some queries needs extra indexes, then it should be able to do it. It is very inconvenient and unnatural to prohibit DBA to do it until all sessions using this GTT are closed (it may never happen) or require all sessions to restart to be able to use this index. So it is possible to imagine different scenarios of working with GTTs. But from my point of view the only non-contradictory model of their behavior is to make it compatible with normal tables. And do not forget about compatibility with Oracle. Simplifying of porting existed applications from Oracle to Postgres may be the main motivation of adding GTT to Postgres. And making them incompatible with Oracle will be very strange. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-27 09:38 Konstantin Knizhnik <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-27 09:38 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Tomas Vondra <[email protected]>; Robert Haas <[email protected]>; Julien Rouhaud <[email protected]>; Dean Rasheed <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 25.01.2020 18:15, 曾文旌(义从) wrote: > I wonder why do we need some special check for GTT here. >> From my point of view cleanup at startup of local storage of temp >> tables should be performed in the same way for local and global temp >> tables. > After oom kill, In autovacuum, the Isolated local temp table will be > cleaned like orphan temporary tables. The definition of local temp > table is deleted with the storage file. > But GTT can not do that. So we have the this implementation in my patch. > If you have other solutions, please let me know. > I wonder if it is possible that autovacuum or some other Postgres process is killed by OOM and postmaster is not noticing it can doens't restart Postgres instance? as far as I know, crash of any process connected to Postgres shared memory (and autovacuum definitely has such connection) cause Postgres restart. > In my design > 1 Because different sessions have different transaction information, I > choose to store the transaction information of GTT in MyProc,not catalog. > 2 About the XID wraparound problem, the reason is the design of the > temp table storage(local temp table and global temp table) that makes > it can not to do vacuum by autovacuum. > It should be completely solve at the storage level. > My point of view is that vacuuming of temp tables is common problem for local and global temp tables. So it has to be addressed in the common way and so we should not try to fix this problem only for GTT. > In fact, The dba can still complete the DDL of the GTT. > I've provided a set of functions for this case. > If the dba needs to modify a GTT A(or drop GTT or create index on > GTT), he needs to do: > 1 Use the pg_gtt_attached_pids view to list the pids for the session > that is using the GTT A. > 2 Use pg_terminate_backend(pid)terminate they except itself. > 3 Do alter GTT A. > IMHO forced terminated of client sessions is not acceptable solution. And it is not an absolutely necessary requirement. So from my point of view we should not add such limitations to GTT design. >> >> What are the reasons of using RowExclusiveLock for GTT instead of >> AccessExclusiveLock? >> Yes, GTT data is access only by one backend so no locking here seems >> to be needed at all. >> But I wonder what are the motivations/benefits of using weaker lock >> level here? > 1 Truncate GTT deletes only the data in the session, so no need use > high-level lock. > 2 I think it still needs to be block by DDL of GTT, which is why I use > RowExclusiveLock. Sorry, I do not understand your arguments: we do not need exclusive lock because we drop only local (private) data but we need some kind of lock. I agree with 1) and not 2). > >> There should be no conflicts in any case... >> >> + /* We allow to create index on global temp table only this >> session use it */ >> + if (is_other_backend_use_gtt(heapRelation->rd_node)) >> + elog(ERROR, "can not create index when have other >> backend attached this global temp table"); >> + >> >> The same argument as in case of dropping GTT: I do not think that >> prohibiting DLL operations on GTT used by more than one backend is >> bad idea. > The idea was to give the GTT almost all the features of a regular > table with few code changes. > The current version DBA can still do all DDL for GTT, I've already > described. I absolutely agree with you that GTT should be given the same features as regular tables. The irony is that this most natural and convenient behavior is most easy to implement without putting some extra restrictions. Just let indexes for GTT be constructed on demand. It it can be done using the same function used for regular index creation. > >> >> + /* global temp table not support foreign key constraint yet */ >> + if (RELATION_IS_GLOBAL_TEMP(pkrel)) >> + ereport(ERROR, >> + (errcode(ERRCODE_WRONG_OBJECT_TYPE), >> + errmsg("referenced relation \"%s\" is not a global >> temp table", >> + RelationGetRelationName(pkrel)))); >> + >> >> Why do we need to prohibit foreign key constraint on GTT? > It may be possible to support FK on GTT in later versions. Before > that, I need to check some code. Ok, may be approach to prohibit everything except minimally required functionality is safe and reliable. But frankly speaking I prefer different approach: if I do not see any contradictions of new feature with existed operations and it is passing tests, then we should not prohibit this operations for new feature. > I have already described my point in previous emails. > > 1. The core problem is that the data contains transaction information > (xid), which needs to be vacuum(freeze) regularly to avoid running out > of xid. > The autovacuum supports vacuum regular table but local temp does not. > autovacuum also does not support GTT. > > 2. However, the difference between the local temp table and the global > temp table(GTT) is that > a) For local temp table: one table hava one piece of data. the > frozenxid of one local temp table is store in the catalog(pg_class). > b) For global temp table: each session has a separate copy of data, > one GTT may contain maxbackend frozenxid. > and I don't think it's a good idea to keep frozenxid of GTT in the > catalog(pg_class). > It becomes a question: how to handle GTT transaction information? > > I agree that problem 1 should be completely solved by a some feature, > such as local transactions. It is definitely not included in the GTT > patch. > But, I think we need to ensure the durability of GTT data. For > example, data in GTT cannot be lost due to the clog being cleaned up. > It belongs to problem 2. > > For problem 2 > If we ignore the frozenxid of GTT, when vacuum truncates the clog that > GTT need, the GTT data in some sessions is completely lost. > Perhaps we could consider let aotuvacuum terminate those sessions that > contain "too old" data, > But It's not very friendly, so I didn't choose to implement it in the > first version. > Maybe you have a better idea. Sorry, I do not have better idea. I prefer not to address this problem in first version of the patch at all. fozen_xid of temp table is never changed unless user explicitly invoke vacuum on it. I do not think that anybody is doing it (because it accentually contains temporary data which is not expected to live long time. Certainly it is possible to imagine situation when session use GTT to store some local data which is valid during all session life time (which can be large enough). But I am not sure that it is popular scenario. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-27 19:44 Pavel Stehule <[email protected]> parent: Konstantin Knizhnik <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-27 19:44 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> po 27. 1. 2020 v 10:11 odesílatel Konstantin Knizhnik < [email protected]> napsal: > > > On 24.01.2020 22:39, Pavel Stehule wrote: > > I cannot to evaluate your proposal, and I am sure, so you know more about > this code. > > There is a question if we can allow to build local temp index on global > temp table. It is different situation. When I work with global properties > personally I prefer total asynchronous implementation of any DDL operations > for other than current session. When it is true, then I have not any > objection. For me, good enough design of any DDL can be based on catalog > change without forcing to living tables. > > > From my point of view there are two difference uses cases of temp tables: > 1. Backend needs some private data source which is specific to this > session and has no relation with activities of other sessions. > 2. We need a table containing private session data, but which is used in > the same way by all database users. > > In the first case current Postgres temp tables works well (if we forget > for a moment about all known issues related with temp tables). > Global temp tables are used to address the second scenario. Assume that > we write some stored procedure or implement some business logic outside > database and > what to perform some complex analtic query which requires tepmp table for > storing intermediate results. In this case we can create GTT with all > needed index at the moment of database initialization > and do not perform any extra DDL during query execution. If will prevent > catalog bloating and makes execution of query more efficient. > > I do not see any reasons to allow build local indexes for global table. > Yes,it can happen that some session will have small amount of data in > particular GTT and another - small amount of data in this table. But if > access pattern is the same (and nature of GTT assumes it), then index in > either appreciate, either useless in both cases. > > > > > I see following disadvantage of your proposal. See scenario > > 1. I have two sessions > > A - small GTT with active owner > B - big GTT with some active application. > > session A will do new index - it is fast, but if creating index is forced > on B on demand (when B was touched), then this operation have to wait after > index will be created. > > So I afraid build a index on other sessions on GTT when GTT tables in > other sessions will not be empty. > > > > Yes, it is true. But is is not the most realistic scenario from my point > of view. > As I explained above, GTT should be used when we need temporary storage > accessed in the same way by all clients. > If (as with normal tables) at some moment of time DBA realizes, that > efficient execution of some queries needs extra indexes, > then it should be able to do it. It is very inconvenient and unnatural to > prohibit DBA to do it until all sessions using this GTT are closed (it may > never happen) > or require all sessions to restart to be able to use this index. > > So it is possible to imagine different scenarios of working with GTTs. > But from my point of view the only non-contradictory model of their > behavior is to make it compatible with normal tables. > And do not forget about compatibility with Oracle. Simplifying of porting > existed applications from Oracle to Postgres may be the > main motivation of adding GTT to Postgres. And making them incompatible > with Oracle will be very strange. > I don't think so compatibility with Oracle is valid point in this case. We need GTT, but the mechanism of index building should be designed for Postgres, and for users. Maybe the method proposed by you can be activated by some option like CREATE INDEX IMMEDIATELY FOR ALL SESSION. When you use GTT without index, then it should to work some time more, and if you use short life sessions, then index build can be last or almost last operation over table and can be suboptimal. Anyway, this behave can be changed later without bigger complications - and now I am have strong opinion to prefer don't allow to any DDL (with index creation) on any active GTT in other sessions. Probably your proposal - build indexes on other sessions when GTT is touched can share code with just modify metadata and wait on session reset or GTT reset Usually it is not hard problem to refresh sessions, and what I know when you update plpgsql code, it is best practice to refresh session early. > > -- > Konstantin Knizhnik > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-28 16:01 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Robert Haas <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-28 16:01 UTC (permalink / raw) To: Robert Haas <[email protected]>; Pavel Stehule <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; +Cc: pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月24日 上午4:47,Robert Haas <[email protected]> 写道: > > On Sat, Jan 11, 2020 at 8:51 PM Tomas Vondra > <[email protected]> wrote: >> I proposed just ignoring those new indexes because it seems much simpler >> than alternative solutions that I can think of, and it's not like those >> other solutions don't have other issues. > > +1. I complete the implementation of this feature. When a session x create an index idx_a on GTT A then For session x, idx_a is valid when after create index. For session y, before session x create index done, GTT A has some data, then index_a is invalid. For session z, before session x create index done, GTT A has no data, then index_a is valid. > >> For example, I've looked at the "on demand" building as implemented in >> global_private_temp-8.patch, I kinda doubt adding a bunch of index build >> calls into various places in index code seems somewht suspicious. > > +1. I can't imagine that's a safe or sane thing to do. > > -- > Robert Haas > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company Opinion by Pavel + rel->rd_islocaltemp = true; <<<<<<< if this is valid, then the name of field "rd_islocaltemp" is not probably best I renamed rd_islocaltemp Opinion by Konstantin Knizhnik 1 Fixed comments 2 Fixed assertion Please help me review. Wenjing Attachments: [application/octet-stream] global_temporary_table_v8-pg13.patch (153.9K, ../../[email protected]/3-global_temporary_table_v8-pg13.patch) download | inline diff: diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 79430d2..babb5f3 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -158,6 +158,19 @@ static relopt_bool boolRelOpts[] = }, true }, + /* + * For global temp table only + * use ShareUpdateExclusiveLock for ensure safety + */ + { + { + "on_commit_delete_rows", + "global temp table on commit options", + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, + ShareUpdateExclusiveLock + }, + true + }, /* list terminator */ {{NULL}} }; @@ -1486,6 +1499,8 @@ bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind) { static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)}, {"fillfactor", RELOPT_TYPE_INT, offsetof(StdRdOptions, fillfactor)}, {"autovacuum_enabled", RELOPT_TYPE_BOOL, offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, enabled)}, @@ -1586,13 +1601,18 @@ build_reloptions(Datum reloptions, bool validate, bytea * partitioned_table_reloptions(Datum reloptions, bool validate) { + static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)} + }; + /* * There are no options for partitioned tables yet, but this is able to do * some validation. */ return (bytea *) build_reloptions(reloptions, validate, RELOPT_KIND_PARTITIONED, - 0, NULL, 0); + sizeof(StdRdOptions), tab, lengthof(tab)); } /* diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index dd975b1..1610e7d 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -1013,7 +1013,9 @@ gistGetFakeLSN(Relation rel) { static XLogRecPtr counter = FirstNormalUnloggedLSN; - if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + /* global temp is same as local temp table */ + if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + rel->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { /* * Temporary relations are only accessible in our session, so a simple diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 4871b7f..16b00c9 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -149,7 +149,9 @@ hashbuild(Relation heap, Relation index, IndexInfo *indexInfo) * metapage, nor the first bitmap page. */ sort_threshold = (maintenance_work_mem * 1024L) / BLCKSZ; - if (index->rd_rel->relpersistence != RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + if (!(index->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + index->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) sort_threshold = Min(sort_threshold, NBuffers); else sort_threshold = Min(sort_threshold, NLocBuffer); diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index 3fa4b76..b54882d 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -598,7 +598,7 @@ heapam_relation_set_new_filenode(Relation rel, */ *minmulti = GetOldestMultiXactId(); - srel = RelationCreateStorage(*newrnode, persistence); + srel = RelationCreateStorage(*newrnode, persistence, rel); /* * If required, set up an init fork for an unlogged table so that it can @@ -651,7 +651,7 @@ heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index 8ce5011..0d6ae76 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -62,6 +62,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/dbcommands.h" #include "commands/progress.h" #include "commands/vacuum.h" @@ -399,9 +400,9 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, Assert(params->index_cleanup != VACOPT_TERNARY_DEFAULT); Assert(params->truncate != VACOPT_TERNARY_DEFAULT); - /* not every AM requires these to be valid, but heap does */ - Assert(TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); - Assert(MultiXactIdIsValid(onerel->rd_rel->relminmxid)); + /* not every AM requires these to be valid, but regular heap does */ + Assert(RELATION_IS_GLOBAL_TEMP(onerel) ^ TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); + Assert(RELATION_IS_GLOBAL_TEMP(onerel) ^ MultiXactIdIsValid(onerel->rd_rel->relminmxid)); /* measure elapsed time iff autovacuum logging requires it */ if (IsAutoVacuumWorkerProcess() && params->log_min_duration >= 0) diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index f05cbe7..946c9d2 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -763,7 +763,14 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access) /* Read an existing block of the relation */ buf = ReadBuffer(rel, blkno); LockBuffer(buf, access); - _bt_checkpage(rel, buf); + + /* global temp table may be not yet initialized for this backend. */ + if (RELATION_IS_GLOBAL_TEMP(rel) && + blkno == BTREE_METAPAGE && + PageIsNew(BufferGetPage(buf))) + _bt_initmetapage(BufferGetPage(buf), P_NONE, 0); + else + _bt_checkpage(rel, buf); } else { diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 6e09ded..a2059fa 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6325,6 +6325,10 @@ StartupXLOG(void) else recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID; + /* clean temp relation files */ + if (max_active_gtt > 0) + RemovePgTempFiles(); + /* * Check for signal files, and if so set up state for offline recovery */ diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index d5da81c..c753b0e 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -42,6 +42,7 @@ OBJS = \ pg_subscription.o \ pg_type.o \ storage.o \ + storage_gtt.o \ toasting.o include $(top_srcdir)/src/backend/common.mk diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c index 16cb6d8..f28f2c2 100644 --- a/src/backend/catalog/catalog.c +++ b/src/backend/catalog/catalog.c @@ -398,7 +398,9 @@ GetNewRelFileNode(Oid reltablespace, Relation pg_class, char relpersistence) switch (relpersistence) { + /* global temp table is same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); break; case RELPERSISTENCE_UNLOGGED: diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 0fdff29..210d019 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -61,6 +61,7 @@ #include "catalog/pg_type.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "commands/tablecmds.h" #include "commands/typecmds.h" #include "executor/executor.h" @@ -99,6 +100,7 @@ static void AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -404,6 +406,10 @@ heap_create(const char *relname, relpersistence, relkind); + /* global temp table not create storage file when catalog create */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + create_storage = false; + /* * Have the storage manager create the relation's disk file, if needed. * @@ -427,7 +433,7 @@ heap_create(const char *relname, case RELKIND_INDEX: case RELKIND_SEQUENCE: - RelationCreateStorage(rel->rd_node, relpersistence); + RelationCreateStorage(rel->rd_node, relpersistence, rel); break; case RELKIND_RELATION: @@ -956,6 +962,7 @@ AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -994,8 +1001,18 @@ AddNewRelationTuple(Relation pg_class_desc, break; } - new_rel_reltup->relfrozenxid = relfrozenxid; - new_rel_reltup->relminmxid = relminmxid; + /* global temp table not remember transaction info in catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + new_rel_reltup->relfrozenxid = InvalidTransactionId; + new_rel_reltup->relminmxid = InvalidMultiXactId; + } + else + { + new_rel_reltup->relfrozenxid = relfrozenxid; + new_rel_reltup->relminmxid = relminmxid; + } + new_rel_reltup->relowner = relowner; new_rel_reltup->reltype = new_type_oid; new_rel_reltup->reloftype = reloftype; @@ -1357,6 +1374,7 @@ heap_create_with_catalog(const char *relname, reloftypeid, ownerid, relkind, + relpersistence, relfrozenxid, relminmxid, PointerGetDatum(relacl), @@ -1441,11 +1459,15 @@ heap_create_with_catalog(const char *relname, */ StoreConstraints(new_rel_desc, cooked_constraints, is_internal); - /* - * If there's a special on-commit action, remember it - */ - if (oncommit != ONCOMMIT_NOOP) - register_on_commit_action(relid, oncommit); + /* global temp table register action when storage init */ + if (relpersistence != RELPERSISTENCE_GLOBAL_TEMP) + { + /* + * If there's a special on-commit action, remember it + */ + if (oncommit != ONCOMMIT_NOOP) + register_on_commit_action(relid, oncommit); + } /* * ok, the relation has been cataloged, so close our relations and return @@ -1937,6 +1959,13 @@ heap_drop_with_catalog(Oid relid) if (relid == defaultPartOid) update_default_partition_oid(parentOid, InvalidOid); + /* We allow to drop global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not drop relation when other backend attached this global temp table"); + } + /* * Schedule unlinking of the relation's physical files at commit. */ @@ -3165,7 +3194,7 @@ RemoveStatistics(Oid relid, AttrNumber attnum) * the specified relation. Caller must hold exclusive lock on rel. */ static void -RelationTruncateIndexes(Relation heapRelation) +RelationTruncateIndexes(Relation heapRelation, LOCKMODE lockmode) { ListCell *indlist; @@ -3176,8 +3205,12 @@ RelationTruncateIndexes(Relation heapRelation) Relation currentIndex; IndexInfo *indexInfo; + if (RELATION_IS_GLOBAL_TEMP(heapRelation) && + !gtt_storage_attached(indexId)) + continue; + /* Open the index relation; use exclusive lock, just to be sure */ - currentIndex = index_open(indexId, AccessExclusiveLock); + currentIndex = index_open(indexId, lockmode); /* * Fetch info needed for index_build. Since we know there are no @@ -3223,8 +3256,13 @@ heap_truncate(List *relids) { Oid rid = lfirst_oid(cell); Relation rel; + LOCKMODE lockmode = AccessExclusiveLock; - rel = table_open(rid, AccessExclusiveLock); + /* truncate global temp table only need RowExclusiveLock */ + if (get_rel_persistence(rid) == RELPERSISTENCE_GLOBAL_TEMP) + lockmode = RowExclusiveLock; + + rel = table_open(rid, lockmode); relations = lappend(relations, rel); } @@ -3257,6 +3295,8 @@ void heap_truncate_one_rel(Relation rel) { Oid toastrelid; + LOCKMODE lockmode = AccessExclusiveLock; + bool truncate_toastrel = false; /* * Truncate the relation. Partitioned tables have no storage, so there is @@ -3265,23 +3305,40 @@ heap_truncate_one_rel(Relation rel) if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) return; + toastrelid = rel->rd_rel->reltoastrelid; + + /* + * Truncate global temp table only need RowExclusiveLock + */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + lockmode = RowExclusiveLock; + if (OidIsValid(toastrelid) && + gtt_storage_attached(toastrelid)) + truncate_toastrel = true; + } + else if (OidIsValid(toastrelid)) + truncate_toastrel = true; + /* Truncate the underlying relation */ table_relation_nontransactional_truncate(rel); /* If the relation has indexes, truncate the indexes too */ - RelationTruncateIndexes(rel); + RelationTruncateIndexes(rel, lockmode); /* If there is a toast table, truncate that too */ - toastrelid = rel->rd_rel->reltoastrelid; - if (OidIsValid(toastrelid)) + if (truncate_toastrel) { - Relation toastrel = table_open(toastrelid, AccessExclusiveLock); + Relation toastrel = table_open(toastrelid, lockmode); table_relation_nontransactional_truncate(toastrel); - RelationTruncateIndexes(toastrel); + RelationTruncateIndexes(toastrel, lockmode); /* keep the lock... */ table_close(toastrel, NoLock); } + + if (RELATION_IS_GLOBAL_TEMP(rel)) + up_gtt_relstats(rel, 0, 0, 0, RecentXmin, InvalidMultiXactId); } /* diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 8880586..0852073 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -52,6 +52,7 @@ #include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/event_trigger.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -877,6 +878,22 @@ index_create(Relation heapRelation, indexRelationName, RelationGetRelationName(heapRelation)))); } + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + if (accessMethodObjectId != BTREE_AM_OID) + elog(ERROR, "only support btree index on global temp table"); + + /* No support create index on global temp table use concurrent mode yet */ + if (concurrent) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot create indexes on global temporary tables using concurrent mode"))); + + /* if global temp table not init storage, then skip build index */ + if (!gtt_storage_attached(heapRelation->rd_node.relNode)) + flags |= INDEX_CREATE_SKIP_BUILD; + } + /* * construct tuple descriptor for index tuples */ @@ -2054,6 +2071,13 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) */ CheckTableNotInUse(userIndexRelation, "DROP INDEX"); + /* We allow to drop index on global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(userHeapRelation)) + { + if (is_other_backend_use_gtt(userHeapRelation->rd_node)) + elog(ERROR, "can not drop index when other backend attached this global temp table."); + } + /* * Drop Index Concurrently is more or less the reverse process of Create * Index Concurrently. @@ -2660,6 +2684,11 @@ index_update_stats(Relation rel, HeapTuple tuple; Form_pg_class rd_rel; bool dirty; + bool is_gtt = false; + + /* update index stats into localhash and rel_rd_rel for global temp table */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + is_gtt = true; /* * We always update the pg_class row using a non-transactional, @@ -2745,21 +2774,35 @@ index_update_stats(Relation rel, else /* don't bother for indexes */ relallvisible = 0; - if (rd_rel->relpages != (int32) relpages) + if (is_gtt) + rel->rd_rel->relpages = (int32) relpages; + else if (rd_rel->relpages != (int32) relpages) { rd_rel->relpages = (int32) relpages; dirty = true; } - if (rd_rel->reltuples != (float4) reltuples) + + if (is_gtt) + rel->rd_rel->reltuples = (float4) reltuples; + else if (rd_rel->reltuples != (float4) reltuples) { rd_rel->reltuples = (float4) reltuples; dirty = true; } - if (rd_rel->relallvisible != (int32) relallvisible) + + if (is_gtt) + rel->rd_rel->relallvisible = (int32) relallvisible; + else if (rd_rel->relallvisible != (int32) relallvisible) { rd_rel->relallvisible = (int32) relallvisible; dirty = true; } + + if (is_gtt) + { + up_gtt_relstats(rel, relpages, reltuples, relallvisible, + InvalidTransactionId, InvalidMultiXactId); + } } /* @@ -2873,6 +2916,15 @@ index_build(Relation heapRelation, pgstat_progress_update_multi_param(6, index, val); } + if (RELATION_IS_GLOBAL_TEMP(indexRelation)) + { + if (!gtt_storage_attached(indexRelation->rd_node.relNode)) + { + gtt_force_enable_index(indexRelation); + RelationCreateStorage(indexRelation->rd_node, RELPERSISTENCE_GLOBAL_TEMP, indexRelation); + } + } + /* * Call the access method's build procedure */ @@ -3468,6 +3520,15 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence, errmsg("cannot reindex temporary tables of other sessions"))); /* + * Because global temp table cannot change relfilenode + * no support reindex on global temp table yet. + */ + if (RELATION_IS_GLOBAL_TEMP(iRel)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot reindex global temporary tables"))); + + /* * Also check for active uses of the index in the current transaction; we * don't want to reindex underneath an open indexscan. */ diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index e70243a..301da79 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -647,6 +647,13 @@ RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid) errmsg("cannot create temporary relation in non-temporary schema"))); } break; + /* global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + if (isAnyTempNamespace(nspid)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("cannot create global temp relations in temporary schemas"))); + break; case RELPERSISTENCE_PERMANENT: if (isTempOrTempToastNamespace(nspid)) newRelation->relpersistence = RELPERSISTENCE_TEMP; diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index fddfbf1..671c614 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -26,6 +26,7 @@ #include "access/xlogutils.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "storage/freespace.h" #include "storage/smgr.h" @@ -75,7 +76,7 @@ static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */ * transaction aborts later on, the storage will be destroyed. */ SMgrRelation -RelationCreateStorage(RelFileNode rnode, char relpersistence) +RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel) { PendingRelDelete *pending; SMgrRelation srel; @@ -85,6 +86,8 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) switch (relpersistence) { case RELPERSISTENCE_TEMP: + /* global temp table use same storage strategy as local temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); needs_wal = false; break; @@ -117,6 +120,10 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) pending->next = pendingDeletes; pendingDeletes = pending; + /* remember global temp table storage info to localhash */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && rel) + remember_gtt_storage_info(rnode, rel); + return srel; } @@ -486,8 +493,15 @@ smgrDoPendingDeletes(bool isCommit) smgrdounlinkall(srels, nrels, false); for (i = 0; i < nrels; i++) + { smgrclose(srels[i]); + /* clean global temp table flags when transaction commit or rollback */ + if (SmgrIsTemp(srels[i]) && + gtt_storage_attached(srels[i]->smgr_rnode.node.relNode)) + forget_gtt_storage_info(srels[i]->smgr_rnode.node.relNode); + } + pfree(srels); } } diff --git a/src/backend/catalog/storage_gtt.c b/src/backend/catalog/storage_gtt.c new file mode 100644 index 0000000..24a7e77 --- /dev/null +++ b/src/backend/catalog/storage_gtt.c @@ -0,0 +1,1174 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.c + * code to create and destroy physical storage for global temparary table + * + * IDENTIFICATION + * src/backend/catalog/storage_gtt.c + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "access/table.h" +#include "access/visibilitymap.h" +#include "access/xact.h" +#include "access/xlog.h" +#include "access/xloginsert.h" +#include "access/xlogutils.h" +#include "access/htup_details.h" +#include "access/multixact.h" +#include "catalog/storage.h" +#include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" +#include "catalog/heap.h" +#include "catalog/namespace.h" +#include "catalog/pg_type.h" +#include "catalog/pg_statistic.h" +#include "commands/tablecmds.h" +#include "funcapi.h" +#include "nodes/primnodes.h" +#include "nodes/pg_list.h" +#include "nodes/execnodes.h" +#include "miscadmin.h" +#include "storage/freespace.h" +#include "storage/smgr.h" +#include "storage/ipc.h" +#include "storage/proc.h" +#include "storage/procarray.h" +#include "storage/lwlock.h" +#include "storage/shmem.h" +#include "storage/sinvaladt.h" +#include "utils/memutils.h" +#include "utils/rel.h" +#include "utils/hsearch.h" +#include "utils/catcache.h" +#include "utils/lsyscache.h" +#include <utils/relcache.h> +#include "utils/inval.h" +#include "utils/guc.h" + + +/* Copy from bitmapset.c, because gtt used the function in bitmapset.c */ +#define WORDNUM(x) ((x) / BITS_PER_BITMAPWORD) +#define BITNUM(x) ((x) % BITS_PER_BITMAPWORD) + +#define BITMAPSET_SIZE(nwords) \ + (offsetof(Bitmapset, words) + (nwords) * sizeof(bitmapword)) + +static bool gtt_cleaner_exit_registered = false; +static HTAB *gtt_storage_local_hash = NULL; +static HTAB *active_gtt_shared_hash = NULL; +static MemoryContext gtt_relstats_context = NULL; + +/* relfrozenxid of all gtts in the current session */ +static List *gtt_session_relfrozenxid_list = NIL; +static TransactionId gtt_session_frozenxid = InvalidTransactionId; + +typedef struct gtt_ctl_data +{ + LWLock lock; + int max_entry; + int entry_size; +}gtt_ctl_data; + +static gtt_ctl_data *gtt_shared_ctl = NULL; + +typedef struct +{ + RelFileNode rnode; + Bitmapset *map; + /* bitmap data */ +} gtt_shared_hash_entry; + +typedef struct +{ + Oid relid; + + Oid spcnode; + /* pg_class stat */ + int32 relpages; + float4 reltuples; + int32 relallvisible; + TransactionId relfrozenxid; + TransactionId relminmxid; + char relkind; + bool on_commit_delete; + + /* pg_statistic */ + int natts; + int *attnum; + HeapTuple *att_stat_tups; +} gtt_local_hash_entry; + +static Size action_gtt_shared_hash_entry_size(void); +static void gtt_storage_checkin(RelFileNode rnode); +static void gtt_storage_checkout(RelFileNode rnode, bool skiplock); +static void gtt_storage_removeall(int code, Datum arg); +static void insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid); +static void remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid); +static void set_gtt_session_relfrozenxid(void); + +Datum pg_get_gtt_statistics(PG_FUNCTION_ARGS); +Datum pg_get_gtt_relstats(PG_FUNCTION_ARGS); +Datum pg_gtt_attached_pid(PG_FUNCTION_ARGS); +Datum pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS); + + +static Size +action_gtt_shared_hash_entry_size(void) +{ + int wordnum; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + wordnum = WORDNUM(MaxBackends + 1); + hash_entry_size += MAXALIGN(sizeof(gtt_shared_hash_entry)); + hash_entry_size += MAXALIGN(BITMAPSET_SIZE(wordnum + 1)); + + return hash_entry_size; +} + +Size +active_gtt_shared_hash_size(void) +{ + Size size = 0; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + size = MAXALIGN(sizeof(gtt_ctl_data)); + hash_entry_size = action_gtt_shared_hash_entry_size(); + size += hash_estimate_size(max_active_gtt, hash_entry_size); + + return size; +} + +void +active_gtt_shared_hash_init(void) +{ + HASHCTL info; + bool found; + + if (max_active_gtt <= 0) + return; + + gtt_shared_ctl = + ShmemInitStruct("gtt_shared_ctl", + sizeof(gtt_ctl_data), + &found); + + if (!found) + { + LWLockRegisterTranche(LWTRANCHE_GTT_CTL, "gtt_shared_ctl"); + LWLockInitialize(>t_shared_ctl->lock, LWTRANCHE_GTT_CTL); + gtt_shared_ctl->max_entry = max_active_gtt; + gtt_shared_ctl->entry_size = action_gtt_shared_hash_entry_size(); + } + + info.keysize = sizeof(RelFileNode); + info.entrysize = gtt_shared_ctl->entry_size; + active_gtt_shared_hash = + ShmemInitHash("active gtt shared hash", + gtt_shared_ctl->max_entry, + gtt_shared_ctl->max_entry, + &info, HASH_ELEM | HASH_BLOBS | HASH_FIXED_SIZE); +} + +static void +gtt_storage_checkin(RelFileNode rnode) +{ + gtt_shared_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + entry = (gtt_shared_hash_entry *) hash_search(active_gtt_shared_hash, + &rnode, HASH_ENTER_NULL, &found); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of shared memory"), + errhint("You might need to increase max_active_gtt."))); + } + + if (found == false) + { + int wordnum; + + entry->map = (Bitmapset *)((char *)entry + MAXALIGN(sizeof(gtt_shared_hash_entry))); + wordnum = WORDNUM(MaxBackends + 1); + memset(entry->map, 0, BITMAPSET_SIZE(wordnum + 1)); + entry->map->nwords = wordnum + 1; + } + + bms_add_member(entry->map, MyBackendId); + LWLockRelease(>t_shared_ctl->lock); +} + +static void +gtt_storage_checkout(RelFileNode rnode, bool skiplock) +{ + gtt_shared_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (!skiplock) + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + + entry = hash_search(active_gtt_shared_hash, + (void *) &(rnode), HASH_FIND, NULL); + + if (entry == NULL) + { + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + elog(WARNING, "relfilenode %u/%u/%u not exist in gtt shared hash when forget", + rnode.dbNode, rnode.spcNode, rnode.relNode); + return; + } + + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + bms_del_member(entry->map, MyBackendId); + + if (bms_is_empty(entry->map)) + { + if (!hash_search(active_gtt_shared_hash, &rnode, HASH_REMOVE, NULL)) + elog(PANIC, "gtt shared hash table corrupted"); + } + + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + return; +} + +Bitmapset * +copy_active_gtt_bitmap(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + Bitmapset *map_copy = NULL; + + if (max_active_gtt <= 0) + return NULL; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return NULL; + } + + Assert(entry->map); + if (!bms_is_empty(entry->map)) + map_copy = bms_copy(entry->map); + + LWLockRelease(>t_shared_ctl->lock); + + return map_copy; +} + +bool +is_other_backend_use_gtt(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + bool in_use = false; + int num_use = 0; + + if (max_active_gtt <= 0) + return false; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return false; + } + + Assert(entry->map); + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + + num_use = bms_num_members(entry->map); + if (num_use == 0) + in_use = false; + else if (num_use == 1) + { + if(bms_is_member(MyBackendId, entry->map)) + in_use = false; + else + in_use = true; + } + else + in_use = true; + + LWLockRelease(>t_shared_ctl->lock); + + return in_use; +} + +void +remember_gtt_storage_info(RelFileNode rnode, Relation rel) +{ + gtt_local_hash_entry *entry; + MemoryContext oldcontext; + Oid relid = rnode.relNode; + bool found; + + if (max_active_gtt <= 0) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Global temporary table feature is disable"), + errhint("You might need to increase max_active_gtt to enable this feature."))); + + if (RecoveryInProgress()) + elog(ERROR, "readonly mode not support access global temp table yet"); + + if (rel->rd_rel->relkind == RELKIND_INDEX && + (!rel->rd_index->indisvalid || + !rel->rd_index->indisready || + !rel->rd_index->indislive)) + elog(ERROR, "invalid gtt index %s not allow to create stroage file", RelationGetRelationName(rel)); + + if (gtt_storage_local_hash == NULL) + { +#define GTT_LOCAL_HASH_SIZE 1024 + /* First time through: initialize the hash table */ + HASHCTL ctl; + + MemSet(&ctl, 0, sizeof(ctl)); + ctl.keysize = sizeof(Oid); + ctl.entrysize = sizeof(gtt_local_hash_entry); + gtt_storage_local_hash = + hash_create("global temp relation table", + GTT_LOCAL_HASH_SIZE, + &ctl, HASH_ELEM | HASH_BLOBS); + + if (!CacheMemoryContext) + CreateCacheMemoryContext(); + + gtt_relstats_context = + AllocSetContextCreate(CacheMemoryContext, + "gtt relstats context", + ALLOCSET_DEFAULT_SIZES); + } + + /* Look up or create an entry */ + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_ENTER, &found); + + if (found) + { + elog(ERROR, "backend %d relid %u already exists in global temp table local hash", + MyBackendId, relid); + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + + entry->spcnode = rnode.spcNode; + entry->relpages = 0; + entry->reltuples = 0; + entry->relallvisible = 0; + entry->relkind = rel->rd_rel->relkind; + /* only heap contain transaction information */ + if (entry->relkind == RELKIND_RELATION || entry->relkind == RELKIND_PARTITIONED_TABLE) + { + int natts = RelationGetNumberOfAttributes(rel); + entry->natts = natts; + entry->attnum = palloc0(sizeof(int) * natts); + entry->att_stat_tups = palloc0(sizeof(HeapTuple) * natts); + + if (RELATION_GTT_ON_COMMIT_DELETE(rel)) + { + entry->on_commit_delete = true; + register_on_commit_action(rel->rd_node.relNode, ONCOMMIT_DELETE_ROWS); + } + + entry->relfrozenxid = RecentXmin; + entry->relminmxid = GetOldestMultiXactId(); + insert_gtt_relfrozenxid_to_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + gtt_storage_checkin(rnode); + } + else + { + entry->natts = 0; + entry->attnum = 0; + entry->att_stat_tups = NULL; + entry->on_commit_delete = false; + entry->relfrozenxid = 0; + entry->relminmxid = 0; + } + + MemoryContextSwitchTo(oldcontext); + + if (!gtt_cleaner_exit_registered) + { + before_shmem_exit(gtt_storage_removeall, 0); + gtt_cleaner_exit_registered = true; + } + + return; +} + +void +forget_gtt_storage_info(Oid relid) +{ + gtt_local_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, NULL); + + if (entry && entry->relkind == RELKIND_RELATION) + { + RelFileNode rnode; + int i; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + gtt_storage_checkout(rnode, false); + + Assert(TransactionIdIsNormal(entry->relfrozenxid)); + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + + for (i = 0; i < entry->natts; i++) + { + if (entry->att_stat_tups[i]) + { + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + } + } + } + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_REMOVE, NULL); + + return; +} + +/* is the storage file was created in this backend */ +bool +gtt_storage_attached(Oid relid) +{ + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, &found); + + return found; +} + +static void +gtt_storage_removeall(int code, Datum arg) +{ + HASH_SEQ_STATUS status; + gtt_local_hash_entry *entry; + int nrels = 0, + maxrels = 0; + SMgrRelation *srels = NULL; + RelFileNode *rnodes = NULL; + char *relkinds = NULL; + + if (gtt_storage_local_hash == NULL) + return; + + hash_seq_init(&status, gtt_storage_local_hash); + while ((entry = (gtt_local_hash_entry *) hash_seq_search(&status)) != NULL) + { + SMgrRelation srel; + RelFileNode rnode; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + srel = smgropen(rnode, MyBackendId); + + /* allocate the initial array, or extend it, if needed */ + if (maxrels == 0) + { + maxrels = 32; + srels = palloc(sizeof(SMgrRelation) * maxrels); + rnodes = palloc(sizeof(RelFileNode) * maxrels); + relkinds = palloc(sizeof(char) * maxrels); + } + else if (maxrels <= nrels) + { + maxrels *= 2; + srels = repalloc(srels, sizeof(SMgrRelation) * maxrels); + rnodes = repalloc(rnodes, sizeof(RelFileNode) * maxrels); + relkinds = repalloc(relkinds, sizeof(char) * maxrels); + } + + srels[nrels] = srel; + rnodes[nrels] = rnode; + relkinds[nrels] = entry->relkind; + nrels++; + } + + if (nrels > 0) + { + int i; + + smgrdounlinkall(srels, nrels, false); + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + for (i = 0; i < nrels; i++) + { + smgrclose(srels[i]); + if (relkinds[i] == RELKIND_RELATION) + gtt_storage_checkout(rnodes[i], true); + } + LWLockRelease(>t_shared_ctl->lock); + + pfree(srels); + pfree(rnodes); + pfree(relkinds); + } + + MyProc->session_gtt_frozenxid = InvalidTransactionId; + + return; +} + +/* + * Update global temp table relstats(relpage/reltuple/relallvisible) + * to local hashtable + */ +void +up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid) +{ + Oid relid = RelationGetRelid(relation); + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return; + + Assert(entry->spcnode); + + if (num_pages >= 0 && + entry->relpages != (int32)num_pages) + entry->relpages = (int32)num_pages; + + if (num_tuples >= 0 && + num_tuples != (float4)entry->reltuples) + entry->reltuples = (float4)num_tuples; + + /* only heap contain transaction information and relallvisible */ + if (entry->relkind == RELKIND_RELATION) + { + if (entry->relallvisible >= 0 && + entry->relallvisible != (int32)num_all_visible_pages) + { + entry->relallvisible = (int32)num_all_visible_pages; + } + + if (TransactionIdIsNormal(relfrozenxid) && + entry->relfrozenxid != relfrozenxid && + (TransactionIdPrecedes(entry->relfrozenxid, relfrozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), entry->relfrozenxid))) + { + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + entry->relfrozenxid = relfrozenxid; + insert_gtt_relfrozenxid_to_ordered_list(relfrozenxid); + set_gtt_session_relfrozenxid(); + } + + if (MultiXactIdIsValid(relminmxid) && + entry->relminmxid != relminmxid && + (MultiXactIdPrecedes(entry->relminmxid, relminmxid) || + MultiXactIdPrecedes(ReadNextMultiXactId(), entry->relminmxid))) + { + entry->relminmxid = relminmxid; + } + } + + return; +} + +/* + * Search global temp table relstats(relpage/reltuple/relallvisible) + * from local hashtable. + */ +bool +get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid) +{ + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return false; + + Assert(entry->relid == relid); + + if (relpages) + *relpages = entry->relpages; + + if (reltuples) + *reltuples = entry->reltuples; + + if (relallvisible) + *relallvisible = entry->relallvisible; + + if (relfrozenxid) + *relfrozenxid = entry->relfrozenxid; + + if (relminmxid) + *relminmxid = entry->relminmxid; + + return true; +} + +/* + * Update global temp table statistic info(definition is same as pg_statistic) + * to local hashtable where ananyze global temp table + */ +void +up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull) +{ + gtt_local_hash_entry *entry; + bool found; + MemoryContext oldcontext; + int i = 0; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return; + + if (entry->relkind != RELKIND_RELATION) + { + elog(WARNING, "oid %u not a relation", reloid); + return; + } + + /* todo */ + if (entry->natts < natts) + { + elog(WARNING, "reloid %u not support update attstat after add colunm", reloid); + return; + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + Assert(entry->relid == reloid); + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == 0) + { + entry->attnum[i] = attnum; + break; + } + else if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + break; + } + } + + Assert(i < entry->natts); + Assert(entry->att_stat_tups[i] == NULL); + entry->att_stat_tups[i] = heap_form_tuple(tupleDescriptor, values, isnull); + MemoryContextSwitchTo(oldcontext); + + return; +} + +/* + * Search global temp table statistic info(definition is same as pg_statistic) + * from local hashtable. + */ +HeapTuple +get_gtt_att_statistic(Oid reloid, int attnum, bool inh) +{ + gtt_local_hash_entry *entry; + bool found; + int i = 0; + + if (max_active_gtt <= 0) + return NULL; + + if (gtt_storage_local_hash == NULL) + return NULL; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return NULL; + + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + return entry->att_stat_tups[i]; + } + } + + return NULL; +} + +void +release_gtt_statistic_cache(HeapTuple tup) +{ + /* do nothing */ + return; +} + +static void +insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid) +{ + MemoryContext oldcontext; + ListCell *cell; + int i; + + Assert(TransactionIdIsNormal(relfrozenxid)); + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + /* Does the datum belong at the front? */ + if (gtt_session_relfrozenxid_list == NIL || + TransactionIdFollowsOrEquals(relfrozenxid, + linitial_oid(gtt_session_relfrozenxid_list))) + { + gtt_session_relfrozenxid_list = + lcons_oid(relfrozenxid, gtt_session_relfrozenxid_list); + MemoryContextSwitchTo(oldcontext); + + return; + } + + /* No, so find the entry it belongs after */ + i = 0; + foreach (cell, gtt_session_relfrozenxid_list) + { + if (TransactionIdFollowsOrEquals(relfrozenxid, lfirst_oid(cell))) + break; + + i++; + } + gtt_session_relfrozenxid_list = + list_insert_nth_oid(gtt_session_relfrozenxid_list, i, relfrozenxid); + MemoryContextSwitchTo(oldcontext); + + return; +} + +static void +remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid) +{ + gtt_session_relfrozenxid_list = + list_delete_oid(gtt_session_relfrozenxid_list, relfrozenxid); +} + +static void +set_gtt_session_relfrozenxid(void) +{ + TransactionId gtt_frozenxid = InvalidTransactionId; + + if (gtt_session_relfrozenxid_list) + gtt_frozenxid = llast_oid(gtt_session_relfrozenxid_list); + + gtt_session_frozenxid = gtt_frozenxid; + if (MyProc->session_gtt_frozenxid != gtt_frozenxid) + MyProc->session_gtt_frozenxid = gtt_frozenxid; +} + +Datum +pg_get_gtt_statistics(PG_FUNCTION_ARGS) +{ + HeapTuple tuple; + Relation rel = NULL; + int attnum = PG_GETARG_INT32(1); + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + MemoryContext oldcontext; + Tuplestorestate *tupstore; + Relation pg_tatistic = NULL; + TupleDesc sd; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not " \ + "allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + pg_tatistic = table_open(StatisticRelationId, AccessShareLock); + sd = RelationGetDescr(pg_tatistic); + + tuple = get_gtt_att_statistic(reloid, attnum, false); + if (tuple) + { + Datum values[31]; + bool isnull[31]; + HeapTuple res = NULL; + + memset(&values, 0, sizeof(values)); + memset(&isnull, 0, sizeof(isnull)); + heap_deform_tuple(tuple, sd, values, isnull); + res = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, res); + } + + table_close(rel, NoLock); + table_close(pg_tatistic, AccessShareLock); + tuplestore_donestoring(tupstore); + + return (Datum) 0; +} + +Datum +pg_get_gtt_relstats(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + uint32 relfrozenxid = 0; + uint32 relminmxid = 0; + Relation rel = NULL; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + if (get_gtt_relstats(reloid, + &relpages, &reltuples, &relallvisible, + &relfrozenxid, &relminmxid)) + { + Datum values[5]; + bool isnull[5]; + + memset(isnull, 0, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(relpages); + values[1] = Float4GetDatum((float4)reltuples); + values[2] = Int32GetDatum(relallvisible); + values[3] = UInt32GetDatum(relfrozenxid); + values[4] = UInt32GetDatum(relminmxid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_gtt_attached_pid(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + Relation rel = NULL; + PGPROC *proc = NULL; + Bitmapset *map = NULL; + pid_t pid = 0; + int backendid = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + map = copy_active_gtt_bitmap(rel->rd_node); + if (map) + { + backendid = bms_first_member(map); + + do + { + proc = BackendIdGetProc(backendid); + pid = proc->pid; + if (pid > 0) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = UInt32GetDatum(reloid); + values[1] = Int32GetDatum(pid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + backendid = bms_next_member(map, backendid); + } while (backendid > 0); + + pfree(map); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + int num_xid = MaxBackends + 1; + int *pids = NULL; + uint32 *xids = NULL; + int i = 0; + int j = 0; + uint32 oldest = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + if (max_active_gtt <= 0) + return (Datum) 0; + + if (RecoveryInProgress()) + return (Datum) 0; + + pids = palloc0(sizeof(int) * num_xid); + xids = palloc0(sizeof(int) * num_xid); + oldest = list_all_session_gtt_frozenxids(num_xid, pids, xids, &i); + if (i > 0) + { + if (i > 0) + { + pids[i] = 0; + xids[i] = oldest; + i++; + } + + for(j = 0; j < i; j++) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(pids[j]); + values[1] = UInt32GetDatum(xids[j]); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + } + tuplestore_donestoring(tupstore); + pfree(pids); + pfree(xids); + + return (Datum) 0; +} + +void +gtt_force_enable_index(Relation index) +{ + Oid indexOid = RelationGetRelid(index); + + if (!RELATION_IS_GLOBAL_TEMP(index)) + return; + + Assert(index->rd_rel->relkind == RELKIND_INDEX); + Assert(OidIsValid(indexOid)); + + index->rd_index->indisvalid = true; + index->rd_index->indislive = true; + index->rd_index->indisready = true; +} + +void +gtt_fix_index_state(Relation index) +{ + Oid indexOid = RelationGetRelid(index); + Oid relOid = index->rd_index->indrelid; + + if (!RELATION_IS_GLOBAL_TEMP(index)) + return; + + if (!index->rd_index->indisvalid) + return; + + if (gtt_storage_attached(relOid) && + !gtt_storage_attached(indexOid)) + { + index->rd_index->indisvalid = false; + index->rd_index->indislive = false; + index->rd_index->indisready = false; + } + + return; +} + diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index c9e75f4..2adde62 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -186,6 +186,91 @@ CREATE OR REPLACE VIEW pg_sequences AS WHERE NOT pg_is_other_temp_schema(N.oid) AND relkind = 'S'; +-- For global temporary table +CREATE VIEW pg_gtt_relstats WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_relstats(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_attached_pids WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_gtt_attached_pid(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_stats WITH (security_barrier) AS +SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN s.stakind1 = 1 THEN s.stavalues1 + WHEN s.stakind2 = 1 THEN s.stavalues2 + WHEN s.stakind3 = 1 THEN s.stavalues3 + WHEN s.stakind4 = 1 THEN s.stavalues4 + WHEN s.stakind5 = 1 THEN s.stavalues5 + END AS most_common_vals, + CASE + WHEN s.stakind1 = 1 THEN s.stanumbers1 + WHEN s.stakind2 = 1 THEN s.stanumbers2 + WHEN s.stakind3 = 1 THEN s.stanumbers3 + WHEN s.stakind4 = 1 THEN s.stanumbers4 + WHEN s.stakind5 = 1 THEN s.stanumbers5 + END AS most_common_freqs, + CASE + WHEN s.stakind1 = 2 THEN s.stavalues1 + WHEN s.stakind2 = 2 THEN s.stavalues2 + WHEN s.stakind3 = 2 THEN s.stavalues3 + WHEN s.stakind4 = 2 THEN s.stavalues4 + WHEN s.stakind5 = 2 THEN s.stavalues5 + END AS histogram_bounds, + CASE + WHEN s.stakind1 = 3 THEN s.stanumbers1[1] + WHEN s.stakind2 = 3 THEN s.stanumbers2[1] + WHEN s.stakind3 = 3 THEN s.stanumbers3[1] + WHEN s.stakind4 = 3 THEN s.stanumbers4[1] + WHEN s.stakind5 = 3 THEN s.stanumbers5[1] + END AS correlation, + CASE + WHEN s.stakind1 = 4 THEN s.stavalues1 + WHEN s.stakind2 = 4 THEN s.stavalues2 + WHEN s.stakind3 = 4 THEN s.stavalues3 + WHEN s.stakind4 = 4 THEN s.stavalues4 + WHEN s.stakind5 = 4 THEN s.stavalues5 + END AS most_common_elems, + CASE + WHEN s.stakind1 = 4 THEN s.stanumbers1 + WHEN s.stakind2 = 4 THEN s.stanumbers2 + WHEN s.stakind3 = 4 THEN s.stanumbers3 + WHEN s.stakind4 = 4 THEN s.stanumbers4 + WHEN s.stakind5 = 4 THEN s.stanumbers5 + END AS most_common_elem_freqs, + CASE + WHEN s.stakind1 = 5 THEN s.stanumbers1 + WHEN s.stakind2 = 5 THEN s.stanumbers2 + WHEN s.stakind3 = 5 THEN s.stanumbers3 + WHEN s.stakind4 = 5 THEN s.stanumbers4 + WHEN s.stakind5 = 5 THEN s.stanumbers5 + END AS elem_count_histogram + FROM + pg_class c + JOIN pg_attribute a ON c.oid = a.attrelid + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_statistics(c.oid, a.attnum, ''::text) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') and NOT a.attisdropped AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + CREATE VIEW pg_stats WITH (security_barrier) AS SELECT nspname AS schemaname, diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index c4420dd..977a984 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -34,6 +34,7 @@ #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "commands/dbcommands.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -103,7 +104,7 @@ static int acquire_inherited_sample_rows(Relation onerel, int elevel, HeapTuple *rows, int targrows, double *totalrows, double *totaldeadrows); static void update_attstats(Oid relid, bool inh, - int natts, VacAttrStats **vacattrstats); + int natts, VacAttrStats **vacattrstats, char relpersistence); static Datum std_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); @@ -586,14 +587,15 @@ do_analyze_rel(Relation onerel, VacuumParams *params, * pg_statistic for columns we didn't process, we leave them alone.) */ update_attstats(RelationGetRelid(onerel), inh, - attr_cnt, vacattrstats); + attr_cnt, vacattrstats, RelationGetRelPersistence(onerel)); for (ind = 0; ind < nindexes; ind++) { AnlIndexData *thisdata = &indexdata[ind]; update_attstats(RelationGetRelid(Irel[ind]), false, - thisdata->attr_cnt, thisdata->vacattrstats); + thisdata->attr_cnt, thisdata->vacattrstats, + RelationGetRelPersistence(Irel[ind])); } /* @@ -1456,7 +1458,7 @@ acquire_inherited_sample_rows(Relation onerel, int elevel, * by taking a self-exclusive lock on the relation in analyze_rel(). */ static void -update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) +update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats, char relpersistence) { Relation sd; int attno; @@ -1558,31 +1560,45 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) } } - /* Is there already a pg_statistic tuple for this attribute? */ - oldtup = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(relid), - Int16GetDatum(stats->attr->attnum), - BoolGetDatum(inh)); - - if (HeapTupleIsValid(oldtup)) + /* Update column statistic to localhash, not catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { - /* Yes, replace it */ - stup = heap_modify_tuple(oldtup, - RelationGetDescr(sd), - values, - nulls, - replaces); - ReleaseSysCache(oldtup); - CatalogTupleUpdate(sd, &stup->t_self, stup); + up_gtt_att_statistic(relid, + stats->attr->attnum, + inh, + natts, + RelationGetDescr(sd), + values, + nulls); } else { - /* No, insert new tuple */ - stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); - CatalogTupleInsert(sd, stup); - } + /* Is there already a pg_statistic tuple for this attribute? */ + oldtup = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(relid), + Int16GetDatum(stats->attr->attnum), + BoolGetDatum(inh)); - heap_freetuple(stup); + if (HeapTupleIsValid(oldtup)) + { + /* Yes, replace it */ + stup = heap_modify_tuple(oldtup, + RelationGetDescr(sd), + values, + nulls, + replaces); + ReleaseSysCache(oldtup); + CatalogTupleUpdate(sd, &stup->t_self, stup); + } + else + { + /* No, insert new tuple */ + stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); + CatalogTupleInsert(sd, stup); + } + + heap_freetuple(stup); + } } table_close(sd, RowExclusiveLock); diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index e9d7a7f..3088e26 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -391,6 +391,12 @@ cluster_rel(Oid tableOid, Oid indexOid, int options) errmsg("cannot vacuum temporary tables of other sessions"))); } + /* not support cluster global temp table yet */ + if (RELATION_IS_GLOBAL_TEMP(OldHeap)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("not support cluster global temporary tables yet"))); + /* * Also check for active uses of the relation in the current transaction, * including open scans and pending AFTER trigger events. diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 40a8ec1..e7b4e44 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -1062,7 +1062,7 @@ DoCopy(ParseState *pstate, const CopyStmt *stmt, Assert(rel); /* check read-only transaction and parallel mode */ - if (XactReadOnly && !rel->rd_islocaltemp) + if (XactReadOnly && !rel->rd_istemp) PreventCommandIfReadOnly("COPY FROM"); cstate = BeginCopyFrom(pstate, rel, stmt->filename, stmt->is_program, diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index ec20ba3..a29cc00 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2614,6 +2614,16 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind, !isTempNamespace(classtuple->relnamespace)) continue; + /* not support reindex on global temp table, so skip it */ + if (classtuple->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + ereport(WARNING, + (errmsg("global temp table \"%s.%s\" skip reindexed", + get_namespace_name(get_rel_namespace(relid)), + get_rel_name(relid)))); + continue; + } + /* Check user/system classification, and optionally skip */ if (objectKind == REINDEX_OBJECT_SYSTEM && !IsSystemClass(relid, classtuple)) diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c index 329ab84..dfa257c 100644 --- a/src/backend/commands/lockcmds.c +++ b/src/backend/commands/lockcmds.c @@ -96,7 +96,8 @@ RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, * transaction. */ relpersistence = get_rel_persistence(relid); - if (relpersistence == RELPERSISTENCE_TEMP) + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPNAMESPACE; /* Check permissions. */ diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 6aab73b..5787674 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -94,7 +94,7 @@ static HTAB *seqhashtab = NULL; /* hash table for SeqTable items */ */ static SeqTableData *last_used_seq = NULL; -static void fill_seq_with_data(Relation rel, HeapTuple tuple); +static void fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf); static Relation lock_and_open_sequence(SeqTable seq); static void create_seq_hashtable(void); static void init_sequence(Oid relid, SeqTable *p_elm, Relation *p_rel); @@ -108,6 +108,7 @@ static void init_params(ParseState *pstate, List *options, bool for_identity, List **owned_by); static void do_setval(Oid relid, int64 next, bool iscalled); static void process_owned_by(Relation seqrel, List *owned_by, bool for_identity); +int64 get_seqence_start_value(Oid seqid); /* @@ -222,7 +223,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq) /* now initialize the sequence's data */ tuple = heap_form_tuple(tupDesc, value, null); - fill_seq_with_data(rel, tuple); + fill_seq_with_data(rel, tuple, InvalidBuffer); /* process OWNED BY if given */ if (owned_by) @@ -327,7 +328,7 @@ ResetSequence(Oid seq_relid) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seq_rel, tuple); + fill_seq_with_data(seq_rel, tuple, InvalidBuffer); /* Clear local cache so that we don't think we have cached numbers */ /* Note that we do not change the currval() state */ @@ -340,17 +341,21 @@ ResetSequence(Oid seq_relid) * Initialize a sequence's relation with the specified tuple as content */ static void -fill_seq_with_data(Relation rel, HeapTuple tuple) +fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf) { - Buffer buf; Page page; sequence_magic *sm; OffsetNumber offnum; + bool lockBuffer = false; /* Initialize first page of relation with special magic number */ - buf = ReadBuffer(rel, P_NEW); - Assert(BufferGetBlockNumber(buf) == 0); + if (buf == InvalidBuffer) + { + buf = ReadBuffer(rel, P_NEW); + Assert(BufferGetBlockNumber(buf) == 0); + lockBuffer = true; + } page = BufferGetPage(buf); @@ -360,7 +365,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) /* Now insert sequence tuple */ - LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); + if (lockBuffer) + LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); /* * Since VACUUM does not process sequences, we have to force the tuple to @@ -410,7 +416,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) END_CRIT_SECTION(); - UnlockReleaseBuffer(buf); + if (lockBuffer) + UnlockReleaseBuffer(buf); } /* @@ -502,7 +509,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seqrel, newdatatuple); + fill_seq_with_data(seqrel, newdatatuple, InvalidBuffer); } /* process OWNED BY if given */ @@ -611,7 +618,7 @@ nextval_internal(Oid relid, bool check_permissions) RelationGetRelationName(seqrel)))); /* read-only transactions may only modify temp sequences */ - if (!seqrel->rd_islocaltemp) + if (!seqrel->rd_istemp) PreventCommandIfReadOnly("nextval()"); /* @@ -936,7 +943,7 @@ do_setval(Oid relid, int64 next, bool iscalled) ReleaseSysCache(pgstuple); /* read-only transactions may only modify temp sequences */ - if (!seqrel->rd_islocaltemp) + if (!seqrel->rd_istemp) PreventCommandIfReadOnly("setval()"); /* @@ -1178,6 +1185,25 @@ read_seq_tuple(Relation rel, Buffer *buf, HeapTuple seqdatatuple) LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); page = BufferGetPage(*buf); + if (GlobalTempRelationPageIsNotInitialized(rel, page)) + { + /* Initialize sequence for global temporary tables */ + Datum value[SEQ_COL_LASTCOL] = {0}; + bool null[SEQ_COL_LASTCOL] = {false}; + HeapTuple tuple; + int64 startv = get_seqence_start_value(RelationGetRelid(rel)); + + /* + * last_value from pg_sequence.seqstart + * log_cnt = 0 + * is_called = false + */ + value[SEQ_COL_LASTVAL-1] = Int64GetDatumFast(startv); /* start sequence with 1 */ + + tuple = heap_form_tuple(RelationGetDescr(rel), value, null); + fill_seq_with_data(rel, tuple, *buf); + heap_freetuple(tuple); + } sm = (sequence_magic *) PageGetSpecialPointer(page); if (sm->magic != SEQ_MAGIC) @@ -1954,3 +1980,23 @@ seq_mask(char *page, BlockNumber blkno) mask_unused_space(page); } + +int64 +get_seqence_start_value(Oid seqid) +{ + HeapTuple seqtuple; + Form_pg_sequence seqform; + int64 start; + + seqtuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(seqid)); + if (!HeapTupleIsValid(seqtuple)) + elog(ERROR, "cache lookup failed for sequence %u", + seqid); + + seqform = (Form_pg_sequence) GETSTRUCT(seqtuple); + start = seqform->seqstart; + ReleaseSysCache(seqtuple); + + return start; +} + diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 70589dd..dfe7cc0 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -47,6 +47,7 @@ #include "catalog/storage.h" #include "catalog/storage_xlog.h" #include "catalog/toasting.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/comment.h" #include "commands/defrem.h" @@ -552,6 +553,7 @@ static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTbl); static List *GetParentedForeignKeyRefs(Relation partition); static void ATDetachCheckNoForeignKeyRefs(Relation partition); +static bool has_oncommit_option(List *options); /* ---------------------------------------------------------------- @@ -597,6 +599,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, LOCKMODE parentLockmode; const char *accessMethod = NULL; Oid accessMethodId = InvalidOid; + bool has_oncommit_clause = false; /* * Truncate relname to appropriate length (probably a waste of time, as @@ -607,8 +610,10 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Check consistency of arguments */ + /* global temp table same as local temp table */ if (stmt->oncommit != ONCOMMIT_NOOP - && stmt->relation->relpersistence != RELPERSISTENCE_TEMP) + && !(stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("ON COMMIT can only be used on temporary tables"))); @@ -638,7 +643,9 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, * code. This is needed because calling code might not expect untrusted * tables to appear in pg_temp at the front of its search path. */ - if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP + /* global temp table same as local temp table */ + if ((stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) && InSecurityRestrictedOperation()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -739,6 +746,57 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Parse and validate reloptions, if any. */ + /* global temp table */ + has_oncommit_clause = has_oncommit_option(stmt->options); + if (stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (relkind == RELKIND_RELATION || relkind == RELKIND_PARTITIONED_TABLE)) + { + /* inherit table or parition table inherit on commit property from parent table*/ + if (inheritOids && stmt->oncommit == ONCOMMIT_NOOP && !has_oncommit_clause) + { + Oid parent = linitial_oid(inheritOids); + Relation relation = table_open(parent, NoLock); + + if (!RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "The parent table must be global temporary table"); + + if (RELATION_GTT_ON_COMMIT_DELETE(relation)) + stmt->oncommit = ONCOMMIT_DELETE_ROWS; + else + stmt->oncommit = ONCOMMIT_PRESERVE_ROWS; + table_close(relation, NoLock); + } + + if (has_oncommit_clause) + { + if (stmt->oncommit != ONCOMMIT_NOOP) + elog(ERROR, "can not defeine global temp table with on commit and with clause at same time"); + } + else + { + DefElem *opt = makeNode(DefElem); + + opt->type = T_DefElem; + opt->defnamespace = NULL; + opt->defname = "on_commit_delete_rows"; + opt->defaction = DEFELEM_UNSPEC; + + /* use reloptions to remember on commit clause */ + if (stmt->oncommit == ONCOMMIT_DELETE_ROWS) + opt->arg = (Node *)makeString("true"); + else if (stmt->oncommit == ONCOMMIT_PRESERVE_ROWS) + opt->arg = (Node *)makeString("false"); + else if (stmt->oncommit == ONCOMMIT_NOOP) + opt->arg = (Node *)makeString("false"); + else + elog(ERROR, "global temp table not support on commit drop clause"); + + stmt->options = lappend(stmt->options, opt); + } + } + else if (has_oncommit_clause) + elog(ERROR, "regular table cannot specifie on_commit_delete_rows"); + reloptions = transformRelOptions((Datum) 0, stmt->options, NULL, validnsps, true, false); @@ -1816,7 +1874,8 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged, * table or the current physical file to be thrown away anyway. */ if (rel->rd_createSubid == mySubid || - rel->rd_newRelfilenodeSubid == mySubid) + rel->rd_newRelfilenodeSubid == mySubid || + RELATION_IS_GLOBAL_TEMP(rel)) { /* Immediate, non-rollbackable truncation is OK */ heap_truncate_one_rel(rel); @@ -2259,7 +2318,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence, /* If existing rel is temp, it must belong to this session */ if (relation->rd_rel->relpersistence == RELPERSISTENCE_TEMP && - !relation->rd_islocaltemp) + !relation->rd_istemp) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg(!is_partition @@ -3375,6 +3434,13 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo * specially. */ targetrelation = relation_open(myrelid, is_index ? ShareUpdateExclusiveLock : AccessExclusiveLock); + + if (RELATION_IS_GLOBAL_TEMP(targetrelation)) + { + if (is_other_backend_use_gtt(targetrelation->rd_node)) + elog(ERROR, "can not rename relation when other backend attached this global temp table"); + } + namespaceId = RelationGetNamespace(targetrelation); /* @@ -3550,6 +3616,13 @@ AlterTable(AlterTableStmt *stmt, LOCKMODE lockmode, /* Caller is required to provide an adequate lock. */ rel = relation_open(context->relid, NoLock); + /* We allow to alter global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not alter relation when other backend attached this global temp table"); + } + CheckTableNotInUse(rel, "ALTER TABLE"); ATController(stmt, rel, stmt->cmds, stmt->relation->inh, lockmode, context); @@ -8123,6 +8196,13 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, errmsg("referenced relation \"%s\" is not a table", RelationGetRelationName(pkrel)))); + /* global temp table not support foreign key constraint yet */ + if (RELATION_IS_GLOBAL_TEMP(pkrel)) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("referenced relation \"%s\" is not a global temp table", + RelationGetRelationName(pkrel)))); + if (!allowSystemTableMods && IsSystemRelation(pkrel)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -8157,11 +8237,17 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("constraints on temporary tables may reference only temporary tables"))); - if (!pkrel->rd_islocaltemp || !rel->rd_islocaltemp) + if (!pkrel->rd_istemp || !rel->rd_istemp) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("constraints on temporary tables must involve temporary tables of this session"))); break; + /* global temp table not support foreign key constraint yet */ + case RELPERSISTENCE_GLOBAL_TEMP: + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("not support foreign key constraints on global temp table yet"))); + break; } /* @@ -13199,7 +13285,7 @@ index_copy_data(Relation rel, RelFileNode newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, @@ -13314,14 +13400,14 @@ ATExecAddInherit(Relation child_rel, RangeVar *parent, LOCKMODE lockmode) /* If parent rel is temp, it must belong to this session */ if (parent_rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && - !parent_rel->rd_islocaltemp) + !parent_rel->rd_istemp) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot inherit from temporary relation of another session"))); /* Ditto for the child */ if (child_rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && - !child_rel->rd_islocaltemp) + !child_rel->rd_istemp) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot inherit to temporary relation of another session"))); @@ -14606,7 +14692,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged) */ switch (rel->rd_rel->relpersistence) { + /* global temp table same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("cannot change logged status of table \"%s\" because it is temporary", @@ -16096,14 +16184,14 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd) /* If the parent is temp, it must belong to this session */ if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && - !rel->rd_islocaltemp) + !rel->rd_istemp) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot attach as partition of temporary relation of another session"))); /* Ditto for the partition */ if (attachrel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && - !attachrel->rd_islocaltemp) + !attachrel->rd_istemp) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot attach temporary relation of another session as partition"))); @@ -17246,3 +17334,20 @@ ATDetachCheckNoForeignKeyRefs(Relation partition) table_close(rel, NoLock); } } + +static bool +has_oncommit_option(List *options) +{ + ListCell *listptr; + + foreach(listptr, options) + { + DefElem *def = (DefElem *) lfirst(listptr); + + if (pg_strcasecmp(def->defname, "on_commit_delete_rows") == 0) + return true; + } + + return false; +} + diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index d625d17..69ad24f 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -35,6 +35,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/defrem.h" #include "commands/vacuum.h" @@ -1217,6 +1218,17 @@ vac_update_relstats(Relation relation, HeapTuple ctup; Form_pg_class pgcform; bool dirty; + bool is_gtt = false; + + /* global temp table remember relstats to localhash and rel->rd_rel, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(relation)) + { + is_gtt = true; + up_gtt_relstats(relation, + num_pages, num_tuples, + num_all_visible_pages, + frozenxid, minmulti); + } rd = table_open(RelationRelationId, RowExclusiveLock); @@ -1230,17 +1242,26 @@ vac_update_relstats(Relation relation, /* Apply statistical updates, if any, to copied tuple */ dirty = false; - if (pgcform->relpages != (int32) num_pages) + + if (is_gtt) + relation->rd_rel->relpages = (int32) num_pages; + else if (pgcform->relpages != (int32) num_pages) { pgcform->relpages = (int32) num_pages; dirty = true; } - if (pgcform->reltuples != (float4) num_tuples) + + if (is_gtt) + relation->rd_rel->reltuples = (float4) num_tuples; + else if (pgcform->reltuples != (float4) num_tuples) { pgcform->reltuples = (float4) num_tuples; dirty = true; } - if (pgcform->relallvisible != (int32) num_all_visible_pages) + + if (is_gtt) + relation->rd_rel->relallvisible = (int32) num_all_visible_pages; + else if (pgcform->relallvisible != (int32) num_all_visible_pages) { pgcform->relallvisible = (int32) num_all_visible_pages; dirty = true; @@ -1285,7 +1306,8 @@ vac_update_relstats(Relation relation, * This should match vac_update_datfrozenxid() concerning what we consider * to be "in the future". */ - if (TransactionIdIsNormal(frozenxid) && + if (!is_gtt && + TransactionIdIsNormal(frozenxid) && pgcform->relfrozenxid != frozenxid && (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || TransactionIdPrecedes(ReadNewTransactionId(), @@ -1296,7 +1318,8 @@ vac_update_relstats(Relation relation, } /* Similarly for relminmxid */ - if (MultiXactIdIsValid(minmulti) && + if (!is_gtt && + MultiXactIdIsValid(minmulti) && pgcform->relminmxid != minmulti && (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) @@ -1394,6 +1417,10 @@ vac_update_datfrozenxid(void) continue; } + /* global temp table relstats not in pg_class */ + if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + continue; + /* * Some table AMs might not need per-relation xid / multixid horizons. * It therefore seems reasonable to allow relfrozenxid and relminmxid @@ -1451,6 +1478,25 @@ vac_update_datfrozenxid(void) Assert(TransactionIdIsNormal(newFrozenXid)); Assert(MultiXactIdIsValid(newMinMulti)); + /* + * Global temp table get frozenxid from MyProc + * to avoid the vacuum truncate clog that gtt need. + */ + if (max_active_gtt > 0) + { + TransactionId oldest_gtt_frozenxid = + list_all_session_gtt_frozenxids(0, NULL, NULL, NULL); + + if (TransactionIdIsNormal(oldest_gtt_frozenxid) && + TransactionIdPrecedes(oldest_gtt_frozenxid, newFrozenXid)) + { + ereport(WARNING, + (errmsg("global temp table oldest FrozenXid is far in the past"), + errhint("please truncate them or kill those sessions that use them."))); + newFrozenXid = oldest_gtt_frozenxid; + } + } + /* Now fetch the pg_database tuple we need to update. */ relation = table_open(DatabaseRelationId, RowExclusiveLock); diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 8286d9c..c3992a4 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -591,6 +591,8 @@ static void set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) { + char relpersistence; + /* * The flag has previously been initialized to false, so we can just * return if it becomes clear that we can't safely set it. @@ -618,7 +620,11 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, * the rest of the necessary infrastructure right now anyway. So * for now, bail out if we see a temporary table. */ - if (get_rel_persistence(rte->relid) == RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + relpersistence = get_rel_persistence(rte->relid); + + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) return; /* diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index d6f2153..310a9e2 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -6312,7 +6312,9 @@ plan_create_index_workers(Oid tableOid, Oid indexOid) * Furthermore, any index predicate or index expressions must be parallel * safe. */ + /* global temp table is same as local temp table */ if (heap->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + heap->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP || !is_parallel_safe(root, (Node *) RelationGetIndexExpressions(index)) || !is_parallel_safe(root, (Node *) RelationGetIndexPredicate(index))) { diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 748bebf..a5ddbcd 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2579,6 +2579,11 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("materialized views must not use temporary tables or views"))); + if (is_query_using_gtt(query)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialized views must not use global temporary tables or views"))); + /* * A materialized view would either need to save parameters for use in * maintaining/loading the data or prohibit them entirely. The latter diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index ba5916b..0ee6931 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3290,17 +3290,11 @@ OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; } | LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; } | GLOBAL TEMPORARY { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; } | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; } @@ -11588,19 +11582,13 @@ OptTempTableName: } | GLOBAL TEMPORARY opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED opt_table qualified_name { diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index b875a50..123945b 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -81,6 +81,7 @@ static void expandTupleDesc(TupleDesc tupdesc, Alias *eref, List **colnames, List **colvars); static int specialAttNum(const char *attname); static bool isQueryUsingTempRelation_walker(Node *node, void *context); +static bool is_query_using_gtt_walker(Node *node, void *context); /* @@ -3579,3 +3580,49 @@ isQueryUsingTempRelation_walker(Node *node, void *context) isQueryUsingTempRelation_walker, context); } + +/* check if the query uses global temp table */ +static bool +is_query_using_gtt_walker(Node *node, void *context) +{ + if (node == NULL) + return false; + + if (IsA(node, Query)) + { + Query *query = (Query *) node; + ListCell *rtable; + + foreach(rtable, query->rtable) + { + RangeTblEntry *rte = lfirst(rtable); + + if (rte->rtekind == RTE_RELATION) + { + Relation rel = relation_open(rte->relid, AccessShareLock); + char relpersistence = rel->rd_rel->relpersistence; + + relation_close(rel, AccessShareLock); + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + return true; + } + } + + return query_tree_walker(query, + is_query_using_gtt_walker, + context, + QTW_IGNORE_JOINALIASES); + } + + return expression_tree_walker(node, + is_query_using_gtt_walker, + context); +} + +/* check if the query uses global temp table */ +bool +is_query_using_gtt(Query *query) +{ + return is_query_using_gtt_walker((Node *) query, NULL); +} + diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index ee2d2b5..9c9abaa 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -437,6 +437,9 @@ generateSerialExtraStmts(CreateStmtContext *cxt, ColumnDef *column, seqstmt->sequence = makeRangeVar(snamespace, sname, -1); seqstmt->options = seqoptions; + if (cxt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + seqstmt->sequence->relpersistence = cxt->relation->relpersistence; + /* * If a sequence data type was specified, add it to the options. Prepend * to the list rather than append; in case a user supplied their own AS diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 6d1f28c..ed837d1 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2086,6 +2086,11 @@ do_autovacuum(void) } continue; } + else if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + /* autovacuum skip vacuum global temp table */ + continue; + } /* Fetch reloptions and the pgstat entry for this table */ relopts = extract_autovac_opts(tuple, pg_class_desc); @@ -2152,7 +2157,9 @@ do_autovacuum(void) /* * We cannot safely process other backends' temp tables, so skip 'em. */ - if (classForm->relpersistence == RELPERSISTENCE_TEMP) + /* autovacuum skip vacuum global temp table */ + if (classForm->relpersistence == RELPERSISTENCE_TEMP || + classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) continue; relid = classForm->oid; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index aba3960..3c4b96c 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -37,6 +37,7 @@ #include "access/xlog.h" #include "catalog/catalog.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "executor/instrument.h" #include "lib/binaryheap.h" #include "miscadmin.h" @@ -52,6 +53,7 @@ #include "utils/rel.h" #include "utils/resowner_private.h" #include "utils/timestamp.h" +#include "utils/guc.h" /* Note: these two macros only work on shared buffers, not local ones! */ @@ -432,7 +434,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref) static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, - bool *hit); + bool *hit, Relation rel); static bool PinBuffer(BufferDesc *buf, BufferAccessStrategy strategy); static void PinBuffer_Locked(BufferDesc *buf); static void UnpinBuffer(BufferDesc *buf, bool fixOwner); @@ -664,7 +666,8 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, */ pgstat_count_buffer_read(reln); buf = ReadBuffer_common(reln->rd_smgr, reln->rd_rel->relpersistence, - forkNum, blockNum, mode, strategy, &hit); + forkNum, blockNum, mode, strategy, &hit, + reln); if (hit) pgstat_count_buffer_hit(reln); return buf; @@ -692,7 +695,7 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, Assert(InRecovery); return ReadBuffer_common(smgr, RELPERSISTENCE_PERMANENT, forkNum, blockNum, - mode, strategy, &hit); + mode, strategy, &hit, NULL); } @@ -704,7 +707,8 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, - BufferAccessStrategy strategy, bool *hit) + BufferAccessStrategy strategy, bool *hit, + Relation rel) { BufferDesc *bufHdr; Block bufBlock; @@ -719,6 +723,15 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, isExtend = (blockNum == P_NEW); + /* create storage when first read data page for gtt */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (isExtend || blockNum == 0) && + forkNum == MAIN_FORKNUM && + !gtt_storage_attached(smgr->smgr_rnode.node.relNode)) + { + RelationCreateStorage(smgr->smgr_rnode.node, relpersistence, rel); + } + TRACE_POSTGRESQL_BUFFER_READ_START(forkNum, blockNum, smgr->smgr_rnode.node.spcNode, smgr->smgr_rnode.node.dbNode, @@ -2809,6 +2822,16 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln) BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum) { + /* + * When this backend not init gtt storage + * return 0 + */ + if (RELATION_IS_GLOBAL_TEMP(relation) && + !gtt_storage_attached(relation->rd_node.relNode)) + { + return 0; + } + switch (relation->rd_rel->relkind) { case RELKIND_SEQUENCE: diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c index 427b0d5..7adb969 100644 --- a/src/backend/storage/ipc/ipci.c +++ b/src/backend/storage/ipc/ipci.c @@ -21,6 +21,7 @@ #include "access/nbtree.h" #include "access/subtrans.h" #include "access/twophase.h" +#include "catalog/storage_gtt.h" #include "commands/async.h" #include "miscadmin.h" #include "pgstat.h" @@ -147,6 +148,7 @@ CreateSharedMemoryAndSemaphores(void) size = add_size(size, BTreeShmemSize()); size = add_size(size, SyncScanShmemSize()); size = add_size(size, AsyncShmemSize()); + size = add_size(size, active_gtt_shared_hash_size()); #ifdef EXEC_BACKEND size = add_size(size, ShmemBackendArraySize()); #endif @@ -217,6 +219,8 @@ CreateSharedMemoryAndSemaphores(void) SUBTRANSShmemInit(); MultiXactShmemInit(); InitBufferPool(); + /* global temporary table */ + active_gtt_shared_hash_init(); /* * Set up lock manager diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index c3adb2e..eb95e5f 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -62,6 +62,7 @@ #include "utils/builtins.h" #include "utils/rel.h" #include "utils/snapmgr.h" +#include "utils/guc.h" #define UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) @@ -4087,3 +4088,77 @@ KnownAssignedXidsReset(void) LWLockRelease(ProcArrayLock); } + +/* + * search all active backend to get oldest frozenxid + * for global temp table. + */ +int +list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n) +{ + ProcArrayStruct *arrayP = procArray; + TransactionId result = InvalidTransactionId; + int index; + int flags = 0; + int i = 0; + + if (max_active_gtt <= 0) + return 0; + + if (max_size > 0) + { + Assert(pids); + Assert(xids); + Assert(n); + *n = 0; + } + + if (max_active_gtt <= 0) + return InvalidTransactionId; + + if (RecoveryInProgress()) + return InvalidTransactionId; + + flags |= PROC_IS_AUTOVACUUM; + flags |= PROC_IN_LOGICAL_DECODING; + + LWLockAcquire(ProcArrayLock, LW_SHARED); + if (max_size > 0 && max_size < arrayP->numProcs) + { + LWLockRelease(ProcArrayLock); + elog(ERROR, "list_all_gtt_frozenxids require more array"); + } + + for (index = 0; index < arrayP->numProcs; index++) + { + int pgprocno = arrayP->pgprocnos[index]; + volatile PGPROC *proc = &allProcs[pgprocno]; + volatile PGXACT *pgxact = &allPgXact[pgprocno]; + + if (pgxact->vacuumFlags & flags) + continue; + + if (proc->databaseId == MyDatabaseId && + TransactionIdIsNormal(proc->session_gtt_frozenxid)) + { + if (result == InvalidTransactionId) + result = proc->session_gtt_frozenxid; + else if (TransactionIdPrecedes(proc->session_gtt_frozenxid, result)) + result = proc->session_gtt_frozenxid; + + if (max_size > 0) + { + pids[i] = proc->pid; + xids[i] = proc->session_gtt_frozenxid; + i++; + } + } + } + LWLockRelease(ProcArrayLock); + + if (max_size > 0) + *n = i; + + return result; +} + diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 32df8c8..e4e1125 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -395,6 +395,7 @@ InitProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; @@ -577,6 +578,7 @@ InitAuxiliaryProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index c5b771c..e7725ce 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -646,6 +646,12 @@ mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, */ if (zero_damaged_pages || InRecovery) MemSet(buffer, 0, BLCKSZ); + else if(SmgrIsTemp(reln) && blocknum == 0 && forknum == MAIN_FORKNUM) + { + /* global temp table init btree meta page */ + MemSet(buffer, 0, BLCKSZ); + mdwrite(reln, forknum, blocknum, buffer, true); + } else ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c index 8406644..0d99321 100644 --- a/src/backend/utils/adt/dbsize.c +++ b/src/backend/utils/adt/dbsize.c @@ -1008,6 +1008,9 @@ pg_relation_filepath(PG_FUNCTION_ARGS) Assert(backend != InvalidBackendId); } break; + case RELPERSISTENCE_GLOBAL_TEMP: + backend = BackendIdForTempRelations(); + break; default: elog(ERROR, "invalid relpersistence: %c", relform->relpersistence); backend = InvalidBackendId; /* placate compiler */ diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 7c6f057..eb10cf2 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -112,6 +112,7 @@ #include "catalog/pg_operator.h" #include "catalog/pg_statistic.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "executor/nodeAgg.h" #include "miscadmin.h" #include "nodes/makefuncs.h" @@ -4578,12 +4579,25 @@ examine_variable(PlannerInfo *root, Node *node, int varRelid, } else if (index->indpred == NIL) { - vardata->statsTuple = - SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(index->indexoid), - Int16GetDatum(pos + 1), - BoolGetDatum(false)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(index->indexoid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = + get_gtt_att_statistic(index->indexoid, + Int16GetDatum(pos + 1), + false); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + vardata->statsTuple = + SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(index->indexoid), + Int16GetDatum(pos + 1), + BoolGetDatum(false)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -4708,15 +4722,27 @@ examine_simple_variable(PlannerInfo *root, Var *var, } else if (rte->rtekind == RTE_RELATION) { - /* - * Plain table or parent of an inheritance appendrel, so look up the - * column in pg_statistic - */ - vardata->statsTuple = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(rte->relid), - Int16GetDatum(var->varattno), - BoolGetDatum(rte->inh)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(rte->relid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = get_gtt_att_statistic(rte->relid, + var->varattno, + rte->inh); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + /* + * Plain table or parent of an inheritance appendrel, so look up the + * column in pg_statistic + */ + vardata->statsTuple = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(rte->relid), + Int16GetDatum(var->varattno), + BoolGetDatum(rte->inh)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -6098,6 +6124,7 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, { /* Simple variable --- look to stats for the underlying table */ RangeTblEntry *rte = planner_rt_fetch(index->rel->relid, root); + char rel_persistence = get_rel_persistence(rte->relid); Assert(rte->rtekind == RTE_RELATION); relid = rte->relid; @@ -6115,6 +6142,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + rte->inh); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -6126,6 +6160,8 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* Expression --- maybe there are stats for the index itself */ relid = index->indexoid; colnum = 1; @@ -6141,6 +6177,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -7054,6 +7097,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, /* attempt to lookup stats in relation for this index column */ if (attnum != 0) { + char rel_persistence = get_rel_persistence(rte->relid); + /* Simple variable -- look to stats for the underlying table */ if (get_relation_stats_hook && (*get_relation_stats_hook) (root, rte, attnum, &vardata)) @@ -7066,6 +7111,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(rte->relid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = @@ -7078,6 +7131,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* * Looks like we've found an expression column in the index. Let's * see if there's any stats for it. @@ -7097,6 +7152,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(index->indexoid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 1e3e6d3..345e3e9 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -34,6 +34,7 @@ #include "catalog/pg_statistic.h" #include "catalog/pg_transform.h" #include "catalog/pg_type.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "utils/array.h" @@ -2878,6 +2879,18 @@ get_attavgwidth(Oid relid, AttrNumber attnum) if (stawidth > 0) return stawidth; } + if (get_rel_persistence(relid) == RELPERSISTENCE_GLOBAL_TEMP) + { + tp = get_gtt_att_statistic(relid, attnum, false); + if (!HeapTupleIsValid(tp)) + return 0; + + stawidth = ((Form_pg_statistic) GETSTRUCT(tp))->stawidth; + if (stawidth > 0) + return stawidth; + else + return 0; + } tp = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(relid), Int16GetDatum(attnum), diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index df025a5..e33269b 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -63,6 +63,7 @@ #include "catalog/pg_type.h" #include "catalog/schemapg.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/policy.h" #include "commands/trigger.h" #include "miscadmin.h" @@ -1095,13 +1096,13 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) case RELPERSISTENCE_UNLOGGED: case RELPERSISTENCE_PERMANENT: relation->rd_backend = InvalidBackendId; - relation->rd_islocaltemp = false; + relation->rd_istemp = false; break; case RELPERSISTENCE_TEMP: if (isTempOrTempToastNamespace(relation->rd_rel->relnamespace)) { relation->rd_backend = BackendIdForTempRelations(); - relation->rd_islocaltemp = true; + relation->rd_istemp = true; } else { @@ -1114,14 +1115,36 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) * from a crashed backend that coincidentally had the same * BackendId we're using. We should *not* consider such a * table to be "ours"; this is why we need the separate - * rd_islocaltemp flag. The pg_class entry will get flushed + * rd_istemp flag. The pg_class entry will get flushed * if/when we clean out the corresponding temp table namespace * in preparation for using it. */ relation->rd_backend = GetTempNamespaceBackendId(relation->rd_rel->relnamespace); Assert(relation->rd_backend != InvalidBackendId); - relation->rd_islocaltemp = false; + relation->rd_istemp = false; + } + break; + case RELPERSISTENCE_GLOBAL_TEMP: + { + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + + relation->rd_backend = BackendIdForTempRelations(); + /* + * For global temp table, all backend can use + * this relation, so rd_istemp always true. + */ + relation->rd_istemp = true; + get_gtt_relstats(RelationGetRelid(relation), + &relpages, + &reltuples, + &relallvisible, + NULL, NULL); + relation->rd_rel->relpages = (int32)relpages; + relation->rd_rel->reltuples = (float4)reltuples; + relation->rd_rel->relallvisible = (int32)relallvisible; } break; default: @@ -1178,6 +1201,7 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) case RELKIND_PARTITIONED_INDEX: Assert(relation->rd_rel->relam != InvalidOid); RelationInitIndexAccessInfo(relation); + gtt_fix_index_state(relation); break; case RELKIND_RELATION: case RELKIND_TOASTVALUE: @@ -1815,7 +1839,7 @@ formrdesc(const char *relationName, Oid relationReltype, relation->rd_createSubid = InvalidSubTransactionId; relation->rd_newRelfilenodeSubid = InvalidSubTransactionId; relation->rd_backend = InvalidBackendId; - relation->rd_islocaltemp = false; + relation->rd_istemp = false; /* * initialize relation tuple form @@ -2217,6 +2241,8 @@ RelationReloadIndexInfo(Relation relation) HeapTupleHeaderGetXmin(tuple->t_data)); ReleaseSysCache(tuple); + + gtt_fix_index_state(relation); } /* Okay, now it's valid again */ @@ -3306,12 +3332,16 @@ RelationBuildLocalRelation(const char *relname, case RELPERSISTENCE_UNLOGGED: case RELPERSISTENCE_PERMANENT: rel->rd_backend = InvalidBackendId; - rel->rd_islocaltemp = false; + rel->rd_istemp = false; break; case RELPERSISTENCE_TEMP: Assert(isTempOrTempToastNamespace(relnamespace)); rel->rd_backend = BackendIdForTempRelations(); - rel->rd_islocaltemp = true; + rel->rd_istemp = true; + break; + case RELPERSISTENCE_GLOBAL_TEMP: + rel->rd_backend = BackendIdForTempRelations(); + rel->rd_istemp = true; break; default: elog(ERROR, "invalid relpersistence: %c", relpersistence); @@ -3427,6 +3457,9 @@ RelationSetNewRelfilenode(Relation relation, char persistence) TransactionId freezeXid = InvalidTransactionId; RelFileNode newrnode; + if (RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "global temp table does not allow setting new relfilenode"); + /* Allocate a new relfilenode */ newrelfilenode = GetNewRelFileNode(relation->rd_rel->reltablespace, NULL, persistence); @@ -3467,7 +3500,7 @@ RelationSetNewRelfilenode(Relation relation, char persistence) /* handle these directly, at least for now */ SMgrRelation srel; - srel = RelationCreateStorage(newrnode, persistence); + srel = RelationCreateStorage(newrnode, persistence, relation); smgrclose(srel); } break; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index cacbe90..9c4220b 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -140,6 +140,18 @@ char *GUC_check_errmsg_string; char *GUC_check_errdetail_string; char *GUC_check_errhint_string; +/* + * num = 0 means disable global temp table feature. + * global temp table define can still storage in catalog + * just can not use. + * num > 0 means database can management num active global temp table. + */ +#define MIN_NUM_ACTIVE_GTT 0 +#define DEFAULT_NUM_ACTIVE_GTT 1000 +#define MAX_NUM_ACTIVE_GTT 1000000 + +int max_active_gtt = MIN_NUM_ACTIVE_GTT; + static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3, 4); static void set_config_sourcefile(const char *name, char *sourcefile, @@ -2012,6 +2024,15 @@ static struct config_bool ConfigureNamesBool[] = static struct config_int ConfigureNamesInt[] = { { + {"max_active_global_temporary_table", PGC_POSTMASTER, UNGROUPED, + gettext_noop("max active global temporary table."), + NULL + }, + &max_active_gtt, + DEFAULT_NUM_ACTIVE_GTT, MIN_NUM_ACTIVE_GTT, MAX_NUM_ACTIVE_GTT, + NULL, NULL, NULL + }, + { {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Forces a switch to the next WAL file if a " "new file has not been started within N seconds."), diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 799b698..b98d396 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15583,6 +15583,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) { char *ftoptions = NULL; char *srvname = NULL; + char *table_type = NULL; switch (tbinfo->relkind) { @@ -15634,9 +15635,15 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) binary_upgrade_set_pg_class_oids(fout, q, tbinfo->dobj.catId.oid, false); + if (tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED) + table_type = "UNLOGGED "; + else if (tbinfo->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + table_type = "GLOBAL TEMPORARY "; + else + table_type = ""; + appendPQExpBuffer(q, "CREATE %s%s %s", - tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ? - "UNLOGGED " : "", + table_type, reltypename, qualrelname); diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index f3c7eb9..28134e2 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3723,7 +3723,8 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys if (pset.sversion >= 90100) { appendPQExpBuffer(&buf, - ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + ",\n CASE c.relpersistence WHEN 'g' THEN '%s' WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + gettext_noop("session"), gettext_noop("permanent"), gettext_noop("temporary"), gettext_noop("unlogged"), diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index dc03fbd..8bd6d09 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -1016,6 +1016,8 @@ static const pgsql_thing_t words_after_create[] = { {"FOREIGN TABLE", NULL, NULL, NULL}, {"FUNCTION", NULL, NULL, Query_for_list_of_functions}, {"GROUP", Query_for_list_of_roles}, + {"GLOBAL", NULL, NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE GLOBAL TEMP/TEMPORARY TABLE + * ... */ {"INDEX", NULL, NULL, &Query_for_list_of_indexes}, {"LANGUAGE", Query_for_list_of_languages}, {"LARGE OBJECT", NULL, NULL, NULL, THING_NO_CREATE | THING_NO_DROP}, @@ -2378,6 +2380,9 @@ psql_completion(const char *text, int start, int end) /* CREATE FOREIGN DATA WRAPPER */ else if (Matches("CREATE", "FOREIGN", "DATA", "WRAPPER", MatchAny)) COMPLETE_WITH("HANDLER", "VALIDATOR", "OPTIONS"); + /* CREATE GLOBAL TEMP/TEMPORARY*/ + else if (Matches("CREATE", "GLOBAL")) + COMPLETE_WITH("TEMP", "TEMPORARY"); /* CREATE INDEX --- is allowed inside CREATE SCHEMA, so use TailMatches */ /* First off we complete CREATE UNIQUE with "INDEX" */ @@ -2586,6 +2591,8 @@ psql_completion(const char *text, int start, int end) /* Complete "CREATE TEMP/TEMPORARY" with the possible temp objects */ else if (TailMatches("CREATE", "TEMP|TEMPORARY")) COMPLETE_WITH("SEQUENCE", "TABLE", "VIEW"); + else if (TailMatches("CREATE", "GLOBAL", "TEMP|TEMPORARY")) + COMPLETE_WITH("TABLE"); /* Complete "CREATE UNLOGGED" with TABLE or MATVIEW */ else if (TailMatches("CREATE", "UNLOGGED")) COMPLETE_WITH("TABLE", "MATERIALIZED VIEW"); diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index a12fc1f..78958e4 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -165,6 +165,7 @@ typedef FormData_pg_class *Form_pg_class; #define RELPERSISTENCE_PERMANENT 'p' /* regular table */ #define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */ #define RELPERSISTENCE_TEMP 't' /* temporary table */ +#define RELPERSISTENCE_GLOBAL_TEMP 'g' /* global temporary table */ /* default selection for replica identity (primary key or nothing) */ #define REPLICA_IDENTITY_DEFAULT 'd' diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index bef50c7..bc36c6c 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5504,6 +5504,40 @@ proparallel => 'r', prorettype => 'float8', proargtypes => 'oid', prosrc => 'pg_stat_get_xact_function_self_time' }, +# For global temporary table +{ oid => '4191', + descr => 'List local statistics for global temporary table', + proname => 'pg_get_gtt_statistics', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid int4 anyelement', + proallargtypes => '{oid,int4,anyelement,oid,int2,bool,float4,int4,float4,int2,int2,int2,int2,int2,oid,oid,oid,oid,oid,oid,oid,oid,oid,oid,_float4,_float4,_float4,_float4,_float4,anyarray,anyarray,anyarray,anyarray,anyarray}', + proargmodes => '{i,i,i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}', + proargnames => '{relid,att,x,starelid,staattnum,stainherit,stanullfrac,stawidth,stadistinct,stakind1,stakind2,stakind3,stakind4,stakind5,staop1,staop2,staop3,staop4,staop5,stacoll1,stacoll2,stacoll3,stacoll4,stacoll5,stanumbers1,stanumbers2,stanumbers3,stanumbers4,stanumbers5,stavalues1,stavalues2,stavalues3,stavalues4,stavalues5}', + prosrc => 'pg_get_gtt_statistics' }, +{ oid => '4192', + descr => 'List local relstats for global temporary table', + proname => 'pg_get_gtt_relstats', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,int4,float4,int4,xid,xid}', + proargmodes => '{i,o,o,o,o,o}', + proargnames => '{relid,relpages,reltuples,relallvisible,relfrozenxid,relminmxid}', + prosrc => 'pg_get_gtt_relstats' }, +{ oid => '4193', + descr => 'List attached pid for one global temporary table', + proname => 'pg_gtt_attached_pid', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,oid,int4}', + proargmodes => '{i,o,o}', + proargnames => '{relid,relid,pid}', + prosrc => 'pg_gtt_attached_pid' }, +{ oid => '4194', + descr => 'List those backends that have used global temporary table', + proname => 'pg_list_gtt_relfrozenxids', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => '', + proallargtypes => '{int4,xid}', + proargmodes => '{o,o}', + proargnames => '{pid,relfrozenxid}', + prosrc => 'pg_list_gtt_relfrozenxids' }, + { oid => '3788', descr => 'statistics: timestamp of the current statistics snapshot', proname => 'pg_stat_get_snapshot_timestamp', provolatile => 's', diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h index 048003c..af48cdf 100644 --- a/src/include/catalog/storage.h +++ b/src/include/catalog/storage.h @@ -19,7 +19,7 @@ #include "storage/smgr.h" #include "utils/relcache.h" -extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence); +extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel); extern void RelationDropStorage(Relation rel); extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit); extern void RelationTruncate(Relation rel, BlockNumber nblocks); diff --git a/src/include/catalog/storage_gtt.h b/src/include/catalog/storage_gtt.h new file mode 100644 index 0000000..aa80cb5 --- /dev/null +++ b/src/include/catalog/storage_gtt.h @@ -0,0 +1,41 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.h + * prototypes for functions in backend/catalog/storage_gtt.c + * + * src/include/catalog/storage_gtt.h + * + *------------------------------------------------------------------------- + */ +#ifndef STORAGE_GTT_H +#define STORAGE_GTT_H + +#include "access/htup.h" +#include "storage/block.h" +#include "storage/relfilenode.h" +#include "utils/relcache.h" + +extern Size active_gtt_shared_hash_size(void); +extern void active_gtt_shared_hash_init(void); +extern void remember_gtt_storage_info(RelFileNode rnode, Relation rel); +extern void forget_gtt_storage_info(Oid relid); +extern bool is_other_backend_use_gtt(RelFileNode node); +extern bool gtt_storage_attached(Oid relid); +extern Bitmapset *copy_active_gtt_bitmap(RelFileNode node); +extern void up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull); +extern HeapTuple get_gtt_att_statistic(Oid reloid, int attnum, bool inh); +extern void release_gtt_statistic_cache(HeapTuple tup); +extern void up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid); +extern bool get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid); +extern void gtt_force_enable_index(Relation index); +extern void gtt_fix_index_state(Relation index); + +#endif /* STORAGE_H */ diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index 93f9446..14cafae 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -120,4 +120,7 @@ extern Oid attnumTypeId(Relation rd, int attid); extern Oid attnumCollationId(Relation rd, int attid); extern bool isQueryUsingTempRelation(Query *query); +/* global temp table check */ +extern bool is_query_using_gtt(Query *query); + #endif /* PARSE_RELATION_H */ diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 870ecb5..92c590e 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -405,6 +405,8 @@ do { \ #define PageClearPrunable(page) \ (((PageHeader) (page))->pd_prune_xid = InvalidTransactionId) +#define GlobalTempRelationPageIsNotInitialized(rel, page) \ + ((rel)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && PageIsNew(page)) /* ---------------------------------------------------------------- * extern declarations diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 8fda8e4..172eae9 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -220,6 +220,7 @@ typedef enum BuiltinTrancheIds LWTRANCHE_TBM, LWTRANCHE_PARALLEL_APPEND, LWTRANCHE_SXACT, + LWTRANCHE_GTT_CTL, LWTRANCHE_FIRST_USER_DEFINED } BuiltinTrancheIds; diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index d217801..8adde87 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -117,6 +117,8 @@ struct PGPROC Oid tempNamespaceId; /* OID of temp schema this backend is * using */ + TransactionId session_gtt_frozenxid; /* session level global temp table relfrozenxid */ + bool isBackgroundWorker; /* true if background worker. */ /* diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index a5c7d0c..a86f61f 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -125,4 +125,6 @@ extern void ProcArraySetReplicationSlotXmin(TransactionId xmin, extern void ProcArrayGetReplicationSlotXmin(TransactionId *xmin, TransactionId *catalog_xmin); +extern int list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n); + #endif /* PROCARRAY_H */ diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index ce93ace..0f7262e 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -281,6 +281,10 @@ extern int tcp_user_timeout; extern bool trace_sort; #endif +/* global temporary table */ +extern int max_active_gtt; +/* end */ + /* * Functions exported by guc.c */ diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 44ed04d..9f29744 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -57,7 +57,7 @@ typedef struct RelationData struct SMgrRelationData *rd_smgr; /* cached file handle, or NULL */ int rd_refcnt; /* reference count */ BackendId rd_backend; /* owning backend id, if temporary relation */ - bool rd_islocaltemp; /* rel is a temp rel of this session */ + bool rd_istemp; /* rel is a temp rel of this session */ bool rd_isnailed; /* rel is nailed in cache */ bool rd_isvalid; /* relcache entry is valid */ bool rd_indexvalid; /* is rd_indexlist valid? (also rd_pkindex and @@ -277,6 +277,7 @@ typedef struct StdRdOptions int parallel_workers; /* max number of parallel workers */ bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */ bool vacuum_truncate; /* enables vacuum to truncate a relation */ + bool on_commit_delete_rows; /* global temp table */ } StdRdOptions; #define HEAP_MIN_FILLFACTOR 10 @@ -535,7 +536,8 @@ typedef struct ViewOptions * True if relation's pages are stored in local buffers. */ #define RelationUsesLocalBuffers(relation) \ - ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP || \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) /* * RELATION_IS_LOCAL @@ -546,7 +548,7 @@ typedef struct ViewOptions * Beware of multiple eval of argument */ #define RELATION_IS_LOCAL(relation) \ - ((relation)->rd_islocaltemp || \ + ((relation)->rd_istemp || \ (relation)->rd_createSubid != InvalidSubTransactionId) /* @@ -557,7 +559,7 @@ typedef struct ViewOptions */ #define RELATION_IS_OTHER_TEMP(relation) \ ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP && \ - !(relation)->rd_islocaltemp) + !(relation)->rd_istemp) /* @@ -602,6 +604,17 @@ typedef struct ViewOptions RelationNeedsWAL(relation) && \ !IsCatalogRelation(relation)) +/* global temp table implementations */ +#define RELATION_IS_GLOBAL_TEMP(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + +#define RELATION_GTT_ON_COMMIT_DELETE(relation) \ + ((relation)->rd_options && \ + ((relation)->rd_rel->relkind == RELKIND_RELATION || (relation)->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) && \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP ? \ + ((StdRdOptions *) (relation)->rd_options)->on_commit_delete_rows : false) + +#define RelationGetRelPersistence(relation) ((relation)->rd_rel->relpersistence) + /* routines in utils/cache/relcache.c */ extern void RelationIncrementReferenceCount(Relation rel); extern void RelationDecrementReferenceCount(Relation rel); diff --git a/src/test/regress/expected/gtt_clean.out b/src/test/regress/expected/gtt_clean.out new file mode 100644 index 0000000..50ca9ac --- /dev/null +++ b/src/test/regress/expected/gtt_clean.out @@ -0,0 +1,7 @@ +reset search_path; +drop schema gtt cascade; +NOTICE: drop cascades to 4 other objects +DETAIL: drop cascades to table gtt.gtt1 +drop cascades to table gtt.gtt2 +drop cascades to table gtt.gtt3 +drop cascades to table gtt.gtt_t_kenyon diff --git a/src/test/regress/expected/gtt_function.out b/src/test/regress/expected/gtt_function.out new file mode 100644 index 0000000..a477917 --- /dev/null +++ b/src/test/regress/expected/gtt_function.out @@ -0,0 +1,197 @@ +CREATE SCHEMA IF NOT EXISTS gtt_function; +set search_path=gtt_function,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt_test_rename(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); +ERROR: cannot create indexes on global temporary tables using concurrent mode +-- ERROR +cluster gtt1 using gtt1_pkey; +ERROR: not support cluster global temporary tables yet +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; +ERROR: ON COMMIT can only be used on temporary tables +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); +ERROR: regular table cannot specifie on_commit_delete_rows +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; + count +------- + 2 +(1 row) + +commit; +select count(*) from p_table01; + count +------- + 0 +(1 row) + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +ERROR: The parent table must be global temporary table +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + relname | relkind | relpersistence | reloptions +---------------------------------+---------+----------------+------------------------------- + p_table01 | p | g | {on_commit_delete_rows=true} + p_table01_2017 | r | g | {on_commit_delete_rows=true} + p_table01_2018 | r | g | {on_commit_delete_rows=true} + p_table01_id_seq | S | g | + p_table02 | p | g | {on_commit_delete_rows=false} + p_table02_2017 | r | g | {on_commit_delete_rows=false} + p_table02_2018 | r | g | {on_commit_delete_rows=false} + p_table02_id_seq | S | g | + tbl_inherits_parent | r | p | + tbl_inherits_parent_global_temp | r | g | {on_commit_delete_rows=true} + tbl_inherits_partition | r | g | {on_commit_delete_rows=true} +(11 rows) + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; +ERROR: global temp table not support on commit drop clause +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; +ERROR: can not defeine global temp table with on commit and with clause at same time +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); +--ok +alter table gtt_test_rename rename to gtt_test; +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; + id | a +----+--- + 2 | 1 + 3 | 2 +(2 rows) + +truncate gtt_seq; +select * from gtt_seq order by id; + id | a +----+--- +(0 rows) + +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + id | a +----+--- + 4 | 3 +(1 row) + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; +ERROR: materialized views must not use global temporary tables or views +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +ERROR: only support btree index on global temp table +create index idx_err on gtt1 using gist (a); +ERROR: data type integer has no default operator class for access method "gist" +HINT: You must specify an operator class for the index or define a default operator class for the data type. +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +ERROR: only support btree index on global temp table +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); +ERROR: only support btree index on global temp table +reset search_path; +drop schema gtt_function cascade; +NOTICE: drop cascades to 15 other objects +DETAIL: drop cascades to table gtt_function.gtt1 +drop cascades to table gtt_function.gtt_test +drop cascades to table gtt_function.gtt2 +drop cascades to table gtt_function.gtt3 +drop cascades to table gtt_function.tmp_t0 +drop cascades to table gtt_function.tbl_inherits_parent +drop cascades to table gtt_function.tbl_inherits_parent_global_temp +drop cascades to table gtt_function.products +drop cascades to table gtt_function.measurement +drop cascades to table gtt_function.p_table01 +drop cascades to table gtt_function.p_table02 +drop cascades to table gtt_function.tbl_inherits_partition +drop cascades to table gtt_function.gtt5 +drop cascades to table gtt_function.mytable +drop cascades to table gtt_function.gtt_seq diff --git a/src/test/regress/expected/gtt_parallel_1.out b/src/test/regress/expected/gtt_parallel_1.out new file mode 100644 index 0000000..30d8a7b --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_1.out @@ -0,0 +1,84 @@ +set search_path=gtt,sys; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_parallel_2.out b/src/test/regress/expected/gtt_parallel_2.out new file mode 100644 index 0000000..850ef3e --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_2.out @@ -0,0 +1,161 @@ +set search_path=gtt,sys; +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +commit; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 + 3 | test1 +(3 rows) + +rollback; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test2 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; + a | b +---+------- + 3 | test3 +(1 row) + +rollback; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; + a | b +---+------- + 5 | test5 +(1 row) + +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + a | b +---+------- + 6 | test6 +(1 row) + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; + count +-------- + 100000 +(1 row) + +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + QUERY PLAN +------------------------------------ + Index Scan using gtt3_pkey on gtt3 + Index Cond: (a = 300) +(2 rows) + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; + relname | pg_relation_size | pg_relation_size | pg_table_size | pg_indexes_size | pg_total_relation_size +--------------+------------------+------------------+---------------+-----------------+------------------------ + gtt_t_kenyon | 450560 | 8192 | 499712 | 475136 | 974848 +(1 row) + +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + relname +-------------- + gtt_t_kenyon +(1 row) + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + relname | pg_relation_size | pg_table_size | pg_total_relation_size +--------------------+------------------+---------------+------------------------ + idx_gtt_t_kenyon_1 | 65536 | 65536 | 65536 + idx_gtt_t_kenyon_2 | 409600 | 409600 | 409600 +(2 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_prepare.out b/src/test/regress/expected/gtt_prepare.out new file mode 100644 index 0000000..9fe5fd4 --- /dev/null +++ b/src/test/regress/expected/gtt_prepare.out @@ -0,0 +1,9 @@ +CREATE SCHEMA IF NOT EXISTS gtt; +set search_path=gtt,sys; +create global temp table gtt1(a int primary key, b text) on commit delete rows; +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text); +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; diff --git a/src/test/regress/expected/gtt_stats.out b/src/test/regress/expected/gtt_stats.out new file mode 100644 index 0000000..b258b7c --- /dev/null +++ b/src/test/regress/expected/gtt_stats.out @@ -0,0 +1,76 @@ +CREATE SCHEMA IF NOT EXISTS gtt_stats; +set search_path=gtt_stats,sys; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +insert into gtt values(generate_series(1,10000),'test'); +-- expect 1 +select count(*) from pg_gtt_attached_pids; + count +------- + 1 +(1 row) + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 2 +(1 row) + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 0 | 0 | 0 +(1 row) + +-- expect 0 +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+------------------+-------------+-------------------+------------------------+---------------------- +(0 rows) + +analyze gtt; +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 55 | 10000 | 0 +(1 row) + +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------------------+------------------------+---------------------- + gtt_stats | gtt | a | f | 0 | 4 | -1 | | | {1,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,8700,8800,8900,9000,9100,9200,9300,9400,9500,9600,9700,9800,9900,10000} | 1 | | | + gtt_stats | gtt | b | f | 0 | 5 | 1 | {test} | {1} | | 1 | | | +(2 rows) + +reset search_path; +drop schema gtt_stats cascade; +NOTICE: drop cascades to table gtt_stats.gtt diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 70e1e2f..30cf4bd 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1348,6 +1348,93 @@ pg_group| SELECT pg_authid.rolname AS groname, WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin); +pg_gtt_attached_pids| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relid, + s.pid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_gtt_attached_pid(c.oid) s(relid, pid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_relstats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relpages, + s.reltuples, + s.relallvisible, + s.relfrozenxid, + s.relminmxid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_relstats(c.oid) s(relpages, reltuples, relallvisible, relfrozenxid, relminmxid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_stats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN (s.stakind1 = 1) THEN s.stavalues1 + WHEN (s.stakind2 = 1) THEN s.stavalues2 + WHEN (s.stakind3 = 1) THEN s.stavalues3 + WHEN (s.stakind4 = 1) THEN s.stavalues4 + WHEN (s.stakind5 = 1) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_vals, + CASE + WHEN (s.stakind1 = 1) THEN s.stanumbers1 + WHEN (s.stakind2 = 1) THEN s.stanumbers2 + WHEN (s.stakind3 = 1) THEN s.stanumbers3 + WHEN (s.stakind4 = 1) THEN s.stanumbers4 + WHEN (s.stakind5 = 1) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_freqs, + CASE + WHEN (s.stakind1 = 2) THEN s.stavalues1 + WHEN (s.stakind2 = 2) THEN s.stavalues2 + WHEN (s.stakind3 = 2) THEN s.stavalues3 + WHEN (s.stakind4 = 2) THEN s.stavalues4 + WHEN (s.stakind5 = 2) THEN s.stavalues5 + ELSE NULL::text[] + END AS histogram_bounds, + CASE + WHEN (s.stakind1 = 3) THEN s.stanumbers1[1] + WHEN (s.stakind2 = 3) THEN s.stanumbers2[1] + WHEN (s.stakind3 = 3) THEN s.stanumbers3[1] + WHEN (s.stakind4 = 3) THEN s.stanumbers4[1] + WHEN (s.stakind5 = 3) THEN s.stanumbers5[1] + ELSE NULL::real + END AS correlation, + CASE + WHEN (s.stakind1 = 4) THEN s.stavalues1 + WHEN (s.stakind2 = 4) THEN s.stavalues2 + WHEN (s.stakind3 = 4) THEN s.stavalues3 + WHEN (s.stakind4 = 4) THEN s.stavalues4 + WHEN (s.stakind5 = 4) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_elems, + CASE + WHEN (s.stakind1 = 4) THEN s.stanumbers1 + WHEN (s.stakind2 = 4) THEN s.stanumbers2 + WHEN (s.stakind3 = 4) THEN s.stanumbers3 + WHEN (s.stakind4 = 4) THEN s.stanumbers4 + WHEN (s.stakind5 = 4) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_elem_freqs, + CASE + WHEN (s.stakind1 = 5) THEN s.stanumbers1 + WHEN (s.stakind2 = 5) THEN s.stanumbers2 + WHEN (s.stakind3 = 5) THEN s.stanumbers3 + WHEN (s.stakind4 = 5) THEN s.stanumbers4 + WHEN (s.stakind5 = 5) THEN s.stanumbers5 + ELSE NULL::real[] + END AS elem_count_histogram + FROM ((pg_class c + JOIN pg_attribute a ON ((c.oid = a.attrelid))) + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_statistics(c.oid, (a.attnum)::integer, ''::text) s(starelid, staattnum, stainherit, stanullfrac, stawidth, stadistinct, stakind1, stakind2, stakind3, stakind4, stakind5, staop1, staop2, staop3, staop4, staop5, stacoll1, stacoll2, stacoll3, stacoll4, stacoll5, stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5, stavalues1, stavalues2, stavalues3, stavalues4, stavalues5) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND (NOT a.attisdropped) AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); pg_hba_file_rules| SELECT a.line_number, a.type, a.database, diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index d2b17dd..80e577f 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -121,3 +121,10 @@ test: fast_default # run stats by itself because its delay may be insufficient under heavy load test: stats + +# global temp table test +test: gtt_stats +test: gtt_function +test: gtt_prepare +test: gtt_parallel_1 gtt_parallel_2 +test: gtt_clean diff --git a/src/test/regress/sql/gtt_clean.sql b/src/test/regress/sql/gtt_clean.sql new file mode 100644 index 0000000..f3cf710 --- /dev/null +++ b/src/test/regress/sql/gtt_clean.sql @@ -0,0 +1,6 @@ + + +reset search_path; + +drop schema gtt cascade; + diff --git a/src/test/regress/sql/gtt_function.sql b/src/test/regress/sql/gtt_function.sql new file mode 100644 index 0000000..cfc1879 --- /dev/null +++ b/src/test/regress/sql/gtt_function.sql @@ -0,0 +1,163 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_function; + +set search_path=gtt_function,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt_test_rename(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); + +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; + +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); + +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); + +-- ERROR +cluster gtt1 using gtt1_pkey; + +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; + +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); + +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); + +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; +commit; + +select count(*) from p_table01; + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; + +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; + +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; + +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; + +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); + +--ok +alter table gtt_test_rename rename to gtt_test; + +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); + +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; + +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; +truncate gtt_seq; +select * from gtt_seq order by id; +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; + +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +create index idx_err on gtt1 using gist (a); +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); + +reset search_path; + +drop schema gtt_function cascade; + diff --git a/src/test/regress/sql/gtt_parallel_1.sql b/src/test/regress/sql/gtt_parallel_1.sql new file mode 100644 index 0000000..d7d81de --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_1.sql @@ -0,0 +1,42 @@ + + +set search_path=gtt,sys; + +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +commit; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +rollback; +select * from gtt1 order by a; + +truncate gtt1; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +select * from gtt1 order by a; +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + +begin; +select * from gtt1 order by a; +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +commit; +select * from gtt1 order by a; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_parallel_2.sql b/src/test/regress/sql/gtt_parallel_2.sql new file mode 100644 index 0000000..5203c2b --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_2.sql @@ -0,0 +1,76 @@ + + +set search_path=gtt,sys; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; +commit; +select * from gtt3 order by a; + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +truncate gtt3; +select * from gtt3 order by a; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; +truncate gtt3; +select * from gtt3 order by a; +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +begin; +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_prepare.sql b/src/test/regress/sql/gtt_prepare.sql new file mode 100644 index 0000000..2f4d883 --- /dev/null +++ b/src/test/regress/sql/gtt_prepare.sql @@ -0,0 +1,16 @@ + +CREATE SCHEMA IF NOT EXISTS gtt; + +set search_path=gtt,sys; + +create global temp table gtt1(a int primary key, b text) on commit delete rows; + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text); + +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; + diff --git a/src/test/regress/sql/gtt_stats.sql b/src/test/regress/sql/gtt_stats.sql new file mode 100644 index 0000000..f041892 --- /dev/null +++ b/src/test/regress/sql/gtt_stats.sql @@ -0,0 +1,42 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_stats; + +set search_path=gtt_stats,sys; + +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +insert into gtt values(generate_series(1,10000),'test'); + +-- expect 1 +select count(*) from pg_gtt_attached_pids; + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +-- expect 0 +select * from pg_gtt_stats order by tablename; + +analyze gtt; + +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +select * from pg_gtt_stats order by tablename; + +reset search_path; + +drop schema gtt_stats cascade; + ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-28 16:40 Pavel Stehule <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-28 16:40 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> út 28. 1. 2020 v 17:01 odesílatel 曾文旌(义从) <[email protected]> napsal: > > > 2020年1月24日 上午4:47,Robert Haas <[email protected]> 写道: > > On Sat, Jan 11, 2020 at 8:51 PM Tomas Vondra > <[email protected]> wrote: > > I proposed just ignoring those new indexes because it seems much simpler > than alternative solutions that I can think of, and it's not like those > other solutions don't have other issues. > > > +1. > > I complete the implementation of this feature. > When a session x create an index idx_a on GTT A then > For session x, idx_a is valid when after create index. > For session y, before session x create index done, GTT A has some data, > then index_a is invalid. > For session z, before session x create index done, GTT A has no data, > then index_a is valid. > > > For example, I've looked at the "on demand" building as implemented in > global_private_temp-8.patch, I kinda doubt adding a bunch of index build > calls into various places in index code seems somewht suspicious. > > > +1. I can't imagine that's a safe or sane thing to do. > > -- > Robert Haas > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > > Opinion by Pavel > + rel->rd_islocaltemp = true; <<<<<<< if this is valid, then the name of > field "rd_islocaltemp" is not probably best > I renamed rd_islocaltemp > I don't see any change? > Opinion by Konstantin Knizhnik > 1 Fixed comments > 2 Fixed assertion > > > Please help me review. > > > Wenjing > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-28 17:12 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 2 replies; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-28 17:12 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月29日 上午12:40,Pavel Stehule <[email protected]> 写道: > > > > út 28. 1. 2020 v 17:01 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: > > >> 2020年1月24日 上午4:47,Robert Haas <[email protected] <mailto:[email protected]>> 写道: >> >> On Sat, Jan 11, 2020 at 8:51 PM Tomas Vondra >> <[email protected] <mailto:[email protected]>> wrote: >>> I proposed just ignoring those new indexes because it seems much simpler >>> than alternative solutions that I can think of, and it's not like those >>> other solutions don't have other issues. >> >> +1. > I complete the implementation of this feature. > When a session x create an index idx_a on GTT A then > For session x, idx_a is valid when after create index. > For session y, before session x create index done, GTT A has some data, then index_a is invalid. > For session z, before session x create index done, GTT A has no data, then index_a is valid. > >> >>> For example, I've looked at the "on demand" building as implemented in >>> global_private_temp-8.patch, I kinda doubt adding a bunch of index build >>> calls into various places in index code seems somewht suspicious. >> >> +1. I can't imagine that's a safe or sane thing to do. >> >> -- >> Robert Haas >> EnterpriseDB: http://www.enterprisedb.com <http://www.enterprisedb.com/; >> The Enterprise PostgreSQL Company > > Opinion by Pavel > + rel->rd_islocaltemp = true; <<<<<<< if this is valid, then the name of field "rd_islocaltemp" is not probably best > I renamed rd_islocaltemp > > I don't see any change? Rename rd_islocaltemp to rd_istemp in global_temporary_table_v8-pg13.patch Wenjing > > > > Opinion by Konstantin Knizhnik > 1 Fixed comments > 2 Fixed assertion > > > Please help me review. > > > Wenjing > Attachments: [application/octet-stream] global_temporary_table_v8-pg13.patch (153.9K, ../../[email protected]/3-global_temporary_table_v8-pg13.patch) download | inline diff: diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 79430d2..babb5f3 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -158,6 +158,19 @@ static relopt_bool boolRelOpts[] = }, true }, + /* + * For global temp table only + * use ShareUpdateExclusiveLock for ensure safety + */ + { + { + "on_commit_delete_rows", + "global temp table on commit options", + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, + ShareUpdateExclusiveLock + }, + true + }, /* list terminator */ {{NULL}} }; @@ -1486,6 +1499,8 @@ bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind) { static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)}, {"fillfactor", RELOPT_TYPE_INT, offsetof(StdRdOptions, fillfactor)}, {"autovacuum_enabled", RELOPT_TYPE_BOOL, offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, enabled)}, @@ -1586,13 +1601,18 @@ build_reloptions(Datum reloptions, bool validate, bytea * partitioned_table_reloptions(Datum reloptions, bool validate) { + static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)} + }; + /* * There are no options for partitioned tables yet, but this is able to do * some validation. */ return (bytea *) build_reloptions(reloptions, validate, RELOPT_KIND_PARTITIONED, - 0, NULL, 0); + sizeof(StdRdOptions), tab, lengthof(tab)); } /* diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index dd975b1..1610e7d 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -1013,7 +1013,9 @@ gistGetFakeLSN(Relation rel) { static XLogRecPtr counter = FirstNormalUnloggedLSN; - if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + /* global temp is same as local temp table */ + if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + rel->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { /* * Temporary relations are only accessible in our session, so a simple diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 4871b7f..16b00c9 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -149,7 +149,9 @@ hashbuild(Relation heap, Relation index, IndexInfo *indexInfo) * metapage, nor the first bitmap page. */ sort_threshold = (maintenance_work_mem * 1024L) / BLCKSZ; - if (index->rd_rel->relpersistence != RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + if (!(index->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + index->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) sort_threshold = Min(sort_threshold, NBuffers); else sort_threshold = Min(sort_threshold, NLocBuffer); diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index 3fa4b76..b54882d 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -598,7 +598,7 @@ heapam_relation_set_new_filenode(Relation rel, */ *minmulti = GetOldestMultiXactId(); - srel = RelationCreateStorage(*newrnode, persistence); + srel = RelationCreateStorage(*newrnode, persistence, rel); /* * If required, set up an init fork for an unlogged table so that it can @@ -651,7 +651,7 @@ heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index 8ce5011..0d6ae76 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -62,6 +62,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/dbcommands.h" #include "commands/progress.h" #include "commands/vacuum.h" @@ -399,9 +400,9 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, Assert(params->index_cleanup != VACOPT_TERNARY_DEFAULT); Assert(params->truncate != VACOPT_TERNARY_DEFAULT); - /* not every AM requires these to be valid, but heap does */ - Assert(TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); - Assert(MultiXactIdIsValid(onerel->rd_rel->relminmxid)); + /* not every AM requires these to be valid, but regular heap does */ + Assert(RELATION_IS_GLOBAL_TEMP(onerel) ^ TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); + Assert(RELATION_IS_GLOBAL_TEMP(onerel) ^ MultiXactIdIsValid(onerel->rd_rel->relminmxid)); /* measure elapsed time iff autovacuum logging requires it */ if (IsAutoVacuumWorkerProcess() && params->log_min_duration >= 0) diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index f05cbe7..946c9d2 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -763,7 +763,14 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access) /* Read an existing block of the relation */ buf = ReadBuffer(rel, blkno); LockBuffer(buf, access); - _bt_checkpage(rel, buf); + + /* global temp table may be not yet initialized for this backend. */ + if (RELATION_IS_GLOBAL_TEMP(rel) && + blkno == BTREE_METAPAGE && + PageIsNew(BufferGetPage(buf))) + _bt_initmetapage(BufferGetPage(buf), P_NONE, 0); + else + _bt_checkpage(rel, buf); } else { diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 6e09ded..a2059fa 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6325,6 +6325,10 @@ StartupXLOG(void) else recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID; + /* clean temp relation files */ + if (max_active_gtt > 0) + RemovePgTempFiles(); + /* * Check for signal files, and if so set up state for offline recovery */ diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index d5da81c..c753b0e 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -42,6 +42,7 @@ OBJS = \ pg_subscription.o \ pg_type.o \ storage.o \ + storage_gtt.o \ toasting.o include $(top_srcdir)/src/backend/common.mk diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c index 16cb6d8..f28f2c2 100644 --- a/src/backend/catalog/catalog.c +++ b/src/backend/catalog/catalog.c @@ -398,7 +398,9 @@ GetNewRelFileNode(Oid reltablespace, Relation pg_class, char relpersistence) switch (relpersistence) { + /* global temp table is same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); break; case RELPERSISTENCE_UNLOGGED: diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 0fdff29..210d019 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -61,6 +61,7 @@ #include "catalog/pg_type.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "commands/tablecmds.h" #include "commands/typecmds.h" #include "executor/executor.h" @@ -99,6 +100,7 @@ static void AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -404,6 +406,10 @@ heap_create(const char *relname, relpersistence, relkind); + /* global temp table not create storage file when catalog create */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + create_storage = false; + /* * Have the storage manager create the relation's disk file, if needed. * @@ -427,7 +433,7 @@ heap_create(const char *relname, case RELKIND_INDEX: case RELKIND_SEQUENCE: - RelationCreateStorage(rel->rd_node, relpersistence); + RelationCreateStorage(rel->rd_node, relpersistence, rel); break; case RELKIND_RELATION: @@ -956,6 +962,7 @@ AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -994,8 +1001,18 @@ AddNewRelationTuple(Relation pg_class_desc, break; } - new_rel_reltup->relfrozenxid = relfrozenxid; - new_rel_reltup->relminmxid = relminmxid; + /* global temp table not remember transaction info in catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + new_rel_reltup->relfrozenxid = InvalidTransactionId; + new_rel_reltup->relminmxid = InvalidMultiXactId; + } + else + { + new_rel_reltup->relfrozenxid = relfrozenxid; + new_rel_reltup->relminmxid = relminmxid; + } + new_rel_reltup->relowner = relowner; new_rel_reltup->reltype = new_type_oid; new_rel_reltup->reloftype = reloftype; @@ -1357,6 +1374,7 @@ heap_create_with_catalog(const char *relname, reloftypeid, ownerid, relkind, + relpersistence, relfrozenxid, relminmxid, PointerGetDatum(relacl), @@ -1441,11 +1459,15 @@ heap_create_with_catalog(const char *relname, */ StoreConstraints(new_rel_desc, cooked_constraints, is_internal); - /* - * If there's a special on-commit action, remember it - */ - if (oncommit != ONCOMMIT_NOOP) - register_on_commit_action(relid, oncommit); + /* global temp table register action when storage init */ + if (relpersistence != RELPERSISTENCE_GLOBAL_TEMP) + { + /* + * If there's a special on-commit action, remember it + */ + if (oncommit != ONCOMMIT_NOOP) + register_on_commit_action(relid, oncommit); + } /* * ok, the relation has been cataloged, so close our relations and return @@ -1937,6 +1959,13 @@ heap_drop_with_catalog(Oid relid) if (relid == defaultPartOid) update_default_partition_oid(parentOid, InvalidOid); + /* We allow to drop global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not drop relation when other backend attached this global temp table"); + } + /* * Schedule unlinking of the relation's physical files at commit. */ @@ -3165,7 +3194,7 @@ RemoveStatistics(Oid relid, AttrNumber attnum) * the specified relation. Caller must hold exclusive lock on rel. */ static void -RelationTruncateIndexes(Relation heapRelation) +RelationTruncateIndexes(Relation heapRelation, LOCKMODE lockmode) { ListCell *indlist; @@ -3176,8 +3205,12 @@ RelationTruncateIndexes(Relation heapRelation) Relation currentIndex; IndexInfo *indexInfo; + if (RELATION_IS_GLOBAL_TEMP(heapRelation) && + !gtt_storage_attached(indexId)) + continue; + /* Open the index relation; use exclusive lock, just to be sure */ - currentIndex = index_open(indexId, AccessExclusiveLock); + currentIndex = index_open(indexId, lockmode); /* * Fetch info needed for index_build. Since we know there are no @@ -3223,8 +3256,13 @@ heap_truncate(List *relids) { Oid rid = lfirst_oid(cell); Relation rel; + LOCKMODE lockmode = AccessExclusiveLock; - rel = table_open(rid, AccessExclusiveLock); + /* truncate global temp table only need RowExclusiveLock */ + if (get_rel_persistence(rid) == RELPERSISTENCE_GLOBAL_TEMP) + lockmode = RowExclusiveLock; + + rel = table_open(rid, lockmode); relations = lappend(relations, rel); } @@ -3257,6 +3295,8 @@ void heap_truncate_one_rel(Relation rel) { Oid toastrelid; + LOCKMODE lockmode = AccessExclusiveLock; + bool truncate_toastrel = false; /* * Truncate the relation. Partitioned tables have no storage, so there is @@ -3265,23 +3305,40 @@ heap_truncate_one_rel(Relation rel) if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) return; + toastrelid = rel->rd_rel->reltoastrelid; + + /* + * Truncate global temp table only need RowExclusiveLock + */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + lockmode = RowExclusiveLock; + if (OidIsValid(toastrelid) && + gtt_storage_attached(toastrelid)) + truncate_toastrel = true; + } + else if (OidIsValid(toastrelid)) + truncate_toastrel = true; + /* Truncate the underlying relation */ table_relation_nontransactional_truncate(rel); /* If the relation has indexes, truncate the indexes too */ - RelationTruncateIndexes(rel); + RelationTruncateIndexes(rel, lockmode); /* If there is a toast table, truncate that too */ - toastrelid = rel->rd_rel->reltoastrelid; - if (OidIsValid(toastrelid)) + if (truncate_toastrel) { - Relation toastrel = table_open(toastrelid, AccessExclusiveLock); + Relation toastrel = table_open(toastrelid, lockmode); table_relation_nontransactional_truncate(toastrel); - RelationTruncateIndexes(toastrel); + RelationTruncateIndexes(toastrel, lockmode); /* keep the lock... */ table_close(toastrel, NoLock); } + + if (RELATION_IS_GLOBAL_TEMP(rel)) + up_gtt_relstats(rel, 0, 0, 0, RecentXmin, InvalidMultiXactId); } /* diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 8880586..0852073 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -52,6 +52,7 @@ #include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/event_trigger.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -877,6 +878,22 @@ index_create(Relation heapRelation, indexRelationName, RelationGetRelationName(heapRelation)))); } + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + if (accessMethodObjectId != BTREE_AM_OID) + elog(ERROR, "only support btree index on global temp table"); + + /* No support create index on global temp table use concurrent mode yet */ + if (concurrent) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot create indexes on global temporary tables using concurrent mode"))); + + /* if global temp table not init storage, then skip build index */ + if (!gtt_storage_attached(heapRelation->rd_node.relNode)) + flags |= INDEX_CREATE_SKIP_BUILD; + } + /* * construct tuple descriptor for index tuples */ @@ -2054,6 +2071,13 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) */ CheckTableNotInUse(userIndexRelation, "DROP INDEX"); + /* We allow to drop index on global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(userHeapRelation)) + { + if (is_other_backend_use_gtt(userHeapRelation->rd_node)) + elog(ERROR, "can not drop index when other backend attached this global temp table."); + } + /* * Drop Index Concurrently is more or less the reverse process of Create * Index Concurrently. @@ -2660,6 +2684,11 @@ index_update_stats(Relation rel, HeapTuple tuple; Form_pg_class rd_rel; bool dirty; + bool is_gtt = false; + + /* update index stats into localhash and rel_rd_rel for global temp table */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + is_gtt = true; /* * We always update the pg_class row using a non-transactional, @@ -2745,21 +2774,35 @@ index_update_stats(Relation rel, else /* don't bother for indexes */ relallvisible = 0; - if (rd_rel->relpages != (int32) relpages) + if (is_gtt) + rel->rd_rel->relpages = (int32) relpages; + else if (rd_rel->relpages != (int32) relpages) { rd_rel->relpages = (int32) relpages; dirty = true; } - if (rd_rel->reltuples != (float4) reltuples) + + if (is_gtt) + rel->rd_rel->reltuples = (float4) reltuples; + else if (rd_rel->reltuples != (float4) reltuples) { rd_rel->reltuples = (float4) reltuples; dirty = true; } - if (rd_rel->relallvisible != (int32) relallvisible) + + if (is_gtt) + rel->rd_rel->relallvisible = (int32) relallvisible; + else if (rd_rel->relallvisible != (int32) relallvisible) { rd_rel->relallvisible = (int32) relallvisible; dirty = true; } + + if (is_gtt) + { + up_gtt_relstats(rel, relpages, reltuples, relallvisible, + InvalidTransactionId, InvalidMultiXactId); + } } /* @@ -2873,6 +2916,15 @@ index_build(Relation heapRelation, pgstat_progress_update_multi_param(6, index, val); } + if (RELATION_IS_GLOBAL_TEMP(indexRelation)) + { + if (!gtt_storage_attached(indexRelation->rd_node.relNode)) + { + gtt_force_enable_index(indexRelation); + RelationCreateStorage(indexRelation->rd_node, RELPERSISTENCE_GLOBAL_TEMP, indexRelation); + } + } + /* * Call the access method's build procedure */ @@ -3468,6 +3520,15 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence, errmsg("cannot reindex temporary tables of other sessions"))); /* + * Because global temp table cannot change relfilenode + * no support reindex on global temp table yet. + */ + if (RELATION_IS_GLOBAL_TEMP(iRel)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot reindex global temporary tables"))); + + /* * Also check for active uses of the index in the current transaction; we * don't want to reindex underneath an open indexscan. */ diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index e70243a..301da79 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -647,6 +647,13 @@ RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid) errmsg("cannot create temporary relation in non-temporary schema"))); } break; + /* global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + if (isAnyTempNamespace(nspid)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("cannot create global temp relations in temporary schemas"))); + break; case RELPERSISTENCE_PERMANENT: if (isTempOrTempToastNamespace(nspid)) newRelation->relpersistence = RELPERSISTENCE_TEMP; diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index fddfbf1..671c614 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -26,6 +26,7 @@ #include "access/xlogutils.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "storage/freespace.h" #include "storage/smgr.h" @@ -75,7 +76,7 @@ static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */ * transaction aborts later on, the storage will be destroyed. */ SMgrRelation -RelationCreateStorage(RelFileNode rnode, char relpersistence) +RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel) { PendingRelDelete *pending; SMgrRelation srel; @@ -85,6 +86,8 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) switch (relpersistence) { case RELPERSISTENCE_TEMP: + /* global temp table use same storage strategy as local temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); needs_wal = false; break; @@ -117,6 +120,10 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) pending->next = pendingDeletes; pendingDeletes = pending; + /* remember global temp table storage info to localhash */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && rel) + remember_gtt_storage_info(rnode, rel); + return srel; } @@ -486,8 +493,15 @@ smgrDoPendingDeletes(bool isCommit) smgrdounlinkall(srels, nrels, false); for (i = 0; i < nrels; i++) + { smgrclose(srels[i]); + /* clean global temp table flags when transaction commit or rollback */ + if (SmgrIsTemp(srels[i]) && + gtt_storage_attached(srels[i]->smgr_rnode.node.relNode)) + forget_gtt_storage_info(srels[i]->smgr_rnode.node.relNode); + } + pfree(srels); } } diff --git a/src/backend/catalog/storage_gtt.c b/src/backend/catalog/storage_gtt.c new file mode 100644 index 0000000..24a7e77 --- /dev/null +++ b/src/backend/catalog/storage_gtt.c @@ -0,0 +1,1174 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.c + * code to create and destroy physical storage for global temparary table + * + * IDENTIFICATION + * src/backend/catalog/storage_gtt.c + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "access/table.h" +#include "access/visibilitymap.h" +#include "access/xact.h" +#include "access/xlog.h" +#include "access/xloginsert.h" +#include "access/xlogutils.h" +#include "access/htup_details.h" +#include "access/multixact.h" +#include "catalog/storage.h" +#include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" +#include "catalog/heap.h" +#include "catalog/namespace.h" +#include "catalog/pg_type.h" +#include "catalog/pg_statistic.h" +#include "commands/tablecmds.h" +#include "funcapi.h" +#include "nodes/primnodes.h" +#include "nodes/pg_list.h" +#include "nodes/execnodes.h" +#include "miscadmin.h" +#include "storage/freespace.h" +#include "storage/smgr.h" +#include "storage/ipc.h" +#include "storage/proc.h" +#include "storage/procarray.h" +#include "storage/lwlock.h" +#include "storage/shmem.h" +#include "storage/sinvaladt.h" +#include "utils/memutils.h" +#include "utils/rel.h" +#include "utils/hsearch.h" +#include "utils/catcache.h" +#include "utils/lsyscache.h" +#include <utils/relcache.h> +#include "utils/inval.h" +#include "utils/guc.h" + + +/* Copy from bitmapset.c, because gtt used the function in bitmapset.c */ +#define WORDNUM(x) ((x) / BITS_PER_BITMAPWORD) +#define BITNUM(x) ((x) % BITS_PER_BITMAPWORD) + +#define BITMAPSET_SIZE(nwords) \ + (offsetof(Bitmapset, words) + (nwords) * sizeof(bitmapword)) + +static bool gtt_cleaner_exit_registered = false; +static HTAB *gtt_storage_local_hash = NULL; +static HTAB *active_gtt_shared_hash = NULL; +static MemoryContext gtt_relstats_context = NULL; + +/* relfrozenxid of all gtts in the current session */ +static List *gtt_session_relfrozenxid_list = NIL; +static TransactionId gtt_session_frozenxid = InvalidTransactionId; + +typedef struct gtt_ctl_data +{ + LWLock lock; + int max_entry; + int entry_size; +}gtt_ctl_data; + +static gtt_ctl_data *gtt_shared_ctl = NULL; + +typedef struct +{ + RelFileNode rnode; + Bitmapset *map; + /* bitmap data */ +} gtt_shared_hash_entry; + +typedef struct +{ + Oid relid; + + Oid spcnode; + /* pg_class stat */ + int32 relpages; + float4 reltuples; + int32 relallvisible; + TransactionId relfrozenxid; + TransactionId relminmxid; + char relkind; + bool on_commit_delete; + + /* pg_statistic */ + int natts; + int *attnum; + HeapTuple *att_stat_tups; +} gtt_local_hash_entry; + +static Size action_gtt_shared_hash_entry_size(void); +static void gtt_storage_checkin(RelFileNode rnode); +static void gtt_storage_checkout(RelFileNode rnode, bool skiplock); +static void gtt_storage_removeall(int code, Datum arg); +static void insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid); +static void remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid); +static void set_gtt_session_relfrozenxid(void); + +Datum pg_get_gtt_statistics(PG_FUNCTION_ARGS); +Datum pg_get_gtt_relstats(PG_FUNCTION_ARGS); +Datum pg_gtt_attached_pid(PG_FUNCTION_ARGS); +Datum pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS); + + +static Size +action_gtt_shared_hash_entry_size(void) +{ + int wordnum; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + wordnum = WORDNUM(MaxBackends + 1); + hash_entry_size += MAXALIGN(sizeof(gtt_shared_hash_entry)); + hash_entry_size += MAXALIGN(BITMAPSET_SIZE(wordnum + 1)); + + return hash_entry_size; +} + +Size +active_gtt_shared_hash_size(void) +{ + Size size = 0; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + size = MAXALIGN(sizeof(gtt_ctl_data)); + hash_entry_size = action_gtt_shared_hash_entry_size(); + size += hash_estimate_size(max_active_gtt, hash_entry_size); + + return size; +} + +void +active_gtt_shared_hash_init(void) +{ + HASHCTL info; + bool found; + + if (max_active_gtt <= 0) + return; + + gtt_shared_ctl = + ShmemInitStruct("gtt_shared_ctl", + sizeof(gtt_ctl_data), + &found); + + if (!found) + { + LWLockRegisterTranche(LWTRANCHE_GTT_CTL, "gtt_shared_ctl"); + LWLockInitialize(>t_shared_ctl->lock, LWTRANCHE_GTT_CTL); + gtt_shared_ctl->max_entry = max_active_gtt; + gtt_shared_ctl->entry_size = action_gtt_shared_hash_entry_size(); + } + + info.keysize = sizeof(RelFileNode); + info.entrysize = gtt_shared_ctl->entry_size; + active_gtt_shared_hash = + ShmemInitHash("active gtt shared hash", + gtt_shared_ctl->max_entry, + gtt_shared_ctl->max_entry, + &info, HASH_ELEM | HASH_BLOBS | HASH_FIXED_SIZE); +} + +static void +gtt_storage_checkin(RelFileNode rnode) +{ + gtt_shared_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + entry = (gtt_shared_hash_entry *) hash_search(active_gtt_shared_hash, + &rnode, HASH_ENTER_NULL, &found); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of shared memory"), + errhint("You might need to increase max_active_gtt."))); + } + + if (found == false) + { + int wordnum; + + entry->map = (Bitmapset *)((char *)entry + MAXALIGN(sizeof(gtt_shared_hash_entry))); + wordnum = WORDNUM(MaxBackends + 1); + memset(entry->map, 0, BITMAPSET_SIZE(wordnum + 1)); + entry->map->nwords = wordnum + 1; + } + + bms_add_member(entry->map, MyBackendId); + LWLockRelease(>t_shared_ctl->lock); +} + +static void +gtt_storage_checkout(RelFileNode rnode, bool skiplock) +{ + gtt_shared_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (!skiplock) + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + + entry = hash_search(active_gtt_shared_hash, + (void *) &(rnode), HASH_FIND, NULL); + + if (entry == NULL) + { + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + elog(WARNING, "relfilenode %u/%u/%u not exist in gtt shared hash when forget", + rnode.dbNode, rnode.spcNode, rnode.relNode); + return; + } + + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + bms_del_member(entry->map, MyBackendId); + + if (bms_is_empty(entry->map)) + { + if (!hash_search(active_gtt_shared_hash, &rnode, HASH_REMOVE, NULL)) + elog(PANIC, "gtt shared hash table corrupted"); + } + + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + return; +} + +Bitmapset * +copy_active_gtt_bitmap(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + Bitmapset *map_copy = NULL; + + if (max_active_gtt <= 0) + return NULL; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return NULL; + } + + Assert(entry->map); + if (!bms_is_empty(entry->map)) + map_copy = bms_copy(entry->map); + + LWLockRelease(>t_shared_ctl->lock); + + return map_copy; +} + +bool +is_other_backend_use_gtt(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + bool in_use = false; + int num_use = 0; + + if (max_active_gtt <= 0) + return false; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return false; + } + + Assert(entry->map); + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + + num_use = bms_num_members(entry->map); + if (num_use == 0) + in_use = false; + else if (num_use == 1) + { + if(bms_is_member(MyBackendId, entry->map)) + in_use = false; + else + in_use = true; + } + else + in_use = true; + + LWLockRelease(>t_shared_ctl->lock); + + return in_use; +} + +void +remember_gtt_storage_info(RelFileNode rnode, Relation rel) +{ + gtt_local_hash_entry *entry; + MemoryContext oldcontext; + Oid relid = rnode.relNode; + bool found; + + if (max_active_gtt <= 0) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Global temporary table feature is disable"), + errhint("You might need to increase max_active_gtt to enable this feature."))); + + if (RecoveryInProgress()) + elog(ERROR, "readonly mode not support access global temp table yet"); + + if (rel->rd_rel->relkind == RELKIND_INDEX && + (!rel->rd_index->indisvalid || + !rel->rd_index->indisready || + !rel->rd_index->indislive)) + elog(ERROR, "invalid gtt index %s not allow to create stroage file", RelationGetRelationName(rel)); + + if (gtt_storage_local_hash == NULL) + { +#define GTT_LOCAL_HASH_SIZE 1024 + /* First time through: initialize the hash table */ + HASHCTL ctl; + + MemSet(&ctl, 0, sizeof(ctl)); + ctl.keysize = sizeof(Oid); + ctl.entrysize = sizeof(gtt_local_hash_entry); + gtt_storage_local_hash = + hash_create("global temp relation table", + GTT_LOCAL_HASH_SIZE, + &ctl, HASH_ELEM | HASH_BLOBS); + + if (!CacheMemoryContext) + CreateCacheMemoryContext(); + + gtt_relstats_context = + AllocSetContextCreate(CacheMemoryContext, + "gtt relstats context", + ALLOCSET_DEFAULT_SIZES); + } + + /* Look up or create an entry */ + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_ENTER, &found); + + if (found) + { + elog(ERROR, "backend %d relid %u already exists in global temp table local hash", + MyBackendId, relid); + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + + entry->spcnode = rnode.spcNode; + entry->relpages = 0; + entry->reltuples = 0; + entry->relallvisible = 0; + entry->relkind = rel->rd_rel->relkind; + /* only heap contain transaction information */ + if (entry->relkind == RELKIND_RELATION || entry->relkind == RELKIND_PARTITIONED_TABLE) + { + int natts = RelationGetNumberOfAttributes(rel); + entry->natts = natts; + entry->attnum = palloc0(sizeof(int) * natts); + entry->att_stat_tups = palloc0(sizeof(HeapTuple) * natts); + + if (RELATION_GTT_ON_COMMIT_DELETE(rel)) + { + entry->on_commit_delete = true; + register_on_commit_action(rel->rd_node.relNode, ONCOMMIT_DELETE_ROWS); + } + + entry->relfrozenxid = RecentXmin; + entry->relminmxid = GetOldestMultiXactId(); + insert_gtt_relfrozenxid_to_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + gtt_storage_checkin(rnode); + } + else + { + entry->natts = 0; + entry->attnum = 0; + entry->att_stat_tups = NULL; + entry->on_commit_delete = false; + entry->relfrozenxid = 0; + entry->relminmxid = 0; + } + + MemoryContextSwitchTo(oldcontext); + + if (!gtt_cleaner_exit_registered) + { + before_shmem_exit(gtt_storage_removeall, 0); + gtt_cleaner_exit_registered = true; + } + + return; +} + +void +forget_gtt_storage_info(Oid relid) +{ + gtt_local_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, NULL); + + if (entry && entry->relkind == RELKIND_RELATION) + { + RelFileNode rnode; + int i; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + gtt_storage_checkout(rnode, false); + + Assert(TransactionIdIsNormal(entry->relfrozenxid)); + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + + for (i = 0; i < entry->natts; i++) + { + if (entry->att_stat_tups[i]) + { + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + } + } + } + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_REMOVE, NULL); + + return; +} + +/* is the storage file was created in this backend */ +bool +gtt_storage_attached(Oid relid) +{ + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, &found); + + return found; +} + +static void +gtt_storage_removeall(int code, Datum arg) +{ + HASH_SEQ_STATUS status; + gtt_local_hash_entry *entry; + int nrels = 0, + maxrels = 0; + SMgrRelation *srels = NULL; + RelFileNode *rnodes = NULL; + char *relkinds = NULL; + + if (gtt_storage_local_hash == NULL) + return; + + hash_seq_init(&status, gtt_storage_local_hash); + while ((entry = (gtt_local_hash_entry *) hash_seq_search(&status)) != NULL) + { + SMgrRelation srel; + RelFileNode rnode; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + srel = smgropen(rnode, MyBackendId); + + /* allocate the initial array, or extend it, if needed */ + if (maxrels == 0) + { + maxrels = 32; + srels = palloc(sizeof(SMgrRelation) * maxrels); + rnodes = palloc(sizeof(RelFileNode) * maxrels); + relkinds = palloc(sizeof(char) * maxrels); + } + else if (maxrels <= nrels) + { + maxrels *= 2; + srels = repalloc(srels, sizeof(SMgrRelation) * maxrels); + rnodes = repalloc(rnodes, sizeof(RelFileNode) * maxrels); + relkinds = repalloc(relkinds, sizeof(char) * maxrels); + } + + srels[nrels] = srel; + rnodes[nrels] = rnode; + relkinds[nrels] = entry->relkind; + nrels++; + } + + if (nrels > 0) + { + int i; + + smgrdounlinkall(srels, nrels, false); + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + for (i = 0; i < nrels; i++) + { + smgrclose(srels[i]); + if (relkinds[i] == RELKIND_RELATION) + gtt_storage_checkout(rnodes[i], true); + } + LWLockRelease(>t_shared_ctl->lock); + + pfree(srels); + pfree(rnodes); + pfree(relkinds); + } + + MyProc->session_gtt_frozenxid = InvalidTransactionId; + + return; +} + +/* + * Update global temp table relstats(relpage/reltuple/relallvisible) + * to local hashtable + */ +void +up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid) +{ + Oid relid = RelationGetRelid(relation); + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return; + + Assert(entry->spcnode); + + if (num_pages >= 0 && + entry->relpages != (int32)num_pages) + entry->relpages = (int32)num_pages; + + if (num_tuples >= 0 && + num_tuples != (float4)entry->reltuples) + entry->reltuples = (float4)num_tuples; + + /* only heap contain transaction information and relallvisible */ + if (entry->relkind == RELKIND_RELATION) + { + if (entry->relallvisible >= 0 && + entry->relallvisible != (int32)num_all_visible_pages) + { + entry->relallvisible = (int32)num_all_visible_pages; + } + + if (TransactionIdIsNormal(relfrozenxid) && + entry->relfrozenxid != relfrozenxid && + (TransactionIdPrecedes(entry->relfrozenxid, relfrozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), entry->relfrozenxid))) + { + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + entry->relfrozenxid = relfrozenxid; + insert_gtt_relfrozenxid_to_ordered_list(relfrozenxid); + set_gtt_session_relfrozenxid(); + } + + if (MultiXactIdIsValid(relminmxid) && + entry->relminmxid != relminmxid && + (MultiXactIdPrecedes(entry->relminmxid, relminmxid) || + MultiXactIdPrecedes(ReadNextMultiXactId(), entry->relminmxid))) + { + entry->relminmxid = relminmxid; + } + } + + return; +} + +/* + * Search global temp table relstats(relpage/reltuple/relallvisible) + * from local hashtable. + */ +bool +get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid) +{ + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return false; + + Assert(entry->relid == relid); + + if (relpages) + *relpages = entry->relpages; + + if (reltuples) + *reltuples = entry->reltuples; + + if (relallvisible) + *relallvisible = entry->relallvisible; + + if (relfrozenxid) + *relfrozenxid = entry->relfrozenxid; + + if (relminmxid) + *relminmxid = entry->relminmxid; + + return true; +} + +/* + * Update global temp table statistic info(definition is same as pg_statistic) + * to local hashtable where ananyze global temp table + */ +void +up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull) +{ + gtt_local_hash_entry *entry; + bool found; + MemoryContext oldcontext; + int i = 0; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return; + + if (entry->relkind != RELKIND_RELATION) + { + elog(WARNING, "oid %u not a relation", reloid); + return; + } + + /* todo */ + if (entry->natts < natts) + { + elog(WARNING, "reloid %u not support update attstat after add colunm", reloid); + return; + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + Assert(entry->relid == reloid); + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == 0) + { + entry->attnum[i] = attnum; + break; + } + else if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + break; + } + } + + Assert(i < entry->natts); + Assert(entry->att_stat_tups[i] == NULL); + entry->att_stat_tups[i] = heap_form_tuple(tupleDescriptor, values, isnull); + MemoryContextSwitchTo(oldcontext); + + return; +} + +/* + * Search global temp table statistic info(definition is same as pg_statistic) + * from local hashtable. + */ +HeapTuple +get_gtt_att_statistic(Oid reloid, int attnum, bool inh) +{ + gtt_local_hash_entry *entry; + bool found; + int i = 0; + + if (max_active_gtt <= 0) + return NULL; + + if (gtt_storage_local_hash == NULL) + return NULL; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return NULL; + + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + return entry->att_stat_tups[i]; + } + } + + return NULL; +} + +void +release_gtt_statistic_cache(HeapTuple tup) +{ + /* do nothing */ + return; +} + +static void +insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid) +{ + MemoryContext oldcontext; + ListCell *cell; + int i; + + Assert(TransactionIdIsNormal(relfrozenxid)); + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + /* Does the datum belong at the front? */ + if (gtt_session_relfrozenxid_list == NIL || + TransactionIdFollowsOrEquals(relfrozenxid, + linitial_oid(gtt_session_relfrozenxid_list))) + { + gtt_session_relfrozenxid_list = + lcons_oid(relfrozenxid, gtt_session_relfrozenxid_list); + MemoryContextSwitchTo(oldcontext); + + return; + } + + /* No, so find the entry it belongs after */ + i = 0; + foreach (cell, gtt_session_relfrozenxid_list) + { + if (TransactionIdFollowsOrEquals(relfrozenxid, lfirst_oid(cell))) + break; + + i++; + } + gtt_session_relfrozenxid_list = + list_insert_nth_oid(gtt_session_relfrozenxid_list, i, relfrozenxid); + MemoryContextSwitchTo(oldcontext); + + return; +} + +static void +remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid) +{ + gtt_session_relfrozenxid_list = + list_delete_oid(gtt_session_relfrozenxid_list, relfrozenxid); +} + +static void +set_gtt_session_relfrozenxid(void) +{ + TransactionId gtt_frozenxid = InvalidTransactionId; + + if (gtt_session_relfrozenxid_list) + gtt_frozenxid = llast_oid(gtt_session_relfrozenxid_list); + + gtt_session_frozenxid = gtt_frozenxid; + if (MyProc->session_gtt_frozenxid != gtt_frozenxid) + MyProc->session_gtt_frozenxid = gtt_frozenxid; +} + +Datum +pg_get_gtt_statistics(PG_FUNCTION_ARGS) +{ + HeapTuple tuple; + Relation rel = NULL; + int attnum = PG_GETARG_INT32(1); + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + MemoryContext oldcontext; + Tuplestorestate *tupstore; + Relation pg_tatistic = NULL; + TupleDesc sd; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not " \ + "allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + pg_tatistic = table_open(StatisticRelationId, AccessShareLock); + sd = RelationGetDescr(pg_tatistic); + + tuple = get_gtt_att_statistic(reloid, attnum, false); + if (tuple) + { + Datum values[31]; + bool isnull[31]; + HeapTuple res = NULL; + + memset(&values, 0, sizeof(values)); + memset(&isnull, 0, sizeof(isnull)); + heap_deform_tuple(tuple, sd, values, isnull); + res = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, res); + } + + table_close(rel, NoLock); + table_close(pg_tatistic, AccessShareLock); + tuplestore_donestoring(tupstore); + + return (Datum) 0; +} + +Datum +pg_get_gtt_relstats(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + uint32 relfrozenxid = 0; + uint32 relminmxid = 0; + Relation rel = NULL; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + if (get_gtt_relstats(reloid, + &relpages, &reltuples, &relallvisible, + &relfrozenxid, &relminmxid)) + { + Datum values[5]; + bool isnull[5]; + + memset(isnull, 0, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(relpages); + values[1] = Float4GetDatum((float4)reltuples); + values[2] = Int32GetDatum(relallvisible); + values[3] = UInt32GetDatum(relfrozenxid); + values[4] = UInt32GetDatum(relminmxid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_gtt_attached_pid(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + Relation rel = NULL; + PGPROC *proc = NULL; + Bitmapset *map = NULL; + pid_t pid = 0; + int backendid = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + map = copy_active_gtt_bitmap(rel->rd_node); + if (map) + { + backendid = bms_first_member(map); + + do + { + proc = BackendIdGetProc(backendid); + pid = proc->pid; + if (pid > 0) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = UInt32GetDatum(reloid); + values[1] = Int32GetDatum(pid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + backendid = bms_next_member(map, backendid); + } while (backendid > 0); + + pfree(map); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + int num_xid = MaxBackends + 1; + int *pids = NULL; + uint32 *xids = NULL; + int i = 0; + int j = 0; + uint32 oldest = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + if (max_active_gtt <= 0) + return (Datum) 0; + + if (RecoveryInProgress()) + return (Datum) 0; + + pids = palloc0(sizeof(int) * num_xid); + xids = palloc0(sizeof(int) * num_xid); + oldest = list_all_session_gtt_frozenxids(num_xid, pids, xids, &i); + if (i > 0) + { + if (i > 0) + { + pids[i] = 0; + xids[i] = oldest; + i++; + } + + for(j = 0; j < i; j++) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(pids[j]); + values[1] = UInt32GetDatum(xids[j]); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + } + tuplestore_donestoring(tupstore); + pfree(pids); + pfree(xids); + + return (Datum) 0; +} + +void +gtt_force_enable_index(Relation index) +{ + Oid indexOid = RelationGetRelid(index); + + if (!RELATION_IS_GLOBAL_TEMP(index)) + return; + + Assert(index->rd_rel->relkind == RELKIND_INDEX); + Assert(OidIsValid(indexOid)); + + index->rd_index->indisvalid = true; + index->rd_index->indislive = true; + index->rd_index->indisready = true; +} + +void +gtt_fix_index_state(Relation index) +{ + Oid indexOid = RelationGetRelid(index); + Oid relOid = index->rd_index->indrelid; + + if (!RELATION_IS_GLOBAL_TEMP(index)) + return; + + if (!index->rd_index->indisvalid) + return; + + if (gtt_storage_attached(relOid) && + !gtt_storage_attached(indexOid)) + { + index->rd_index->indisvalid = false; + index->rd_index->indislive = false; + index->rd_index->indisready = false; + } + + return; +} + diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index c9e75f4..2adde62 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -186,6 +186,91 @@ CREATE OR REPLACE VIEW pg_sequences AS WHERE NOT pg_is_other_temp_schema(N.oid) AND relkind = 'S'; +-- For global temporary table +CREATE VIEW pg_gtt_relstats WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_relstats(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_attached_pids WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_gtt_attached_pid(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_stats WITH (security_barrier) AS +SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN s.stakind1 = 1 THEN s.stavalues1 + WHEN s.stakind2 = 1 THEN s.stavalues2 + WHEN s.stakind3 = 1 THEN s.stavalues3 + WHEN s.stakind4 = 1 THEN s.stavalues4 + WHEN s.stakind5 = 1 THEN s.stavalues5 + END AS most_common_vals, + CASE + WHEN s.stakind1 = 1 THEN s.stanumbers1 + WHEN s.stakind2 = 1 THEN s.stanumbers2 + WHEN s.stakind3 = 1 THEN s.stanumbers3 + WHEN s.stakind4 = 1 THEN s.stanumbers4 + WHEN s.stakind5 = 1 THEN s.stanumbers5 + END AS most_common_freqs, + CASE + WHEN s.stakind1 = 2 THEN s.stavalues1 + WHEN s.stakind2 = 2 THEN s.stavalues2 + WHEN s.stakind3 = 2 THEN s.stavalues3 + WHEN s.stakind4 = 2 THEN s.stavalues4 + WHEN s.stakind5 = 2 THEN s.stavalues5 + END AS histogram_bounds, + CASE + WHEN s.stakind1 = 3 THEN s.stanumbers1[1] + WHEN s.stakind2 = 3 THEN s.stanumbers2[1] + WHEN s.stakind3 = 3 THEN s.stanumbers3[1] + WHEN s.stakind4 = 3 THEN s.stanumbers4[1] + WHEN s.stakind5 = 3 THEN s.stanumbers5[1] + END AS correlation, + CASE + WHEN s.stakind1 = 4 THEN s.stavalues1 + WHEN s.stakind2 = 4 THEN s.stavalues2 + WHEN s.stakind3 = 4 THEN s.stavalues3 + WHEN s.stakind4 = 4 THEN s.stavalues4 + WHEN s.stakind5 = 4 THEN s.stavalues5 + END AS most_common_elems, + CASE + WHEN s.stakind1 = 4 THEN s.stanumbers1 + WHEN s.stakind2 = 4 THEN s.stanumbers2 + WHEN s.stakind3 = 4 THEN s.stanumbers3 + WHEN s.stakind4 = 4 THEN s.stanumbers4 + WHEN s.stakind5 = 4 THEN s.stanumbers5 + END AS most_common_elem_freqs, + CASE + WHEN s.stakind1 = 5 THEN s.stanumbers1 + WHEN s.stakind2 = 5 THEN s.stanumbers2 + WHEN s.stakind3 = 5 THEN s.stanumbers3 + WHEN s.stakind4 = 5 THEN s.stanumbers4 + WHEN s.stakind5 = 5 THEN s.stanumbers5 + END AS elem_count_histogram + FROM + pg_class c + JOIN pg_attribute a ON c.oid = a.attrelid + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_statistics(c.oid, a.attnum, ''::text) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') and NOT a.attisdropped AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + CREATE VIEW pg_stats WITH (security_barrier) AS SELECT nspname AS schemaname, diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index c4420dd..977a984 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -34,6 +34,7 @@ #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "commands/dbcommands.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -103,7 +104,7 @@ static int acquire_inherited_sample_rows(Relation onerel, int elevel, HeapTuple *rows, int targrows, double *totalrows, double *totaldeadrows); static void update_attstats(Oid relid, bool inh, - int natts, VacAttrStats **vacattrstats); + int natts, VacAttrStats **vacattrstats, char relpersistence); static Datum std_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); @@ -586,14 +587,15 @@ do_analyze_rel(Relation onerel, VacuumParams *params, * pg_statistic for columns we didn't process, we leave them alone.) */ update_attstats(RelationGetRelid(onerel), inh, - attr_cnt, vacattrstats); + attr_cnt, vacattrstats, RelationGetRelPersistence(onerel)); for (ind = 0; ind < nindexes; ind++) { AnlIndexData *thisdata = &indexdata[ind]; update_attstats(RelationGetRelid(Irel[ind]), false, - thisdata->attr_cnt, thisdata->vacattrstats); + thisdata->attr_cnt, thisdata->vacattrstats, + RelationGetRelPersistence(Irel[ind])); } /* @@ -1456,7 +1458,7 @@ acquire_inherited_sample_rows(Relation onerel, int elevel, * by taking a self-exclusive lock on the relation in analyze_rel(). */ static void -update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) +update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats, char relpersistence) { Relation sd; int attno; @@ -1558,31 +1560,45 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) } } - /* Is there already a pg_statistic tuple for this attribute? */ - oldtup = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(relid), - Int16GetDatum(stats->attr->attnum), - BoolGetDatum(inh)); - - if (HeapTupleIsValid(oldtup)) + /* Update column statistic to localhash, not catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { - /* Yes, replace it */ - stup = heap_modify_tuple(oldtup, - RelationGetDescr(sd), - values, - nulls, - replaces); - ReleaseSysCache(oldtup); - CatalogTupleUpdate(sd, &stup->t_self, stup); + up_gtt_att_statistic(relid, + stats->attr->attnum, + inh, + natts, + RelationGetDescr(sd), + values, + nulls); } else { - /* No, insert new tuple */ - stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); - CatalogTupleInsert(sd, stup); - } + /* Is there already a pg_statistic tuple for this attribute? */ + oldtup = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(relid), + Int16GetDatum(stats->attr->attnum), + BoolGetDatum(inh)); - heap_freetuple(stup); + if (HeapTupleIsValid(oldtup)) + { + /* Yes, replace it */ + stup = heap_modify_tuple(oldtup, + RelationGetDescr(sd), + values, + nulls, + replaces); + ReleaseSysCache(oldtup); + CatalogTupleUpdate(sd, &stup->t_self, stup); + } + else + { + /* No, insert new tuple */ + stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); + CatalogTupleInsert(sd, stup); + } + + heap_freetuple(stup); + } } table_close(sd, RowExclusiveLock); diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index e9d7a7f..3088e26 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -391,6 +391,12 @@ cluster_rel(Oid tableOid, Oid indexOid, int options) errmsg("cannot vacuum temporary tables of other sessions"))); } + /* not support cluster global temp table yet */ + if (RELATION_IS_GLOBAL_TEMP(OldHeap)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("not support cluster global temporary tables yet"))); + /* * Also check for active uses of the relation in the current transaction, * including open scans and pending AFTER trigger events. diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 40a8ec1..e7b4e44 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -1062,7 +1062,7 @@ DoCopy(ParseState *pstate, const CopyStmt *stmt, Assert(rel); /* check read-only transaction and parallel mode */ - if (XactReadOnly && !rel->rd_islocaltemp) + if (XactReadOnly && !rel->rd_istemp) PreventCommandIfReadOnly("COPY FROM"); cstate = BeginCopyFrom(pstate, rel, stmt->filename, stmt->is_program, diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index ec20ba3..a29cc00 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2614,6 +2614,16 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind, !isTempNamespace(classtuple->relnamespace)) continue; + /* not support reindex on global temp table, so skip it */ + if (classtuple->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + ereport(WARNING, + (errmsg("global temp table \"%s.%s\" skip reindexed", + get_namespace_name(get_rel_namespace(relid)), + get_rel_name(relid)))); + continue; + } + /* Check user/system classification, and optionally skip */ if (objectKind == REINDEX_OBJECT_SYSTEM && !IsSystemClass(relid, classtuple)) diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c index 329ab84..dfa257c 100644 --- a/src/backend/commands/lockcmds.c +++ b/src/backend/commands/lockcmds.c @@ -96,7 +96,8 @@ RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, * transaction. */ relpersistence = get_rel_persistence(relid); - if (relpersistence == RELPERSISTENCE_TEMP) + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPNAMESPACE; /* Check permissions. */ diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 6aab73b..5787674 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -94,7 +94,7 @@ static HTAB *seqhashtab = NULL; /* hash table for SeqTable items */ */ static SeqTableData *last_used_seq = NULL; -static void fill_seq_with_data(Relation rel, HeapTuple tuple); +static void fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf); static Relation lock_and_open_sequence(SeqTable seq); static void create_seq_hashtable(void); static void init_sequence(Oid relid, SeqTable *p_elm, Relation *p_rel); @@ -108,6 +108,7 @@ static void init_params(ParseState *pstate, List *options, bool for_identity, List **owned_by); static void do_setval(Oid relid, int64 next, bool iscalled); static void process_owned_by(Relation seqrel, List *owned_by, bool for_identity); +int64 get_seqence_start_value(Oid seqid); /* @@ -222,7 +223,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq) /* now initialize the sequence's data */ tuple = heap_form_tuple(tupDesc, value, null); - fill_seq_with_data(rel, tuple); + fill_seq_with_data(rel, tuple, InvalidBuffer); /* process OWNED BY if given */ if (owned_by) @@ -327,7 +328,7 @@ ResetSequence(Oid seq_relid) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seq_rel, tuple); + fill_seq_with_data(seq_rel, tuple, InvalidBuffer); /* Clear local cache so that we don't think we have cached numbers */ /* Note that we do not change the currval() state */ @@ -340,17 +341,21 @@ ResetSequence(Oid seq_relid) * Initialize a sequence's relation with the specified tuple as content */ static void -fill_seq_with_data(Relation rel, HeapTuple tuple) +fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf) { - Buffer buf; Page page; sequence_magic *sm; OffsetNumber offnum; + bool lockBuffer = false; /* Initialize first page of relation with special magic number */ - buf = ReadBuffer(rel, P_NEW); - Assert(BufferGetBlockNumber(buf) == 0); + if (buf == InvalidBuffer) + { + buf = ReadBuffer(rel, P_NEW); + Assert(BufferGetBlockNumber(buf) == 0); + lockBuffer = true; + } page = BufferGetPage(buf); @@ -360,7 +365,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) /* Now insert sequence tuple */ - LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); + if (lockBuffer) + LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); /* * Since VACUUM does not process sequences, we have to force the tuple to @@ -410,7 +416,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) END_CRIT_SECTION(); - UnlockReleaseBuffer(buf); + if (lockBuffer) + UnlockReleaseBuffer(buf); } /* @@ -502,7 +509,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seqrel, newdatatuple); + fill_seq_with_data(seqrel, newdatatuple, InvalidBuffer); } /* process OWNED BY if given */ @@ -611,7 +618,7 @@ nextval_internal(Oid relid, bool check_permissions) RelationGetRelationName(seqrel)))); /* read-only transactions may only modify temp sequences */ - if (!seqrel->rd_islocaltemp) + if (!seqrel->rd_istemp) PreventCommandIfReadOnly("nextval()"); /* @@ -936,7 +943,7 @@ do_setval(Oid relid, int64 next, bool iscalled) ReleaseSysCache(pgstuple); /* read-only transactions may only modify temp sequences */ - if (!seqrel->rd_islocaltemp) + if (!seqrel->rd_istemp) PreventCommandIfReadOnly("setval()"); /* @@ -1178,6 +1185,25 @@ read_seq_tuple(Relation rel, Buffer *buf, HeapTuple seqdatatuple) LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); page = BufferGetPage(*buf); + if (GlobalTempRelationPageIsNotInitialized(rel, page)) + { + /* Initialize sequence for global temporary tables */ + Datum value[SEQ_COL_LASTCOL] = {0}; + bool null[SEQ_COL_LASTCOL] = {false}; + HeapTuple tuple; + int64 startv = get_seqence_start_value(RelationGetRelid(rel)); + + /* + * last_value from pg_sequence.seqstart + * log_cnt = 0 + * is_called = false + */ + value[SEQ_COL_LASTVAL-1] = Int64GetDatumFast(startv); /* start sequence with 1 */ + + tuple = heap_form_tuple(RelationGetDescr(rel), value, null); + fill_seq_with_data(rel, tuple, *buf); + heap_freetuple(tuple); + } sm = (sequence_magic *) PageGetSpecialPointer(page); if (sm->magic != SEQ_MAGIC) @@ -1954,3 +1980,23 @@ seq_mask(char *page, BlockNumber blkno) mask_unused_space(page); } + +int64 +get_seqence_start_value(Oid seqid) +{ + HeapTuple seqtuple; + Form_pg_sequence seqform; + int64 start; + + seqtuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(seqid)); + if (!HeapTupleIsValid(seqtuple)) + elog(ERROR, "cache lookup failed for sequence %u", + seqid); + + seqform = (Form_pg_sequence) GETSTRUCT(seqtuple); + start = seqform->seqstart; + ReleaseSysCache(seqtuple); + + return start; +} + diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 70589dd..dfe7cc0 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -47,6 +47,7 @@ #include "catalog/storage.h" #include "catalog/storage_xlog.h" #include "catalog/toasting.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/comment.h" #include "commands/defrem.h" @@ -552,6 +553,7 @@ static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTbl); static List *GetParentedForeignKeyRefs(Relation partition); static void ATDetachCheckNoForeignKeyRefs(Relation partition); +static bool has_oncommit_option(List *options); /* ---------------------------------------------------------------- @@ -597,6 +599,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, LOCKMODE parentLockmode; const char *accessMethod = NULL; Oid accessMethodId = InvalidOid; + bool has_oncommit_clause = false; /* * Truncate relname to appropriate length (probably a waste of time, as @@ -607,8 +610,10 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Check consistency of arguments */ + /* global temp table same as local temp table */ if (stmt->oncommit != ONCOMMIT_NOOP - && stmt->relation->relpersistence != RELPERSISTENCE_TEMP) + && !(stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("ON COMMIT can only be used on temporary tables"))); @@ -638,7 +643,9 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, * code. This is needed because calling code might not expect untrusted * tables to appear in pg_temp at the front of its search path. */ - if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP + /* global temp table same as local temp table */ + if ((stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) && InSecurityRestrictedOperation()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -739,6 +746,57 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Parse and validate reloptions, if any. */ + /* global temp table */ + has_oncommit_clause = has_oncommit_option(stmt->options); + if (stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (relkind == RELKIND_RELATION || relkind == RELKIND_PARTITIONED_TABLE)) + { + /* inherit table or parition table inherit on commit property from parent table*/ + if (inheritOids && stmt->oncommit == ONCOMMIT_NOOP && !has_oncommit_clause) + { + Oid parent = linitial_oid(inheritOids); + Relation relation = table_open(parent, NoLock); + + if (!RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "The parent table must be global temporary table"); + + if (RELATION_GTT_ON_COMMIT_DELETE(relation)) + stmt->oncommit = ONCOMMIT_DELETE_ROWS; + else + stmt->oncommit = ONCOMMIT_PRESERVE_ROWS; + table_close(relation, NoLock); + } + + if (has_oncommit_clause) + { + if (stmt->oncommit != ONCOMMIT_NOOP) + elog(ERROR, "can not defeine global temp table with on commit and with clause at same time"); + } + else + { + DefElem *opt = makeNode(DefElem); + + opt->type = T_DefElem; + opt->defnamespace = NULL; + opt->defname = "on_commit_delete_rows"; + opt->defaction = DEFELEM_UNSPEC; + + /* use reloptions to remember on commit clause */ + if (stmt->oncommit == ONCOMMIT_DELETE_ROWS) + opt->arg = (Node *)makeString("true"); + else if (stmt->oncommit == ONCOMMIT_PRESERVE_ROWS) + opt->arg = (Node *)makeString("false"); + else if (stmt->oncommit == ONCOMMIT_NOOP) + opt->arg = (Node *)makeString("false"); + else + elog(ERROR, "global temp table not support on commit drop clause"); + + stmt->options = lappend(stmt->options, opt); + } + } + else if (has_oncommit_clause) + elog(ERROR, "regular table cannot specifie on_commit_delete_rows"); + reloptions = transformRelOptions((Datum) 0, stmt->options, NULL, validnsps, true, false); @@ -1816,7 +1874,8 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged, * table or the current physical file to be thrown away anyway. */ if (rel->rd_createSubid == mySubid || - rel->rd_newRelfilenodeSubid == mySubid) + rel->rd_newRelfilenodeSubid == mySubid || + RELATION_IS_GLOBAL_TEMP(rel)) { /* Immediate, non-rollbackable truncation is OK */ heap_truncate_one_rel(rel); @@ -2259,7 +2318,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence, /* If existing rel is temp, it must belong to this session */ if (relation->rd_rel->relpersistence == RELPERSISTENCE_TEMP && - !relation->rd_islocaltemp) + !relation->rd_istemp) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg(!is_partition @@ -3375,6 +3434,13 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo * specially. */ targetrelation = relation_open(myrelid, is_index ? ShareUpdateExclusiveLock : AccessExclusiveLock); + + if (RELATION_IS_GLOBAL_TEMP(targetrelation)) + { + if (is_other_backend_use_gtt(targetrelation->rd_node)) + elog(ERROR, "can not rename relation when other backend attached this global temp table"); + } + namespaceId = RelationGetNamespace(targetrelation); /* @@ -3550,6 +3616,13 @@ AlterTable(AlterTableStmt *stmt, LOCKMODE lockmode, /* Caller is required to provide an adequate lock. */ rel = relation_open(context->relid, NoLock); + /* We allow to alter global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not alter relation when other backend attached this global temp table"); + } + CheckTableNotInUse(rel, "ALTER TABLE"); ATController(stmt, rel, stmt->cmds, stmt->relation->inh, lockmode, context); @@ -8123,6 +8196,13 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, errmsg("referenced relation \"%s\" is not a table", RelationGetRelationName(pkrel)))); + /* global temp table not support foreign key constraint yet */ + if (RELATION_IS_GLOBAL_TEMP(pkrel)) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("referenced relation \"%s\" is not a global temp table", + RelationGetRelationName(pkrel)))); + if (!allowSystemTableMods && IsSystemRelation(pkrel)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -8157,11 +8237,17 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("constraints on temporary tables may reference only temporary tables"))); - if (!pkrel->rd_islocaltemp || !rel->rd_islocaltemp) + if (!pkrel->rd_istemp || !rel->rd_istemp) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("constraints on temporary tables must involve temporary tables of this session"))); break; + /* global temp table not support foreign key constraint yet */ + case RELPERSISTENCE_GLOBAL_TEMP: + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("not support foreign key constraints on global temp table yet"))); + break; } /* @@ -13199,7 +13285,7 @@ index_copy_data(Relation rel, RelFileNode newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, @@ -13314,14 +13400,14 @@ ATExecAddInherit(Relation child_rel, RangeVar *parent, LOCKMODE lockmode) /* If parent rel is temp, it must belong to this session */ if (parent_rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && - !parent_rel->rd_islocaltemp) + !parent_rel->rd_istemp) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot inherit from temporary relation of another session"))); /* Ditto for the child */ if (child_rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && - !child_rel->rd_islocaltemp) + !child_rel->rd_istemp) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot inherit to temporary relation of another session"))); @@ -14606,7 +14692,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged) */ switch (rel->rd_rel->relpersistence) { + /* global temp table same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("cannot change logged status of table \"%s\" because it is temporary", @@ -16096,14 +16184,14 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd) /* If the parent is temp, it must belong to this session */ if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && - !rel->rd_islocaltemp) + !rel->rd_istemp) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot attach as partition of temporary relation of another session"))); /* Ditto for the partition */ if (attachrel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && - !attachrel->rd_islocaltemp) + !attachrel->rd_istemp) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot attach temporary relation of another session as partition"))); @@ -17246,3 +17334,20 @@ ATDetachCheckNoForeignKeyRefs(Relation partition) table_close(rel, NoLock); } } + +static bool +has_oncommit_option(List *options) +{ + ListCell *listptr; + + foreach(listptr, options) + { + DefElem *def = (DefElem *) lfirst(listptr); + + if (pg_strcasecmp(def->defname, "on_commit_delete_rows") == 0) + return true; + } + + return false; +} + diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index d625d17..69ad24f 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -35,6 +35,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/defrem.h" #include "commands/vacuum.h" @@ -1217,6 +1218,17 @@ vac_update_relstats(Relation relation, HeapTuple ctup; Form_pg_class pgcform; bool dirty; + bool is_gtt = false; + + /* global temp table remember relstats to localhash and rel->rd_rel, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(relation)) + { + is_gtt = true; + up_gtt_relstats(relation, + num_pages, num_tuples, + num_all_visible_pages, + frozenxid, minmulti); + } rd = table_open(RelationRelationId, RowExclusiveLock); @@ -1230,17 +1242,26 @@ vac_update_relstats(Relation relation, /* Apply statistical updates, if any, to copied tuple */ dirty = false; - if (pgcform->relpages != (int32) num_pages) + + if (is_gtt) + relation->rd_rel->relpages = (int32) num_pages; + else if (pgcform->relpages != (int32) num_pages) { pgcform->relpages = (int32) num_pages; dirty = true; } - if (pgcform->reltuples != (float4) num_tuples) + + if (is_gtt) + relation->rd_rel->reltuples = (float4) num_tuples; + else if (pgcform->reltuples != (float4) num_tuples) { pgcform->reltuples = (float4) num_tuples; dirty = true; } - if (pgcform->relallvisible != (int32) num_all_visible_pages) + + if (is_gtt) + relation->rd_rel->relallvisible = (int32) num_all_visible_pages; + else if (pgcform->relallvisible != (int32) num_all_visible_pages) { pgcform->relallvisible = (int32) num_all_visible_pages; dirty = true; @@ -1285,7 +1306,8 @@ vac_update_relstats(Relation relation, * This should match vac_update_datfrozenxid() concerning what we consider * to be "in the future". */ - if (TransactionIdIsNormal(frozenxid) && + if (!is_gtt && + TransactionIdIsNormal(frozenxid) && pgcform->relfrozenxid != frozenxid && (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || TransactionIdPrecedes(ReadNewTransactionId(), @@ -1296,7 +1318,8 @@ vac_update_relstats(Relation relation, } /* Similarly for relminmxid */ - if (MultiXactIdIsValid(minmulti) && + if (!is_gtt && + MultiXactIdIsValid(minmulti) && pgcform->relminmxid != minmulti && (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) @@ -1394,6 +1417,10 @@ vac_update_datfrozenxid(void) continue; } + /* global temp table relstats not in pg_class */ + if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + continue; + /* * Some table AMs might not need per-relation xid / multixid horizons. * It therefore seems reasonable to allow relfrozenxid and relminmxid @@ -1451,6 +1478,25 @@ vac_update_datfrozenxid(void) Assert(TransactionIdIsNormal(newFrozenXid)); Assert(MultiXactIdIsValid(newMinMulti)); + /* + * Global temp table get frozenxid from MyProc + * to avoid the vacuum truncate clog that gtt need. + */ + if (max_active_gtt > 0) + { + TransactionId oldest_gtt_frozenxid = + list_all_session_gtt_frozenxids(0, NULL, NULL, NULL); + + if (TransactionIdIsNormal(oldest_gtt_frozenxid) && + TransactionIdPrecedes(oldest_gtt_frozenxid, newFrozenXid)) + { + ereport(WARNING, + (errmsg("global temp table oldest FrozenXid is far in the past"), + errhint("please truncate them or kill those sessions that use them."))); + newFrozenXid = oldest_gtt_frozenxid; + } + } + /* Now fetch the pg_database tuple we need to update. */ relation = table_open(DatabaseRelationId, RowExclusiveLock); diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 8286d9c..c3992a4 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -591,6 +591,8 @@ static void set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) { + char relpersistence; + /* * The flag has previously been initialized to false, so we can just * return if it becomes clear that we can't safely set it. @@ -618,7 +620,11 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, * the rest of the necessary infrastructure right now anyway. So * for now, bail out if we see a temporary table. */ - if (get_rel_persistence(rte->relid) == RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + relpersistence = get_rel_persistence(rte->relid); + + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) return; /* diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index d6f2153..310a9e2 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -6312,7 +6312,9 @@ plan_create_index_workers(Oid tableOid, Oid indexOid) * Furthermore, any index predicate or index expressions must be parallel * safe. */ + /* global temp table is same as local temp table */ if (heap->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + heap->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP || !is_parallel_safe(root, (Node *) RelationGetIndexExpressions(index)) || !is_parallel_safe(root, (Node *) RelationGetIndexPredicate(index))) { diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 748bebf..a5ddbcd 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2579,6 +2579,11 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("materialized views must not use temporary tables or views"))); + if (is_query_using_gtt(query)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialized views must not use global temporary tables or views"))); + /* * A materialized view would either need to save parameters for use in * maintaining/loading the data or prohibit them entirely. The latter diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index ba5916b..0ee6931 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3290,17 +3290,11 @@ OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; } | LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; } | GLOBAL TEMPORARY { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; } | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; } @@ -11588,19 +11582,13 @@ OptTempTableName: } | GLOBAL TEMPORARY opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED opt_table qualified_name { diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index b875a50..123945b 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -81,6 +81,7 @@ static void expandTupleDesc(TupleDesc tupdesc, Alias *eref, List **colnames, List **colvars); static int specialAttNum(const char *attname); static bool isQueryUsingTempRelation_walker(Node *node, void *context); +static bool is_query_using_gtt_walker(Node *node, void *context); /* @@ -3579,3 +3580,49 @@ isQueryUsingTempRelation_walker(Node *node, void *context) isQueryUsingTempRelation_walker, context); } + +/* check if the query uses global temp table */ +static bool +is_query_using_gtt_walker(Node *node, void *context) +{ + if (node == NULL) + return false; + + if (IsA(node, Query)) + { + Query *query = (Query *) node; + ListCell *rtable; + + foreach(rtable, query->rtable) + { + RangeTblEntry *rte = lfirst(rtable); + + if (rte->rtekind == RTE_RELATION) + { + Relation rel = relation_open(rte->relid, AccessShareLock); + char relpersistence = rel->rd_rel->relpersistence; + + relation_close(rel, AccessShareLock); + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + return true; + } + } + + return query_tree_walker(query, + is_query_using_gtt_walker, + context, + QTW_IGNORE_JOINALIASES); + } + + return expression_tree_walker(node, + is_query_using_gtt_walker, + context); +} + +/* check if the query uses global temp table */ +bool +is_query_using_gtt(Query *query) +{ + return is_query_using_gtt_walker((Node *) query, NULL); +} + diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index ee2d2b5..9c9abaa 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -437,6 +437,9 @@ generateSerialExtraStmts(CreateStmtContext *cxt, ColumnDef *column, seqstmt->sequence = makeRangeVar(snamespace, sname, -1); seqstmt->options = seqoptions; + if (cxt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + seqstmt->sequence->relpersistence = cxt->relation->relpersistence; + /* * If a sequence data type was specified, add it to the options. Prepend * to the list rather than append; in case a user supplied their own AS diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 6d1f28c..ed837d1 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2086,6 +2086,11 @@ do_autovacuum(void) } continue; } + else if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + /* autovacuum skip vacuum global temp table */ + continue; + } /* Fetch reloptions and the pgstat entry for this table */ relopts = extract_autovac_opts(tuple, pg_class_desc); @@ -2152,7 +2157,9 @@ do_autovacuum(void) /* * We cannot safely process other backends' temp tables, so skip 'em. */ - if (classForm->relpersistence == RELPERSISTENCE_TEMP) + /* autovacuum skip vacuum global temp table */ + if (classForm->relpersistence == RELPERSISTENCE_TEMP || + classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) continue; relid = classForm->oid; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index aba3960..3c4b96c 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -37,6 +37,7 @@ #include "access/xlog.h" #include "catalog/catalog.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "executor/instrument.h" #include "lib/binaryheap.h" #include "miscadmin.h" @@ -52,6 +53,7 @@ #include "utils/rel.h" #include "utils/resowner_private.h" #include "utils/timestamp.h" +#include "utils/guc.h" /* Note: these two macros only work on shared buffers, not local ones! */ @@ -432,7 +434,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref) static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, - bool *hit); + bool *hit, Relation rel); static bool PinBuffer(BufferDesc *buf, BufferAccessStrategy strategy); static void PinBuffer_Locked(BufferDesc *buf); static void UnpinBuffer(BufferDesc *buf, bool fixOwner); @@ -664,7 +666,8 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, */ pgstat_count_buffer_read(reln); buf = ReadBuffer_common(reln->rd_smgr, reln->rd_rel->relpersistence, - forkNum, blockNum, mode, strategy, &hit); + forkNum, blockNum, mode, strategy, &hit, + reln); if (hit) pgstat_count_buffer_hit(reln); return buf; @@ -692,7 +695,7 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, Assert(InRecovery); return ReadBuffer_common(smgr, RELPERSISTENCE_PERMANENT, forkNum, blockNum, - mode, strategy, &hit); + mode, strategy, &hit, NULL); } @@ -704,7 +707,8 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, - BufferAccessStrategy strategy, bool *hit) + BufferAccessStrategy strategy, bool *hit, + Relation rel) { BufferDesc *bufHdr; Block bufBlock; @@ -719,6 +723,15 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, isExtend = (blockNum == P_NEW); + /* create storage when first read data page for gtt */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (isExtend || blockNum == 0) && + forkNum == MAIN_FORKNUM && + !gtt_storage_attached(smgr->smgr_rnode.node.relNode)) + { + RelationCreateStorage(smgr->smgr_rnode.node, relpersistence, rel); + } + TRACE_POSTGRESQL_BUFFER_READ_START(forkNum, blockNum, smgr->smgr_rnode.node.spcNode, smgr->smgr_rnode.node.dbNode, @@ -2809,6 +2822,16 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln) BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum) { + /* + * When this backend not init gtt storage + * return 0 + */ + if (RELATION_IS_GLOBAL_TEMP(relation) && + !gtt_storage_attached(relation->rd_node.relNode)) + { + return 0; + } + switch (relation->rd_rel->relkind) { case RELKIND_SEQUENCE: diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c index 427b0d5..7adb969 100644 --- a/src/backend/storage/ipc/ipci.c +++ b/src/backend/storage/ipc/ipci.c @@ -21,6 +21,7 @@ #include "access/nbtree.h" #include "access/subtrans.h" #include "access/twophase.h" +#include "catalog/storage_gtt.h" #include "commands/async.h" #include "miscadmin.h" #include "pgstat.h" @@ -147,6 +148,7 @@ CreateSharedMemoryAndSemaphores(void) size = add_size(size, BTreeShmemSize()); size = add_size(size, SyncScanShmemSize()); size = add_size(size, AsyncShmemSize()); + size = add_size(size, active_gtt_shared_hash_size()); #ifdef EXEC_BACKEND size = add_size(size, ShmemBackendArraySize()); #endif @@ -217,6 +219,8 @@ CreateSharedMemoryAndSemaphores(void) SUBTRANSShmemInit(); MultiXactShmemInit(); InitBufferPool(); + /* global temporary table */ + active_gtt_shared_hash_init(); /* * Set up lock manager diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index c3adb2e..eb95e5f 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -62,6 +62,7 @@ #include "utils/builtins.h" #include "utils/rel.h" #include "utils/snapmgr.h" +#include "utils/guc.h" #define UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) @@ -4087,3 +4088,77 @@ KnownAssignedXidsReset(void) LWLockRelease(ProcArrayLock); } + +/* + * search all active backend to get oldest frozenxid + * for global temp table. + */ +int +list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n) +{ + ProcArrayStruct *arrayP = procArray; + TransactionId result = InvalidTransactionId; + int index; + int flags = 0; + int i = 0; + + if (max_active_gtt <= 0) + return 0; + + if (max_size > 0) + { + Assert(pids); + Assert(xids); + Assert(n); + *n = 0; + } + + if (max_active_gtt <= 0) + return InvalidTransactionId; + + if (RecoveryInProgress()) + return InvalidTransactionId; + + flags |= PROC_IS_AUTOVACUUM; + flags |= PROC_IN_LOGICAL_DECODING; + + LWLockAcquire(ProcArrayLock, LW_SHARED); + if (max_size > 0 && max_size < arrayP->numProcs) + { + LWLockRelease(ProcArrayLock); + elog(ERROR, "list_all_gtt_frozenxids require more array"); + } + + for (index = 0; index < arrayP->numProcs; index++) + { + int pgprocno = arrayP->pgprocnos[index]; + volatile PGPROC *proc = &allProcs[pgprocno]; + volatile PGXACT *pgxact = &allPgXact[pgprocno]; + + if (pgxact->vacuumFlags & flags) + continue; + + if (proc->databaseId == MyDatabaseId && + TransactionIdIsNormal(proc->session_gtt_frozenxid)) + { + if (result == InvalidTransactionId) + result = proc->session_gtt_frozenxid; + else if (TransactionIdPrecedes(proc->session_gtt_frozenxid, result)) + result = proc->session_gtt_frozenxid; + + if (max_size > 0) + { + pids[i] = proc->pid; + xids[i] = proc->session_gtt_frozenxid; + i++; + } + } + } + LWLockRelease(ProcArrayLock); + + if (max_size > 0) + *n = i; + + return result; +} + diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 32df8c8..e4e1125 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -395,6 +395,7 @@ InitProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; @@ -577,6 +578,7 @@ InitAuxiliaryProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index c5b771c..e7725ce 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -646,6 +646,12 @@ mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, */ if (zero_damaged_pages || InRecovery) MemSet(buffer, 0, BLCKSZ); + else if(SmgrIsTemp(reln) && blocknum == 0 && forknum == MAIN_FORKNUM) + { + /* global temp table init btree meta page */ + MemSet(buffer, 0, BLCKSZ); + mdwrite(reln, forknum, blocknum, buffer, true); + } else ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c index 8406644..0d99321 100644 --- a/src/backend/utils/adt/dbsize.c +++ b/src/backend/utils/adt/dbsize.c @@ -1008,6 +1008,9 @@ pg_relation_filepath(PG_FUNCTION_ARGS) Assert(backend != InvalidBackendId); } break; + case RELPERSISTENCE_GLOBAL_TEMP: + backend = BackendIdForTempRelations(); + break; default: elog(ERROR, "invalid relpersistence: %c", relform->relpersistence); backend = InvalidBackendId; /* placate compiler */ diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 7c6f057..eb10cf2 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -112,6 +112,7 @@ #include "catalog/pg_operator.h" #include "catalog/pg_statistic.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "executor/nodeAgg.h" #include "miscadmin.h" #include "nodes/makefuncs.h" @@ -4578,12 +4579,25 @@ examine_variable(PlannerInfo *root, Node *node, int varRelid, } else if (index->indpred == NIL) { - vardata->statsTuple = - SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(index->indexoid), - Int16GetDatum(pos + 1), - BoolGetDatum(false)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(index->indexoid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = + get_gtt_att_statistic(index->indexoid, + Int16GetDatum(pos + 1), + false); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + vardata->statsTuple = + SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(index->indexoid), + Int16GetDatum(pos + 1), + BoolGetDatum(false)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -4708,15 +4722,27 @@ examine_simple_variable(PlannerInfo *root, Var *var, } else if (rte->rtekind == RTE_RELATION) { - /* - * Plain table or parent of an inheritance appendrel, so look up the - * column in pg_statistic - */ - vardata->statsTuple = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(rte->relid), - Int16GetDatum(var->varattno), - BoolGetDatum(rte->inh)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(rte->relid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = get_gtt_att_statistic(rte->relid, + var->varattno, + rte->inh); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + /* + * Plain table or parent of an inheritance appendrel, so look up the + * column in pg_statistic + */ + vardata->statsTuple = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(rte->relid), + Int16GetDatum(var->varattno), + BoolGetDatum(rte->inh)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -6098,6 +6124,7 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, { /* Simple variable --- look to stats for the underlying table */ RangeTblEntry *rte = planner_rt_fetch(index->rel->relid, root); + char rel_persistence = get_rel_persistence(rte->relid); Assert(rte->rtekind == RTE_RELATION); relid = rte->relid; @@ -6115,6 +6142,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + rte->inh); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -6126,6 +6160,8 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* Expression --- maybe there are stats for the index itself */ relid = index->indexoid; colnum = 1; @@ -6141,6 +6177,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -7054,6 +7097,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, /* attempt to lookup stats in relation for this index column */ if (attnum != 0) { + char rel_persistence = get_rel_persistence(rte->relid); + /* Simple variable -- look to stats for the underlying table */ if (get_relation_stats_hook && (*get_relation_stats_hook) (root, rte, attnum, &vardata)) @@ -7066,6 +7111,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(rte->relid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = @@ -7078,6 +7131,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* * Looks like we've found an expression column in the index. Let's * see if there's any stats for it. @@ -7097,6 +7152,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(index->indexoid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 1e3e6d3..345e3e9 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -34,6 +34,7 @@ #include "catalog/pg_statistic.h" #include "catalog/pg_transform.h" #include "catalog/pg_type.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "utils/array.h" @@ -2878,6 +2879,18 @@ get_attavgwidth(Oid relid, AttrNumber attnum) if (stawidth > 0) return stawidth; } + if (get_rel_persistence(relid) == RELPERSISTENCE_GLOBAL_TEMP) + { + tp = get_gtt_att_statistic(relid, attnum, false); + if (!HeapTupleIsValid(tp)) + return 0; + + stawidth = ((Form_pg_statistic) GETSTRUCT(tp))->stawidth; + if (stawidth > 0) + return stawidth; + else + return 0; + } tp = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(relid), Int16GetDatum(attnum), diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index df025a5..e33269b 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -63,6 +63,7 @@ #include "catalog/pg_type.h" #include "catalog/schemapg.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/policy.h" #include "commands/trigger.h" #include "miscadmin.h" @@ -1095,13 +1096,13 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) case RELPERSISTENCE_UNLOGGED: case RELPERSISTENCE_PERMANENT: relation->rd_backend = InvalidBackendId; - relation->rd_islocaltemp = false; + relation->rd_istemp = false; break; case RELPERSISTENCE_TEMP: if (isTempOrTempToastNamespace(relation->rd_rel->relnamespace)) { relation->rd_backend = BackendIdForTempRelations(); - relation->rd_islocaltemp = true; + relation->rd_istemp = true; } else { @@ -1114,14 +1115,36 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) * from a crashed backend that coincidentally had the same * BackendId we're using. We should *not* consider such a * table to be "ours"; this is why we need the separate - * rd_islocaltemp flag. The pg_class entry will get flushed + * rd_istemp flag. The pg_class entry will get flushed * if/when we clean out the corresponding temp table namespace * in preparation for using it. */ relation->rd_backend = GetTempNamespaceBackendId(relation->rd_rel->relnamespace); Assert(relation->rd_backend != InvalidBackendId); - relation->rd_islocaltemp = false; + relation->rd_istemp = false; + } + break; + case RELPERSISTENCE_GLOBAL_TEMP: + { + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + + relation->rd_backend = BackendIdForTempRelations(); + /* + * For global temp table, all backend can use + * this relation, so rd_istemp always true. + */ + relation->rd_istemp = true; + get_gtt_relstats(RelationGetRelid(relation), + &relpages, + &reltuples, + &relallvisible, + NULL, NULL); + relation->rd_rel->relpages = (int32)relpages; + relation->rd_rel->reltuples = (float4)reltuples; + relation->rd_rel->relallvisible = (int32)relallvisible; } break; default: @@ -1178,6 +1201,7 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) case RELKIND_PARTITIONED_INDEX: Assert(relation->rd_rel->relam != InvalidOid); RelationInitIndexAccessInfo(relation); + gtt_fix_index_state(relation); break; case RELKIND_RELATION: case RELKIND_TOASTVALUE: @@ -1815,7 +1839,7 @@ formrdesc(const char *relationName, Oid relationReltype, relation->rd_createSubid = InvalidSubTransactionId; relation->rd_newRelfilenodeSubid = InvalidSubTransactionId; relation->rd_backend = InvalidBackendId; - relation->rd_islocaltemp = false; + relation->rd_istemp = false; /* * initialize relation tuple form @@ -2217,6 +2241,8 @@ RelationReloadIndexInfo(Relation relation) HeapTupleHeaderGetXmin(tuple->t_data)); ReleaseSysCache(tuple); + + gtt_fix_index_state(relation); } /* Okay, now it's valid again */ @@ -3306,12 +3332,16 @@ RelationBuildLocalRelation(const char *relname, case RELPERSISTENCE_UNLOGGED: case RELPERSISTENCE_PERMANENT: rel->rd_backend = InvalidBackendId; - rel->rd_islocaltemp = false; + rel->rd_istemp = false; break; case RELPERSISTENCE_TEMP: Assert(isTempOrTempToastNamespace(relnamespace)); rel->rd_backend = BackendIdForTempRelations(); - rel->rd_islocaltemp = true; + rel->rd_istemp = true; + break; + case RELPERSISTENCE_GLOBAL_TEMP: + rel->rd_backend = BackendIdForTempRelations(); + rel->rd_istemp = true; break; default: elog(ERROR, "invalid relpersistence: %c", relpersistence); @@ -3427,6 +3457,9 @@ RelationSetNewRelfilenode(Relation relation, char persistence) TransactionId freezeXid = InvalidTransactionId; RelFileNode newrnode; + if (RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "global temp table does not allow setting new relfilenode"); + /* Allocate a new relfilenode */ newrelfilenode = GetNewRelFileNode(relation->rd_rel->reltablespace, NULL, persistence); @@ -3467,7 +3500,7 @@ RelationSetNewRelfilenode(Relation relation, char persistence) /* handle these directly, at least for now */ SMgrRelation srel; - srel = RelationCreateStorage(newrnode, persistence); + srel = RelationCreateStorage(newrnode, persistence, relation); smgrclose(srel); } break; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index cacbe90..9c4220b 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -140,6 +140,18 @@ char *GUC_check_errmsg_string; char *GUC_check_errdetail_string; char *GUC_check_errhint_string; +/* + * num = 0 means disable global temp table feature. + * global temp table define can still storage in catalog + * just can not use. + * num > 0 means database can management num active global temp table. + */ +#define MIN_NUM_ACTIVE_GTT 0 +#define DEFAULT_NUM_ACTIVE_GTT 1000 +#define MAX_NUM_ACTIVE_GTT 1000000 + +int max_active_gtt = MIN_NUM_ACTIVE_GTT; + static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3, 4); static void set_config_sourcefile(const char *name, char *sourcefile, @@ -2012,6 +2024,15 @@ static struct config_bool ConfigureNamesBool[] = static struct config_int ConfigureNamesInt[] = { { + {"max_active_global_temporary_table", PGC_POSTMASTER, UNGROUPED, + gettext_noop("max active global temporary table."), + NULL + }, + &max_active_gtt, + DEFAULT_NUM_ACTIVE_GTT, MIN_NUM_ACTIVE_GTT, MAX_NUM_ACTIVE_GTT, + NULL, NULL, NULL + }, + { {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Forces a switch to the next WAL file if a " "new file has not been started within N seconds."), diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 799b698..b98d396 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15583,6 +15583,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) { char *ftoptions = NULL; char *srvname = NULL; + char *table_type = NULL; switch (tbinfo->relkind) { @@ -15634,9 +15635,15 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) binary_upgrade_set_pg_class_oids(fout, q, tbinfo->dobj.catId.oid, false); + if (tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED) + table_type = "UNLOGGED "; + else if (tbinfo->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + table_type = "GLOBAL TEMPORARY "; + else + table_type = ""; + appendPQExpBuffer(q, "CREATE %s%s %s", - tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ? - "UNLOGGED " : "", + table_type, reltypename, qualrelname); diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index f3c7eb9..28134e2 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3723,7 +3723,8 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys if (pset.sversion >= 90100) { appendPQExpBuffer(&buf, - ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + ",\n CASE c.relpersistence WHEN 'g' THEN '%s' WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + gettext_noop("session"), gettext_noop("permanent"), gettext_noop("temporary"), gettext_noop("unlogged"), diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index dc03fbd..8bd6d09 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -1016,6 +1016,8 @@ static const pgsql_thing_t words_after_create[] = { {"FOREIGN TABLE", NULL, NULL, NULL}, {"FUNCTION", NULL, NULL, Query_for_list_of_functions}, {"GROUP", Query_for_list_of_roles}, + {"GLOBAL", NULL, NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE GLOBAL TEMP/TEMPORARY TABLE + * ... */ {"INDEX", NULL, NULL, &Query_for_list_of_indexes}, {"LANGUAGE", Query_for_list_of_languages}, {"LARGE OBJECT", NULL, NULL, NULL, THING_NO_CREATE | THING_NO_DROP}, @@ -2378,6 +2380,9 @@ psql_completion(const char *text, int start, int end) /* CREATE FOREIGN DATA WRAPPER */ else if (Matches("CREATE", "FOREIGN", "DATA", "WRAPPER", MatchAny)) COMPLETE_WITH("HANDLER", "VALIDATOR", "OPTIONS"); + /* CREATE GLOBAL TEMP/TEMPORARY*/ + else if (Matches("CREATE", "GLOBAL")) + COMPLETE_WITH("TEMP", "TEMPORARY"); /* CREATE INDEX --- is allowed inside CREATE SCHEMA, so use TailMatches */ /* First off we complete CREATE UNIQUE with "INDEX" */ @@ -2586,6 +2591,8 @@ psql_completion(const char *text, int start, int end) /* Complete "CREATE TEMP/TEMPORARY" with the possible temp objects */ else if (TailMatches("CREATE", "TEMP|TEMPORARY")) COMPLETE_WITH("SEQUENCE", "TABLE", "VIEW"); + else if (TailMatches("CREATE", "GLOBAL", "TEMP|TEMPORARY")) + COMPLETE_WITH("TABLE"); /* Complete "CREATE UNLOGGED" with TABLE or MATVIEW */ else if (TailMatches("CREATE", "UNLOGGED")) COMPLETE_WITH("TABLE", "MATERIALIZED VIEW"); diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index a12fc1f..78958e4 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -165,6 +165,7 @@ typedef FormData_pg_class *Form_pg_class; #define RELPERSISTENCE_PERMANENT 'p' /* regular table */ #define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */ #define RELPERSISTENCE_TEMP 't' /* temporary table */ +#define RELPERSISTENCE_GLOBAL_TEMP 'g' /* global temporary table */ /* default selection for replica identity (primary key or nothing) */ #define REPLICA_IDENTITY_DEFAULT 'd' diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index bef50c7..bc36c6c 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5504,6 +5504,40 @@ proparallel => 'r', prorettype => 'float8', proargtypes => 'oid', prosrc => 'pg_stat_get_xact_function_self_time' }, +# For global temporary table +{ oid => '4191', + descr => 'List local statistics for global temporary table', + proname => 'pg_get_gtt_statistics', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid int4 anyelement', + proallargtypes => '{oid,int4,anyelement,oid,int2,bool,float4,int4,float4,int2,int2,int2,int2,int2,oid,oid,oid,oid,oid,oid,oid,oid,oid,oid,_float4,_float4,_float4,_float4,_float4,anyarray,anyarray,anyarray,anyarray,anyarray}', + proargmodes => '{i,i,i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}', + proargnames => '{relid,att,x,starelid,staattnum,stainherit,stanullfrac,stawidth,stadistinct,stakind1,stakind2,stakind3,stakind4,stakind5,staop1,staop2,staop3,staop4,staop5,stacoll1,stacoll2,stacoll3,stacoll4,stacoll5,stanumbers1,stanumbers2,stanumbers3,stanumbers4,stanumbers5,stavalues1,stavalues2,stavalues3,stavalues4,stavalues5}', + prosrc => 'pg_get_gtt_statistics' }, +{ oid => '4192', + descr => 'List local relstats for global temporary table', + proname => 'pg_get_gtt_relstats', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,int4,float4,int4,xid,xid}', + proargmodes => '{i,o,o,o,o,o}', + proargnames => '{relid,relpages,reltuples,relallvisible,relfrozenxid,relminmxid}', + prosrc => 'pg_get_gtt_relstats' }, +{ oid => '4193', + descr => 'List attached pid for one global temporary table', + proname => 'pg_gtt_attached_pid', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,oid,int4}', + proargmodes => '{i,o,o}', + proargnames => '{relid,relid,pid}', + prosrc => 'pg_gtt_attached_pid' }, +{ oid => '4194', + descr => 'List those backends that have used global temporary table', + proname => 'pg_list_gtt_relfrozenxids', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => '', + proallargtypes => '{int4,xid}', + proargmodes => '{o,o}', + proargnames => '{pid,relfrozenxid}', + prosrc => 'pg_list_gtt_relfrozenxids' }, + { oid => '3788', descr => 'statistics: timestamp of the current statistics snapshot', proname => 'pg_stat_get_snapshot_timestamp', provolatile => 's', diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h index 048003c..af48cdf 100644 --- a/src/include/catalog/storage.h +++ b/src/include/catalog/storage.h @@ -19,7 +19,7 @@ #include "storage/smgr.h" #include "utils/relcache.h" -extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence); +extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel); extern void RelationDropStorage(Relation rel); extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit); extern void RelationTruncate(Relation rel, BlockNumber nblocks); diff --git a/src/include/catalog/storage_gtt.h b/src/include/catalog/storage_gtt.h new file mode 100644 index 0000000..aa80cb5 --- /dev/null +++ b/src/include/catalog/storage_gtt.h @@ -0,0 +1,41 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.h + * prototypes for functions in backend/catalog/storage_gtt.c + * + * src/include/catalog/storage_gtt.h + * + *------------------------------------------------------------------------- + */ +#ifndef STORAGE_GTT_H +#define STORAGE_GTT_H + +#include "access/htup.h" +#include "storage/block.h" +#include "storage/relfilenode.h" +#include "utils/relcache.h" + +extern Size active_gtt_shared_hash_size(void); +extern void active_gtt_shared_hash_init(void); +extern void remember_gtt_storage_info(RelFileNode rnode, Relation rel); +extern void forget_gtt_storage_info(Oid relid); +extern bool is_other_backend_use_gtt(RelFileNode node); +extern bool gtt_storage_attached(Oid relid); +extern Bitmapset *copy_active_gtt_bitmap(RelFileNode node); +extern void up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull); +extern HeapTuple get_gtt_att_statistic(Oid reloid, int attnum, bool inh); +extern void release_gtt_statistic_cache(HeapTuple tup); +extern void up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid); +extern bool get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid); +extern void gtt_force_enable_index(Relation index); +extern void gtt_fix_index_state(Relation index); + +#endif /* STORAGE_H */ diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index 93f9446..14cafae 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -120,4 +120,7 @@ extern Oid attnumTypeId(Relation rd, int attid); extern Oid attnumCollationId(Relation rd, int attid); extern bool isQueryUsingTempRelation(Query *query); +/* global temp table check */ +extern bool is_query_using_gtt(Query *query); + #endif /* PARSE_RELATION_H */ diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 870ecb5..92c590e 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -405,6 +405,8 @@ do { \ #define PageClearPrunable(page) \ (((PageHeader) (page))->pd_prune_xid = InvalidTransactionId) +#define GlobalTempRelationPageIsNotInitialized(rel, page) \ + ((rel)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && PageIsNew(page)) /* ---------------------------------------------------------------- * extern declarations diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 8fda8e4..172eae9 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -220,6 +220,7 @@ typedef enum BuiltinTrancheIds LWTRANCHE_TBM, LWTRANCHE_PARALLEL_APPEND, LWTRANCHE_SXACT, + LWTRANCHE_GTT_CTL, LWTRANCHE_FIRST_USER_DEFINED } BuiltinTrancheIds; diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index d217801..8adde87 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -117,6 +117,8 @@ struct PGPROC Oid tempNamespaceId; /* OID of temp schema this backend is * using */ + TransactionId session_gtt_frozenxid; /* session level global temp table relfrozenxid */ + bool isBackgroundWorker; /* true if background worker. */ /* diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index a5c7d0c..a86f61f 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -125,4 +125,6 @@ extern void ProcArraySetReplicationSlotXmin(TransactionId xmin, extern void ProcArrayGetReplicationSlotXmin(TransactionId *xmin, TransactionId *catalog_xmin); +extern int list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n); + #endif /* PROCARRAY_H */ diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index ce93ace..0f7262e 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -281,6 +281,10 @@ extern int tcp_user_timeout; extern bool trace_sort; #endif +/* global temporary table */ +extern int max_active_gtt; +/* end */ + /* * Functions exported by guc.c */ diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 44ed04d..9f29744 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -57,7 +57,7 @@ typedef struct RelationData struct SMgrRelationData *rd_smgr; /* cached file handle, or NULL */ int rd_refcnt; /* reference count */ BackendId rd_backend; /* owning backend id, if temporary relation */ - bool rd_islocaltemp; /* rel is a temp rel of this session */ + bool rd_istemp; /* rel is a temp rel of this session */ bool rd_isnailed; /* rel is nailed in cache */ bool rd_isvalid; /* relcache entry is valid */ bool rd_indexvalid; /* is rd_indexlist valid? (also rd_pkindex and @@ -277,6 +277,7 @@ typedef struct StdRdOptions int parallel_workers; /* max number of parallel workers */ bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */ bool vacuum_truncate; /* enables vacuum to truncate a relation */ + bool on_commit_delete_rows; /* global temp table */ } StdRdOptions; #define HEAP_MIN_FILLFACTOR 10 @@ -535,7 +536,8 @@ typedef struct ViewOptions * True if relation's pages are stored in local buffers. */ #define RelationUsesLocalBuffers(relation) \ - ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP || \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) /* * RELATION_IS_LOCAL @@ -546,7 +548,7 @@ typedef struct ViewOptions * Beware of multiple eval of argument */ #define RELATION_IS_LOCAL(relation) \ - ((relation)->rd_islocaltemp || \ + ((relation)->rd_istemp || \ (relation)->rd_createSubid != InvalidSubTransactionId) /* @@ -557,7 +559,7 @@ typedef struct ViewOptions */ #define RELATION_IS_OTHER_TEMP(relation) \ ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP && \ - !(relation)->rd_islocaltemp) + !(relation)->rd_istemp) /* @@ -602,6 +604,17 @@ typedef struct ViewOptions RelationNeedsWAL(relation) && \ !IsCatalogRelation(relation)) +/* global temp table implementations */ +#define RELATION_IS_GLOBAL_TEMP(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + +#define RELATION_GTT_ON_COMMIT_DELETE(relation) \ + ((relation)->rd_options && \ + ((relation)->rd_rel->relkind == RELKIND_RELATION || (relation)->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) && \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP ? \ + ((StdRdOptions *) (relation)->rd_options)->on_commit_delete_rows : false) + +#define RelationGetRelPersistence(relation) ((relation)->rd_rel->relpersistence) + /* routines in utils/cache/relcache.c */ extern void RelationIncrementReferenceCount(Relation rel); extern void RelationDecrementReferenceCount(Relation rel); diff --git a/src/test/regress/expected/gtt_clean.out b/src/test/regress/expected/gtt_clean.out new file mode 100644 index 0000000..50ca9ac --- /dev/null +++ b/src/test/regress/expected/gtt_clean.out @@ -0,0 +1,7 @@ +reset search_path; +drop schema gtt cascade; +NOTICE: drop cascades to 4 other objects +DETAIL: drop cascades to table gtt.gtt1 +drop cascades to table gtt.gtt2 +drop cascades to table gtt.gtt3 +drop cascades to table gtt.gtt_t_kenyon diff --git a/src/test/regress/expected/gtt_function.out b/src/test/regress/expected/gtt_function.out new file mode 100644 index 0000000..a477917 --- /dev/null +++ b/src/test/regress/expected/gtt_function.out @@ -0,0 +1,197 @@ +CREATE SCHEMA IF NOT EXISTS gtt_function; +set search_path=gtt_function,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt_test_rename(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); +ERROR: cannot create indexes on global temporary tables using concurrent mode +-- ERROR +cluster gtt1 using gtt1_pkey; +ERROR: not support cluster global temporary tables yet +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; +ERROR: ON COMMIT can only be used on temporary tables +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); +ERROR: regular table cannot specifie on_commit_delete_rows +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; + count +------- + 2 +(1 row) + +commit; +select count(*) from p_table01; + count +------- + 0 +(1 row) + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +ERROR: The parent table must be global temporary table +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + relname | relkind | relpersistence | reloptions +---------------------------------+---------+----------------+------------------------------- + p_table01 | p | g | {on_commit_delete_rows=true} + p_table01_2017 | r | g | {on_commit_delete_rows=true} + p_table01_2018 | r | g | {on_commit_delete_rows=true} + p_table01_id_seq | S | g | + p_table02 | p | g | {on_commit_delete_rows=false} + p_table02_2017 | r | g | {on_commit_delete_rows=false} + p_table02_2018 | r | g | {on_commit_delete_rows=false} + p_table02_id_seq | S | g | + tbl_inherits_parent | r | p | + tbl_inherits_parent_global_temp | r | g | {on_commit_delete_rows=true} + tbl_inherits_partition | r | g | {on_commit_delete_rows=true} +(11 rows) + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; +ERROR: global temp table not support on commit drop clause +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; +ERROR: can not defeine global temp table with on commit and with clause at same time +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); +--ok +alter table gtt_test_rename rename to gtt_test; +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; + id | a +----+--- + 2 | 1 + 3 | 2 +(2 rows) + +truncate gtt_seq; +select * from gtt_seq order by id; + id | a +----+--- +(0 rows) + +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + id | a +----+--- + 4 | 3 +(1 row) + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; +ERROR: materialized views must not use global temporary tables or views +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +ERROR: only support btree index on global temp table +create index idx_err on gtt1 using gist (a); +ERROR: data type integer has no default operator class for access method "gist" +HINT: You must specify an operator class for the index or define a default operator class for the data type. +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +ERROR: only support btree index on global temp table +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); +ERROR: only support btree index on global temp table +reset search_path; +drop schema gtt_function cascade; +NOTICE: drop cascades to 15 other objects +DETAIL: drop cascades to table gtt_function.gtt1 +drop cascades to table gtt_function.gtt_test +drop cascades to table gtt_function.gtt2 +drop cascades to table gtt_function.gtt3 +drop cascades to table gtt_function.tmp_t0 +drop cascades to table gtt_function.tbl_inherits_parent +drop cascades to table gtt_function.tbl_inherits_parent_global_temp +drop cascades to table gtt_function.products +drop cascades to table gtt_function.measurement +drop cascades to table gtt_function.p_table01 +drop cascades to table gtt_function.p_table02 +drop cascades to table gtt_function.tbl_inherits_partition +drop cascades to table gtt_function.gtt5 +drop cascades to table gtt_function.mytable +drop cascades to table gtt_function.gtt_seq diff --git a/src/test/regress/expected/gtt_parallel_1.out b/src/test/regress/expected/gtt_parallel_1.out new file mode 100644 index 0000000..30d8a7b --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_1.out @@ -0,0 +1,84 @@ +set search_path=gtt,sys; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_parallel_2.out b/src/test/regress/expected/gtt_parallel_2.out new file mode 100644 index 0000000..850ef3e --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_2.out @@ -0,0 +1,161 @@ +set search_path=gtt,sys; +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +commit; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 + 3 | test1 +(3 rows) + +rollback; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test2 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; + a | b +---+------- + 3 | test3 +(1 row) + +rollback; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; + a | b +---+------- + 5 | test5 +(1 row) + +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + a | b +---+------- + 6 | test6 +(1 row) + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; + count +-------- + 100000 +(1 row) + +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + QUERY PLAN +------------------------------------ + Index Scan using gtt3_pkey on gtt3 + Index Cond: (a = 300) +(2 rows) + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; + relname | pg_relation_size | pg_relation_size | pg_table_size | pg_indexes_size | pg_total_relation_size +--------------+------------------+------------------+---------------+-----------------+------------------------ + gtt_t_kenyon | 450560 | 8192 | 499712 | 475136 | 974848 +(1 row) + +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + relname +-------------- + gtt_t_kenyon +(1 row) + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + relname | pg_relation_size | pg_table_size | pg_total_relation_size +--------------------+------------------+---------------+------------------------ + idx_gtt_t_kenyon_1 | 65536 | 65536 | 65536 + idx_gtt_t_kenyon_2 | 409600 | 409600 | 409600 +(2 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_prepare.out b/src/test/regress/expected/gtt_prepare.out new file mode 100644 index 0000000..9fe5fd4 --- /dev/null +++ b/src/test/regress/expected/gtt_prepare.out @@ -0,0 +1,9 @@ +CREATE SCHEMA IF NOT EXISTS gtt; +set search_path=gtt,sys; +create global temp table gtt1(a int primary key, b text) on commit delete rows; +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text); +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; diff --git a/src/test/regress/expected/gtt_stats.out b/src/test/regress/expected/gtt_stats.out new file mode 100644 index 0000000..b258b7c --- /dev/null +++ b/src/test/regress/expected/gtt_stats.out @@ -0,0 +1,76 @@ +CREATE SCHEMA IF NOT EXISTS gtt_stats; +set search_path=gtt_stats,sys; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +insert into gtt values(generate_series(1,10000),'test'); +-- expect 1 +select count(*) from pg_gtt_attached_pids; + count +------- + 1 +(1 row) + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 2 +(1 row) + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 0 | 0 | 0 +(1 row) + +-- expect 0 +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+------------------+-------------+-------------------+------------------------+---------------------- +(0 rows) + +analyze gtt; +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 55 | 10000 | 0 +(1 row) + +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------------------+------------------------+---------------------- + gtt_stats | gtt | a | f | 0 | 4 | -1 | | | {1,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,8700,8800,8900,9000,9100,9200,9300,9400,9500,9600,9700,9800,9900,10000} | 1 | | | + gtt_stats | gtt | b | f | 0 | 5 | 1 | {test} | {1} | | 1 | | | +(2 rows) + +reset search_path; +drop schema gtt_stats cascade; +NOTICE: drop cascades to table gtt_stats.gtt diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 70e1e2f..30cf4bd 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1348,6 +1348,93 @@ pg_group| SELECT pg_authid.rolname AS groname, WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin); +pg_gtt_attached_pids| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relid, + s.pid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_gtt_attached_pid(c.oid) s(relid, pid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_relstats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relpages, + s.reltuples, + s.relallvisible, + s.relfrozenxid, + s.relminmxid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_relstats(c.oid) s(relpages, reltuples, relallvisible, relfrozenxid, relminmxid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_stats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN (s.stakind1 = 1) THEN s.stavalues1 + WHEN (s.stakind2 = 1) THEN s.stavalues2 + WHEN (s.stakind3 = 1) THEN s.stavalues3 + WHEN (s.stakind4 = 1) THEN s.stavalues4 + WHEN (s.stakind5 = 1) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_vals, + CASE + WHEN (s.stakind1 = 1) THEN s.stanumbers1 + WHEN (s.stakind2 = 1) THEN s.stanumbers2 + WHEN (s.stakind3 = 1) THEN s.stanumbers3 + WHEN (s.stakind4 = 1) THEN s.stanumbers4 + WHEN (s.stakind5 = 1) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_freqs, + CASE + WHEN (s.stakind1 = 2) THEN s.stavalues1 + WHEN (s.stakind2 = 2) THEN s.stavalues2 + WHEN (s.stakind3 = 2) THEN s.stavalues3 + WHEN (s.stakind4 = 2) THEN s.stavalues4 + WHEN (s.stakind5 = 2) THEN s.stavalues5 + ELSE NULL::text[] + END AS histogram_bounds, + CASE + WHEN (s.stakind1 = 3) THEN s.stanumbers1[1] + WHEN (s.stakind2 = 3) THEN s.stanumbers2[1] + WHEN (s.stakind3 = 3) THEN s.stanumbers3[1] + WHEN (s.stakind4 = 3) THEN s.stanumbers4[1] + WHEN (s.stakind5 = 3) THEN s.stanumbers5[1] + ELSE NULL::real + END AS correlation, + CASE + WHEN (s.stakind1 = 4) THEN s.stavalues1 + WHEN (s.stakind2 = 4) THEN s.stavalues2 + WHEN (s.stakind3 = 4) THEN s.stavalues3 + WHEN (s.stakind4 = 4) THEN s.stavalues4 + WHEN (s.stakind5 = 4) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_elems, + CASE + WHEN (s.stakind1 = 4) THEN s.stanumbers1 + WHEN (s.stakind2 = 4) THEN s.stanumbers2 + WHEN (s.stakind3 = 4) THEN s.stanumbers3 + WHEN (s.stakind4 = 4) THEN s.stanumbers4 + WHEN (s.stakind5 = 4) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_elem_freqs, + CASE + WHEN (s.stakind1 = 5) THEN s.stanumbers1 + WHEN (s.stakind2 = 5) THEN s.stanumbers2 + WHEN (s.stakind3 = 5) THEN s.stanumbers3 + WHEN (s.stakind4 = 5) THEN s.stanumbers4 + WHEN (s.stakind5 = 5) THEN s.stanumbers5 + ELSE NULL::real[] + END AS elem_count_histogram + FROM ((pg_class c + JOIN pg_attribute a ON ((c.oid = a.attrelid))) + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_statistics(c.oid, (a.attnum)::integer, ''::text) s(starelid, staattnum, stainherit, stanullfrac, stawidth, stadistinct, stakind1, stakind2, stakind3, stakind4, stakind5, staop1, staop2, staop3, staop4, staop5, stacoll1, stacoll2, stacoll3, stacoll4, stacoll5, stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5, stavalues1, stavalues2, stavalues3, stavalues4, stavalues5) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND (NOT a.attisdropped) AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); pg_hba_file_rules| SELECT a.line_number, a.type, a.database, diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index d2b17dd..80e577f 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -121,3 +121,10 @@ test: fast_default # run stats by itself because its delay may be insufficient under heavy load test: stats + +# global temp table test +test: gtt_stats +test: gtt_function +test: gtt_prepare +test: gtt_parallel_1 gtt_parallel_2 +test: gtt_clean diff --git a/src/test/regress/sql/gtt_clean.sql b/src/test/regress/sql/gtt_clean.sql new file mode 100644 index 0000000..f3cf710 --- /dev/null +++ b/src/test/regress/sql/gtt_clean.sql @@ -0,0 +1,6 @@ + + +reset search_path; + +drop schema gtt cascade; + diff --git a/src/test/regress/sql/gtt_function.sql b/src/test/regress/sql/gtt_function.sql new file mode 100644 index 0000000..cfc1879 --- /dev/null +++ b/src/test/regress/sql/gtt_function.sql @@ -0,0 +1,163 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_function; + +set search_path=gtt_function,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt_test_rename(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); + +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; + +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); + +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); + +-- ERROR +cluster gtt1 using gtt1_pkey; + +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; + +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); + +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); + +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; +commit; + +select count(*) from p_table01; + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; + +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; + +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; + +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; + +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); + +--ok +alter table gtt_test_rename rename to gtt_test; + +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); + +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; + +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; +truncate gtt_seq; +select * from gtt_seq order by id; +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; + +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +create index idx_err on gtt1 using gist (a); +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); + +reset search_path; + +drop schema gtt_function cascade; + diff --git a/src/test/regress/sql/gtt_parallel_1.sql b/src/test/regress/sql/gtt_parallel_1.sql new file mode 100644 index 0000000..d7d81de --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_1.sql @@ -0,0 +1,42 @@ + + +set search_path=gtt,sys; + +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +commit; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +rollback; +select * from gtt1 order by a; + +truncate gtt1; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +select * from gtt1 order by a; +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + +begin; +select * from gtt1 order by a; +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +commit; +select * from gtt1 order by a; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_parallel_2.sql b/src/test/regress/sql/gtt_parallel_2.sql new file mode 100644 index 0000000..5203c2b --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_2.sql @@ -0,0 +1,76 @@ + + +set search_path=gtt,sys; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; +commit; +select * from gtt3 order by a; + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +truncate gtt3; +select * from gtt3 order by a; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; +truncate gtt3; +select * from gtt3 order by a; +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +begin; +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_prepare.sql b/src/test/regress/sql/gtt_prepare.sql new file mode 100644 index 0000000..2f4d883 --- /dev/null +++ b/src/test/regress/sql/gtt_prepare.sql @@ -0,0 +1,16 @@ + +CREATE SCHEMA IF NOT EXISTS gtt; + +set search_path=gtt,sys; + +create global temp table gtt1(a int primary key, b text) on commit delete rows; + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text); + +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; + diff --git a/src/test/regress/sql/gtt_stats.sql b/src/test/regress/sql/gtt_stats.sql new file mode 100644 index 0000000..f041892 --- /dev/null +++ b/src/test/regress/sql/gtt_stats.sql @@ -0,0 +1,42 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_stats; + +set search_path=gtt_stats,sys; + +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +insert into gtt values(generate_series(1,10000),'test'); + +-- expect 1 +select count(*) from pg_gtt_attached_pids; + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +-- expect 0 +select * from pg_gtt_stats order by tablename; + +analyze gtt; + +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +select * from pg_gtt_stats order by tablename; + +reset search_path; + +drop schema gtt_stats cascade; + ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-28 17:13 Pavel Stehule <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-28 17:13 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> út 28. 1. 2020 v 18:12 odesílatel 曾文旌(义从) <[email protected]> napsal: > > > 2020年1月29日 上午12:40,Pavel Stehule <[email protected]> 写道: > > > > út 28. 1. 2020 v 17:01 odesílatel 曾文旌(义从) <[email protected]> > napsal: > >> >> >> 2020年1月24日 上午4:47,Robert Haas <[email protected]> 写道: >> >> On Sat, Jan 11, 2020 at 8:51 PM Tomas Vondra >> <[email protected]> wrote: >> >> I proposed just ignoring those new indexes because it seems much simpler >> than alternative solutions that I can think of, and it's not like those >> other solutions don't have other issues. >> >> >> +1. >> >> I complete the implementation of this feature. >> When a session x create an index idx_a on GTT A then >> For session x, idx_a is valid when after create index. >> For session y, before session x create index done, GTT A has some data, >> then index_a is invalid. >> For session z, before session x create index done, GTT A has no data, >> then index_a is valid. >> >> >> For example, I've looked at the "on demand" building as implemented in >> global_private_temp-8.patch, I kinda doubt adding a bunch of index build >> calls into various places in index code seems somewht suspicious. >> >> >> +1. I can't imagine that's a safe or sane thing to do. >> >> -- >> Robert Haas >> EnterpriseDB: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> >> >> Opinion by Pavel >> + rel->rd_islocaltemp = true; <<<<<<< if this is valid, then the name of >> field "rd_islocaltemp" is not probably best >> I renamed rd_islocaltemp >> > > I don't see any change? > > Rename rd_islocaltemp to rd_istemp > in global_temporary_table_v8-pg13.patch > ok :) Pavel > > > Wenjing > > > > > > >> Opinion by Konstantin Knizhnik >> 1 Fixed comments >> 2 Fixed assertion >> >> >> Please help me review. >> >> >> Wenjing >> >> > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-28 17:54 Pavel Stehule <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 2 replies; 1038+ messages in thread From: Pavel Stehule @ 2020-01-28 17:54 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> út 28. 1. 2020 v 18:13 odesílatel Pavel Stehule <[email protected]> napsal: > > > út 28. 1. 2020 v 18:12 odesílatel 曾文旌(义从) <[email protected]> > napsal: > >> >> >> 2020年1月29日 上午12:40,Pavel Stehule <[email protected]> 写道: >> >> >> >> út 28. 1. 2020 v 17:01 odesílatel 曾文旌(义从) <[email protected]> >> napsal: >> >>> >>> >>> 2020年1月24日 上午4:47,Robert Haas <[email protected]> 写道: >>> >>> On Sat, Jan 11, 2020 at 8:51 PM Tomas Vondra >>> <[email protected]> wrote: >>> >>> I proposed just ignoring those new indexes because it seems much simpler >>> than alternative solutions that I can think of, and it's not like those >>> other solutions don't have other issues. >>> >>> >>> +1. >>> >>> I complete the implementation of this feature. >>> When a session x create an index idx_a on GTT A then >>> For session x, idx_a is valid when after create index. >>> For session y, before session x create index done, GTT A has some data, >>> then index_a is invalid. >>> For session z, before session x create index done, GTT A has no data, >>> then index_a is valid. >>> >>> >>> For example, I've looked at the "on demand" building as implemented in >>> global_private_temp-8.patch, I kinda doubt adding a bunch of index build >>> calls into various places in index code seems somewht suspicious. >>> >>> >>> +1. I can't imagine that's a safe or sane thing to do. >>> >>> -- >>> Robert Haas >>> EnterpriseDB: http://www.enterprisedb.com >>> The Enterprise PostgreSQL Company >>> >>> >>> Opinion by Pavel >>> + rel->rd_islocaltemp = true; <<<<<<< if this is valid, then the name >>> of field "rd_islocaltemp" is not probably best >>> I renamed rd_islocaltemp >>> >> >> I don't see any change? >> >> Rename rd_islocaltemp to rd_istemp >> in global_temporary_table_v8-pg13.patch >> > > ok :) > I found a bug postgres=# create global temp table x(a int); CREATE TABLE postgres=# insert into x values(1); INSERT 0 1 postgres=# create index on x (a); CREATE INDEX postgres=# create index on x((a + 1)); CREATE INDEX postgres=# analyze x; WARNING: oid 16468 not a relation ANALYZE other behave looks well for me. Regards Pavel > Pavel > >> >> >> Wenjing >> >> >> >> >> >> >>> Opinion by Konstantin Knizhnik >>> 1 Fixed comments >>> 2 Fixed assertion >>> >>> >>> Please help me review. >>> >>> >>> Wenjing >>> >>> >> ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-29 08:12 Konstantin Knizhnik <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-29 08:12 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 27.01.2020 22:44, Pavel Stehule wrote: > > I don't think so compatibility with Oracle is valid point in this > case. We need GTT, but the mechanism of index building should be > designed for Postgres, and for users. > > Maybe the method proposed by you can be activated by some option like > CREATE INDEX IMMEDIATELY FOR ALL SESSION. When you use GTT without > index, then > it should to work some time more, and if you use short life sessions, > then index build can be last or almost last operation over table and > can be suboptimal. > > Anyway, this behave can be changed later without bigger complications > - and now I am have strong opinion to prefer don't allow to any DDL > (with index creation) on any active GTT in other sessions. > Probably your proposal - build indexes on other sessions when GTT is > touched can share code with just modify metadata and wait on session > reset or GTT reset > Well, compatibility with Oracle was never treated as important argument in this group:) But I hope that you agree that it real argument against your proposal. Much more important argument is incompatibility with behavior of regular table. If you propose such incompatibility, then you should have some very strong arguments for such behavior which will definitely confuse users. But I heard only two arguments: 1. Concurrent building of indexes by all backends may consume much memory (n_backends * maintenance_work_mem) and consume a lot of disk/CPU resources. First of all it is not completely true. Indexes will be created on demand when GTT will be accessed and chance that all sessions will become building indexes simultaneously is very small. But what will happen if we prohibit access to this index for existed sessions? If we need index for GTT, then most likely it is used for joins. If there is no index, then optimizer has to choose some other plan to perform this join. For example use hash join. Hash join also requires memory, so if all backends will perform such join simultaneously, then them consume (n_backends * work_mem) memory. Yes, work_mem is used to be smaller than maintenance_work_mem. But in any case DBA has a choice to adjust this parameters to avoid this problem. And in case of your proposal (prohibit access to this index) you give him no choice to optimize query execution in existed sessions. Also if all sessions will simultaneously perform sequential scan of GTT instead of building index for it, then them will read the same amount of data and consume comparable CPU time. So prohibiting access to the indexes will not save us from high resources consumption if all existed sessions are really actively working with this GTT. 2. GTT in one session can contains large amount of data and we need index for it, but small amount of data in another session and we do not need index for it. Such situation definitely can happen. But it contradicts to the main assumption of GTT use case (that it is accessed in the same way by all sessions). Also I may be agree with this argument if you propose to create indexes locally for each sessions. But your proposal is to prohibit access to the index to the sessions which already have populated GTT with data but allow it for sessions which have not accessed this GTT yet. So if some session stores some data in GTT after index was created, then it will build index for it, doesn't matter whether size of table is small or large. Why do we make an exception for sessions which already have data in GTT in this case? So from my point of view both arguments are doubtful and can not explain why rules of index usability for GTT should be different from regular tables. > Usually it is not hard problem to refresh sessions, and what I know > when you update plpgsql code, it is best practice to refresh session > early. > I know may systems where session is established once client is connected to the system and not closed until client is disconnected. And any attempt to force termination of the session will cause application errors which are not expected by the client. Sorry, I think that it is principle point in discussion concerning GTT design. Implementation of GTT can be changed in future, but it is bad if behavior of GTT will be changed. It is not clear for me why from the very beginning we should provide inconsistent behavior which is even more difficult to implement than behavior compatible with regular tables. And say that in the future it can be changed... Sorry, but I do not consider proposals to create indexes locally for each session (i.e. global tables but private indexes) or use some special complicated SQL syntax constructions like CREATE INDEX IMMEDIATELY FOR ALL SESSION as some real alternatives which have to be discussed. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-29 13:06 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Pavel Stehule <[email protected]> 1 sibling, 0 replies; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-29 13:06 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月29日 上午1:54,Pavel Stehule <[email protected]> 写道: > > > > út 28. 1. 2020 v 18:13 odesílatel Pavel Stehule <[email protected] <mailto:[email protected]>> napsal: > > > út 28. 1. 2020 v 18:12 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: > > >> 2020年1月29日 上午12:40,Pavel Stehule <[email protected] <mailto:[email protected]>> 写道: >> >> >> >> út 28. 1. 2020 v 17:01 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: >> >> >>> 2020年1月24日 上午4:47,Robert Haas <[email protected] <mailto:[email protected]>> 写道: >>> >>> On Sat, Jan 11, 2020 at 8:51 PM Tomas Vondra >>> <[email protected] <mailto:[email protected]>> wrote: >>>> I proposed just ignoring those new indexes because it seems much simpler >>>> than alternative solutions that I can think of, and it's not like those >>>> other solutions don't have other issues. >>> >>> +1. >> I complete the implementation of this feature. >> When a session x create an index idx_a on GTT A then >> For session x, idx_a is valid when after create index. >> For session y, before session x create index done, GTT A has some data, then index_a is invalid. >> For session z, before session x create index done, GTT A has no data, then index_a is valid. >> >>> >>>> For example, I've looked at the "on demand" building as implemented in >>>> global_private_temp-8.patch, I kinda doubt adding a bunch of index build >>>> calls into various places in index code seems somewht suspicious. >>> >>> +1. I can't imagine that's a safe or sane thing to do. >>> >>> -- >>> Robert Haas >>> EnterpriseDB: http://www.enterprisedb.com <http://www.enterprisedb.com/; >>> The Enterprise PostgreSQL Company >> >> Opinion by Pavel >> + rel->rd_islocaltemp = true; <<<<<<< if this is valid, then the name of field "rd_islocaltemp" is not probably best >> I renamed rd_islocaltemp >> >> I don't see any change? > Rename rd_islocaltemp to rd_istemp in global_temporary_table_v8-pg13.patch > > ok :) > > I found a bug > > postgres=# create global temp table x(a int); > CREATE TABLE > postgres=# insert into x values(1); > INSERT 0 1 > postgres=# create index on x (a); > CREATE INDEX > postgres=# create index on x((a + 1)); > CREATE INDEX > postgres=# analyze x; > WARNING: oid 16468 not a relation > ANALYZE Thanks for review. The index expression need to store statistics on index, I missed it and I'll fix it later. Wenjing > > other behave looks well for me. > > Regards > > Pavel > > > Pavel > > > Wenjing > > > >> >> >> >> Opinion by Konstantin Knizhnik >> 1 Fixed comments >> 2 Fixed assertion >> >> >> Please help me review. >> >> >> Wenjing >> > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-29 13:43 Robert Haas <[email protected]> parent: Konstantin Knizhnik <[email protected]> 1 sibling, 0 replies; 1038+ messages in thread From: Robert Haas @ 2020-01-29 13:43 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Mon, Jan 27, 2020 at 4:11 AM Konstantin Knizhnik <[email protected]> wrote: > I do not see any reasons to allow build local indexes for global table. Yes,it can happen that some session will have small amount of data in particular GTT and another - small amount of data in this table. But if access pattern is the same (and nature of GTT assumes it), then index in either appreciate, either useless in both cases. I agree. I think allowing different backends to have different indexes is overly complicated. Regarding another point that was raised, I think it's not a good idea to prohibit DDL on global temporary tables altogether. It should be fine to change things when no sessions are using the GTT. Going further and allowing changes when there are attached sessions would be nice, but I think we shouldn't try. Getting this feature committed is going to be a huge amount of work with even a minimal feature set; complicating the problem by adding what are essentially new DDL-concurrency features on top of the basic feature seems very much unwise. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-29 13:48 Robert Haas <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: Robert Haas @ 2020-01-29 13:48 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Tue, Jan 28, 2020 at 12:12 PM 曾文旌(义从) <[email protected]> wrote: >> Opinion by Pavel >> + rel->rd_islocaltemp = true; <<<<<<< if this is valid, then the name of field "rd_islocaltemp" is not probably best >> I renamed rd_islocaltemp > > I don't see any change? > > Rename rd_islocaltemp to rd_istemp in global_temporary_table_v8-pg13.patch In view of commit 6919b7e3294702adc39effd16634b2715d04f012, I think that this has approximately a 0% chance of being acceptable. If you're setting a field in a way that is inconsistent with the current use of the field, you're probably doing it wrong, because the field has an existing purpose to which new code must conform. And if you're not doing that, then you don't need to rename it. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-29 14:47 Robert Haas <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Robert Haas @ 2020-01-29 14:47 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Wed, Jan 29, 2020 at 3:13 AM Konstantin Knizhnik <[email protected]> wrote: > But I heard only two arguments: > > 1. Concurrent building of indexes by all backends may consume much memory (n_backends * maintenance_work_mem) and consume a lot of disk/CPU resources. > 2. GTT in one session can contains large amount of data and we need index for it, but small amount of data in another session and we do not need index for it. You seem to be ignoring the fact that two committers told you this probably wasn't safe. Perhaps your view is that those people made no argument, and therefore you don't have to respond to it. But the onus is not on somebody else to tell you why a completely novel idea is not safe. The onus is on you to analyze it in detail and prove that it is safe. What you need to show is that there is no code anywhere in the system which will be confused by an index springing into existence at whatever time you're creating it. One problem is that there are various backend-local data structures in the relcache, the planner, and the executor that remember information about indexes, and that may not respond well to having more indexes show up unexpectedly. On the one hand, they might crash; on the other hand, they might ignore the new index when they shouldn't. Another problem is that the code which creates indexes might fail or misbehave when run in an environment different from the one in which it currently runs. I haven't really studied your code, so I don't know exactly what it does, but for example it would be really bad to try to build an index while holding a buffer lock, both because it might cause (low-probability) undetected deadlocks and also because it might block another process that wants that buffer lock in a non-interruptible wait state for a long time. Now, maybe you can make an argument that you only create indexes at points in the query that are "safe." But I am skeptical, because of this example: rhaas=# create table foo (a int primary key, b text, c text, d text); CREATE TABLE rhaas=# create function blump() returns trigger as $$begin create index on foo (b); return new; end$$ language plpgsql; CREATE FUNCTION rhaas=# create trigger thud before insert on foo execute function blump(); CREATE TRIGGER rhaas=# insert into foo (a) select generate_series(1,10); ERROR: cannot CREATE INDEX "foo" because it is being used by active queries in this session CONTEXT: SQL statement "create index on foo (b)" PL/pgSQL function blump() line 1 at SQL statement That prohibition is there for some reason. Someone did not just decide to arbitrarily prohibit it. A CREATE INDEX command run in that context won't run afoul of many of the things that might be problems in other places -- e.g. there won't be a buffer lock held. Yet, despite the fact that a trigger context is safe for executing a wide variety of user-defined code, this particular operation is not allowed here. That is the sort of thing that should worry you. At any rate, even if this somehow were or could be made safe, on-the-fly index creation is a feature that cannot and should not be combined with a patch to implement global temporary tables. Surely, it will require a lot of study and work to get the details right. And so will GTT. As I said in the other email I wrote, this feature is hard enough without adding this kind of thing to it. There's a reason why I never got around to implementing this ten years ago when I did unlogged tables; I was intending that to be a precursor to the GTT work. I found that it was too hard and I gave up. I'm glad to see people trying again, but the idea that we can afford to add in extra features, or frankly that either of the dueling patches on this thread are close to committable, is just plain wrong. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-29 15:30 Konstantin Knizhnik <[email protected]> parent: Robert Haas <[email protected]> 0 siblings, 2 replies; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-29 15:30 UTC (permalink / raw) To: Robert Haas <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 29.01.2020 17:47, Robert Haas wrote: > On Wed, Jan 29, 2020 at 3:13 AM Konstantin Knizhnik > <[email protected]> wrote: >> But I heard only two arguments: >> >> 1. Concurrent building of indexes by all backends may consume much memory (n_backends * maintenance_work_mem) and consume a lot of disk/CPU resources. >> 2. GTT in one session can contains large amount of data and we need index for it, but small amount of data in another session and we do not need index for it. > You seem to be ignoring the fact that two committers told you this > probably wasn't safe. > > Perhaps your view is that those people made no argument, and therefore > you don't have to respond to it. But the onus is not on somebody else > to tell you why a completely novel idea is not safe. The onus is on > you to analyze it in detail and prove that it is safe. What you need > to show is that there is no code anywhere in the system which will be > confused by an index springing into existence at whatever time you're > creating it. > > One problem is that there are various backend-local data structures in > the relcache, the planner, and the executor that remember information > about indexes, and that may not respond well to having more indexes > show up unexpectedly. On the one hand, they might crash; on the other > hand, they might ignore the new index when they shouldn't. Another > problem is that the code which creates indexes might fail or misbehave > when run in an environment different from the one in which it > currently runs. I haven't really studied your code, so I don't know > exactly what it does, but for example it would be really bad to try to > build an index while holding a buffer lock, both because it might > cause (low-probability) undetected deadlocks and also because it might > block another process that wants that buffer lock in a > non-interruptible wait state for a long time. > > Now, maybe you can make an argument that you only create indexes at > points in the query that are "safe." But I am skeptical, because of > this example: > > rhaas=# create table foo (a int primary key, b text, c text, d text); > CREATE TABLE > rhaas=# create function blump() returns trigger as $$begin create > index on foo (b); return new; end$$ language plpgsql; > CREATE FUNCTION > rhaas=# create trigger thud before insert on foo execute function blump(); > CREATE TRIGGER > rhaas=# insert into foo (a) select generate_series(1,10); > ERROR: cannot CREATE INDEX "foo" because it is being used by active > queries in this session > CONTEXT: SQL statement "create index on foo (b)" > PL/pgSQL function blump() line 1 at SQL statement > > That prohibition is there for some reason. Someone did not just decide > to arbitrarily prohibit it. A CREATE INDEX command run in that context > won't run afoul of many of the things that might be problems in other > places -- e.g. there won't be a buffer lock held. Yet, despite the > fact that a trigger context is safe for executing a wide variety of > user-defined code, this particular operation is not allowed here. That > is the sort of thing that should worry you. > > At any rate, even if this somehow were or could be made safe, > on-the-fly index creation is a feature that cannot and should not be > combined with a patch to implement global temporary tables. Surely, it > will require a lot of study and work to get the details right. And so > will GTT. As I said in the other email I wrote, this feature is hard > enough without adding this kind of thing to it. There's a reason why I > never got around to implementing this ten years ago when I did > unlogged tables; I was intending that to be a precursor to the GTT > work. I found that it was too hard and I gave up. I'm glad to see > people trying again, but the idea that we can afford to add in extra > features, or frankly that either of the dueling patches on this thread > are close to committable, is just plain wrong. > Sorry, I really didn't consider statements containing word "probably" as arguments. But I agree with you: it is task of developer of new feature to prove that proposed approach is safe rather than of reviewers to demonstrate that it is unsafe. Can I provide such proof now? I afraid that not. But please consider two arguments: 1. Index for GTT in any case has to be initialized on demand. In case of regular tables index is initialized at the moment of its creation. In case of GTT it doesn't work. So we should somehow detect that accessed index is not initialized and perform lazy initialization of the index. The only difference with the approach proposed by Pavel (allow index for empty GTT but prohibit it for GTT filled with data) is whether we also need to populate index with data or not. I can imagine that implicit initialization of index in read-only query (select) can be unsafe and cause some problems. I have not encountered such problems yet after performing many tests with GTTs, but certainly I have not covered all possible scenarios (not sure that it is possible at all). But I do not understand how populating index with data can add some extra unsafety. So I can not prove that building index for GTT on demand is safe, but it is not more unsafe than initialization of index on demand which is required in any case. 2. Actually I do not propose some completely new approach. I try to provide behavior with is compatible with regular tables. If you create index for regular table, then it can be used in all sessions, right? And all "various backend-local data structures in the relcache, the planner, and the executor that remember information about indexes" have to be properly updated. It is done using invalidation mechanism. The same mechanism is used in case of DDL operations with GTT, because we change system catalog. So my point here is that creation index of GTT is almost the same as creation of index for regular tables and the same mechanism will be used to provide correctness of this operation. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-29 17:08 Pavel Stehule <[email protected]> parent: Konstantin Knizhnik <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-29 17:08 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> 2. Actually I do not propose some completely new approach. I try to > provide behavior with is compatible with regular tables. > If you create index for regular table, then it can be used in all > sessions, right? > I don't understand to this point. Regular tables shares data, shares files. You cannot to separate it. More - you have to uses relatively aggressive locks to be this operation safe. Nothing from these points are valid for GTT. Regards Pavel > And all "various backend-local data structures in the relcache, the > planner, and the executor that remember information about indexes" > have to be properly updated. It is done using invalidation mechanism. > The same mechanism is used in case of DDL operations with GTT, because > we change system catalog. > > So my point here is that creation index of GTT is almost the same as > creation of index for regular tables and the same mechanism will be used > to provide correctness of this operation. > > > -- > Konstantin Knizhnik > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-29 17:21 Konstantin Knizhnik <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-29 17:21 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 29.01.2020 20:08, Pavel Stehule wrote: > > > > 2. Actually I do not propose some completely new approach. I try to > provide behavior with is compatible with regular tables. > If you create index for regular table, then it can be used in all > sessions, right? > > > I don't understand to this point. Regular tables shares data, shares > files. You cannot to separate it. More - you have to uses relatively > aggressive locks to be this operation safe. > > Nothing from these points are valid for GTT. GTT shares metadata. As far as them are not sharing data, then GTT are safer than regular table, aren't them? "Safer" means that we need less "aggressive" locks for them: we need to protect only metadata, not data itself. My point is that if we allow other sessions to access created indexes for regular tables, then it will be not more complex to support it for GTT. Actually "not more complex" in this case means "no extra efforts are needed". -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-29 17:37 Pavel Stehule <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-29 17:37 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> st 29. 1. 2020 v 18:21 odesílatel Konstantin Knizhnik < [email protected]> napsal: > > > On 29.01.2020 20:08, Pavel Stehule wrote: > > > > > 2. Actually I do not propose some completely new approach. I try to >> provide behavior with is compatible with regular tables. >> If you create index for regular table, then it can be used in all >> sessions, right? >> > > I don't understand to this point. Regular tables shares data, shares > files. You cannot to separate it. More - you have to uses relatively > aggressive locks to be this operation safe. > > Nothing from these points are valid for GTT. > > > GTT shares metadata. > As far as them are not sharing data, then GTT are safer than regular > table, aren't them? > "Safer" means that we need less "aggressive" locks for them: we need to > protect only metadata, not data itself. > > My point is that if we allow other sessions to access created indexes for > regular tables, then it will be not more complex to support it for GTT. > Actually "not more complex" in this case means "no extra efforts are > needed". > It is hard to say. I see a significant difference. When I do index on regular table, then I don't change a context of other processes. I have to wait for lock, and after I got a lock then other processes waiting. With GTT, I don't want to wait for others - and other processes should build indexes inside - without expected sequence of operations. Maybe it can have positive effect, but it can have negative effect too. In this case I prefer (in this moment) zero effect on other sessions. So I would to build index in my session and I don't would to wait for other sessions, and if it is possible other sessions doesn't need to interact or react on my action too. It should be independent what is possible. The most simple solution is request on unique usage. I understand so it can be not too practical. Better is allow to usage GTT by other tables, but the changes are invisible in other sessions to session reset. It is minimalistic strategy. It has not benefits for other sessions, but it has not negative impacts too. > -- > Konstantin Knizhnik > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-29 18:16 Robert Haas <[email protected]> parent: Konstantin Knizhnik <[email protected]> 1 sibling, 1 reply; 1038+ messages in thread From: Robert Haas @ 2020-01-29 18:16 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Wed, Jan 29, 2020 at 10:30 AM Konstantin Knizhnik <[email protected]> wrote: > But please consider two arguments: > > 1. Index for GTT in any case has to be initialized on demand. In case of > regular tables index is initialized at the moment of its creation. In > case of GTT it doesn't work. > So we should somehow detect that accessed index is not initialized and > perform lazy initialization of the index. > The only difference with the approach proposed by Pavel (allow index > for empty GTT but prohibit it for GTT filled with data) is whether we > also need to populate index with data or not. > I can imagine that implicit initialization of index in read-only query > (select) can be unsafe and cause some problems. I have not encountered > such problems yet after performing many tests with GTTs, but certainly I > have not covered all possible scenarios (not sure that it is possible at > all). > But I do not understand how populating index with data can add some > extra unsafety. > > So I can not prove that building index for GTT on demand is safe, but it > is not more unsafe than initialization of index on demand which is > required in any case. I think that the idea of calling ambuild() on the fly is not going to work, because, again, I don't think that calling that from random places in the code is safe. What I expect we're going to need to do here is model this on the approach used for unlogged tables. For an unlogged table, each table and index has an init fork which contains the correct initial contents for that relation - which is nothing at all for a heap table, and a couple of boilerplate pages for an index. In the case of an unlogged table, the init forks get copied over the main forks after crash recovery, and then we have a brand-new, empty relation with brand-new empty indexes which everyone can use. In the case of global temporary tables, I think that we should do the same kind of copying, but at the time when the session first tries to access the table. There is some fuzziness in my mind about what exactly constitutes accessing the table - it probably shouldn't be when the relcache entry is built, because that seems too early, but I'm not sure what is exactly right. In any event, it's easier to find a context where copying some files on disk (that are certain not to be changing) is safe than it is to find a context where index builds are safe. > 2. Actually I do not propose some completely new approach. I try to > provide behavior with is compatible with regular tables. > If you create index for regular table, then it can be used in all > sessions, right? Yes. :-) > And all "various backend-local data structures in the relcache, the > planner, and the executor that remember information about indexes" > have to be properly updated. It is done using invalidation mechanism. > The same mechanism is used in case of DDL operations with GTT, because > we change system catalog. I mean, that's not really a valid argument. Invalidations can only take effect at certain points in the code, and the whole argument here is about which places in the code are safe for which operations, so the fact that some things (like accepting invalidations) are safe at some points in the code (like the places where we accept them) does not prove that other things (like calling ambuild) are safe at other points in the code (like wherever you are proposing to call it). In particular, if you've got a relation open, there's currently no way for another index to show up while you've still got that relation open. That means that the planner and executor (which keep the relevant relations open) don't ever have to worry about updating their data structures, because it can never be necessary. It also means that any code anywhere in the system that keeps a lock on a relation can count on the list of indexes for that relation staying the same until it releases the lock. In fact, it can hold on to pointers to data allocated by the relcache and count on those pointers being stable for as long as it holds the lock, and RelationClearRelation contain specific code that aims to make sure that certain objects don't get deallocated and reallocated at a different address precisely for that reason. That code, however, only works as long as nothing actually changes. The upshot is that it's entirely possible for changing catalog entries in one backend with an inadequate lock level -- or at unexpected point in the code -- to cause a core dump either in that backend or in some other backend. This stuff is really subtle, and super-easy to screw up. I am speaking a bit generally here, because I haven't really studied *exactly* what might go wrong in the relcache, or elsewhere, as a result of creating an index on the fly. However, I'm very sure that a general appeal to invalidation messages is not sufficient to make something like what you want to do safe. Invalidation messages are a complex, ancient, under-documented, fragile system for solving a very specific problem that is not the one you are hoping they'll solve here. They could justifiably be called magic, but it's not the sort of magic where the fairy godmother waves her wand and solves all of your problems; it's more like the kind where you go explore the forbidden forest and are never seen or heard from again. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-30 08:45 Konstantin Knizhnik <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-30 08:45 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 29.01.2020 20:37, Pavel Stehule wrote: > > > st 29. 1. 2020 v 18:21 odesílatel Konstantin Knizhnik > <[email protected] <mailto:[email protected]>> napsal: > > > > On 29.01.2020 20:08, Pavel Stehule wrote: >> >> >> >> 2. Actually I do not propose some completely new approach. I >> try to >> provide behavior with is compatible with regular tables. >> If you create index for regular table, then it can be used in >> all >> sessions, right? >> >> >> I don't understand to this point. Regular tables shares data, >> shares files. You cannot to separate it. More - you have to uses >> relatively aggressive locks to be this operation safe. >> >> Nothing from these points are valid for GTT. > > GTT shares metadata. > As far as them are not sharing data, then GTT are safer than > regular table, aren't them? > "Safer" means that we need less "aggressive" locks for them: we > need to protect only metadata, not data itself. > > My point is that if we allow other sessions to access created > indexes for regular tables, then it will be not more complex to > support it for GTT. > Actually "not more complex" in this case means "no extra efforts > are needed". > > > It is hard to say. I see a significant difference. When I do index on > regular table, then I don't change a context of other processes. I > have to wait for lock, and after I got a lock then other processes > waiting. > > With GTT, I don't want to wait for others - and other processes should > build indexes inside - without expected sequence of operations. Maybe > it can have positive effect, but it can have negative effect too. In > this case I prefer (in this moment) zero effect on other sessions. So > I would to build index in my session and I don't would to wait for > other sessions, and if it is possible other sessions doesn't need to > interact or react on my action too. It should be independent what is > possible. The most simple solution is request on unique usage. I > understand so it can be not too practical. Better is allow to usage > GTT by other tables, but the changes are invisible in other sessions > to session reset. It is minimalistic strategy. It has not benefits for > other sessions, but it has not negative impacts too. > Building regular index requires two kinds of lock: 1. You have to lock pg_class to make changes in system catalog. 2. You need to lock heap relation to pervent concurrent updates while building index. GTT requires 1) but not 2). Once backend inserts information about new index in system catalog, all other sessions may use it. pg_class lock prevents any race condition here. And building index itself doesn't affect any other backends. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-30 09:23 Pavel Stehule <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-30 09:23 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> čt 30. 1. 2020 v 9:45 odesílatel Konstantin Knizhnik < [email protected]> napsal: > > > On 29.01.2020 20:37, Pavel Stehule wrote: > > > > st 29. 1. 2020 v 18:21 odesílatel Konstantin Knizhnik < > [email protected]> napsal: > >> >> >> On 29.01.2020 20:08, Pavel Stehule wrote: >> >> >> >> >> 2. Actually I do not propose some completely new approach. I try to >>> provide behavior with is compatible with regular tables. >>> If you create index for regular table, then it can be used in all >>> sessions, right? >>> >> >> I don't understand to this point. Regular tables shares data, shares >> files. You cannot to separate it. More - you have to uses relatively >> aggressive locks to be this operation safe. >> >> Nothing from these points are valid for GTT. >> >> >> GTT shares metadata. >> As far as them are not sharing data, then GTT are safer than regular >> table, aren't them? >> "Safer" means that we need less "aggressive" locks for them: we need to >> protect only metadata, not data itself. >> >> My point is that if we allow other sessions to access created indexes for >> regular tables, then it will be not more complex to support it for GTT. >> Actually "not more complex" in this case means "no extra efforts are >> needed". >> > > It is hard to say. I see a significant difference. When I do index on > regular table, then I don't change a context of other processes. I have to > wait for lock, and after I got a lock then other processes waiting. > > With GTT, I don't want to wait for others - and other processes should > build indexes inside - without expected sequence of operations. Maybe it > can have positive effect, but it can have negative effect too. In this case > I prefer (in this moment) zero effect on other sessions. So I would to > build index in my session and I don't would to wait for other sessions, and > if it is possible other sessions doesn't need to interact or react on my > action too. It should be independent what is possible. The most simple > solution is request on unique usage. I understand so it can be not too > practical. Better is allow to usage GTT by other tables, but the changes > are invisible in other sessions to session reset. It is minimalistic > strategy. It has not benefits for other sessions, but it has not negative > impacts too. > > > Building regular index requires two kinds of lock: > 1. You have to lock pg_class to make changes in system catalog. > 2. You need to lock heap relation to pervent concurrent updates while > building index. > > GTT requires 1) but not 2). > Once backend inserts information about new index in system catalog, all > other sessions may use it. pg_class lock prevents any race condition here. > And building index itself doesn't affect any other backends. > It is true. The difference for GTT, so any other sessions have to build index (in your proposal) as extra operation against original plan. Pavel > > -- > Konstantin Knizhnik > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-30 09:33 Konstantin Knizhnik <[email protected]> parent: Robert Haas <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-30 09:33 UTC (permalink / raw) To: Robert Haas <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 29.01.2020 21:16, Robert Haas wrote: > On Wed, Jan 29, 2020 at 10:30 AM Konstantin Knizhnik > <[email protected]> wrote: > > I think that the idea of calling ambuild() on the fly is not going to > work, because, again, I don't think that calling that from random > places in the code is safe. It is not a random place in the code. Actually it is just one place - _bt_getbuf Why it can be unsafe if it affects only private backends data? > What I expect we're going to need to do > here is model this on the approach used for unlogged tables. For an > unlogged table, each table and index has an init fork which contains > the correct initial contents for that relation - which is nothing at > all for a heap table, and a couple of boilerplate pages for an index. > In the case of an unlogged table, the init forks get copied over the > main forks after crash recovery, and then we have a brand-new, empty > relation with brand-new empty indexes which everyone can use. In the > case of global temporary tables, I think that we should do the same > kind of copying, but at the time when the session first tries to > access the table. There is some fuzziness in my mind about what > exactly constitutes accessing the table - it probably shouldn't be > when the relcache entry is built, because that seems too early, but > I'm not sure what is exactly right. In any event, it's easier to find > a context where copying some files on disk (that are certain not to be > changing) is safe than it is to find a context where index builds are > safe. I do not think that approach used for unlogged tables is good for GTT. Unlogged tables has to be reinitialized only after server restart. GTT to should be initialized by each backend on demand. It seems to me that init fork is used for unlogged table because recovery process to not have enough context to be able to reintialize table and indexes. It is much safer and simpler for recovery process just to copy files. But GTT case is different. Heap and indexes can be easily initialized by backend using existed functions. Approach with just calling btbuild is much simpler than you propose with creating extra forks and copying data from it. You say that it not safe. But you have not explained why it is unsafe. Yes, I agree that it is my responsibility to prove that it is safe. And as I already wrote, I can not provide such proof now. I will be pleased if you or anybody else can help to convince that this approach is safe or demonstrate problems with this approach. Copying data from fork doesn't help to provide the same behavior of GTT indexes as regular indexes. And from my point of view compatibility with regular tables is most important point in GTT design. If for some reasons it is not possible, than we should think about other solutions. But right now I do not know such problems. We have two working prototypes of GTT. Certainly it is not mean lack of problems with the current implementations. But I really like to receive more constructive critics rather than "this approach is wrong because it is unsafe". >> planner, and the executor that remember information about indexes" >> have to be properly updated. It is done using invalidation mechanism. >> The same mechanism is used in case of DDL operations with GTT, because >> we change system catalog. > I mean, that's not really a valid argument. Invalidations can only > take effect at certain points in the code, and the whole argument here > is about which places in the code are safe for which operations, so > the fact that some things (like accepting invalidations) are safe at > some points in the code (like the places where we accept them) does > not prove that other things (like calling ambuild) are safe at other > points in the code (like wherever you are proposing to call it). In > particular, if you've got a relation open, there's currently no way > for another index to show up while you've still got that relation > open. The same is true for GTT. Right now building GTT index also locks the relation. It may be not absolutely needed, because data of relation is local and can not be changed by some other backend. But I have not added some special handling of GTT here. Mostly because I want to follow the same way as with regular indexes and prevent possible problems which as you mention can happen if we somehow changing locking policy. > That means that the planner and executor (which keep the > relevant relations open) don't ever have to worry about updating their > data structures, because it can never be necessary. It also means that > any code anywhere in the system that keeps a lock on a relation can > count on the list of indexes for that relation staying the same until > it releases the lock. In fact, it can hold on to pointers to data > allocated by the relcache and count on those pointers being stable for > as long as it holds the lock, and RelationClearRelation contain > specific code that aims to make sure that certain objects don't get > deallocated and reallocated at a different address precisely for that > reason. That code, however, only works as long as nothing actually > changes. The upshot is that it's entirely possible for changing > catalog entries in one backend with an inadequate lock level -- or at > unexpected point in the code -- to cause a core dump either in that > backend or in some other backend. This stuff is really subtle, and > super-easy to screw up. > > I am speaking a bit generally here, because I haven't really studied > *exactly* what might go wrong in the relcache, or elsewhere, as a > result of creating an index on the fly. However, I'm very sure that a > general appeal to invalidation messages is not sufficient to make > something like what you want to do safe. Invalidation messages are a > complex, ancient, under-documented, fragile system for solving a very > specific problem that is not the one you are hoping they'll solve > here. They could justifiably be called magic, but it's not the sort of > magic where the fairy godmother waves her wand and solves all of your > problems; it's more like the kind where you go explore the forbidden > forest and are never seen or heard from again. Actually index is not created on the fly. Index is created is usual way, by executing "create index" command. So all components of the Postgres (planner, executor,...) treat GTT indexes in the same way as regular indexes. Locking and invalidations policies are exactly the same for them. The only difference is that content of GTT index is constructed on demand using private backend data. Is it safe or not? We are just reading data from local buffers/files and writing them here. May be I missed something but I do not see any unsafety here. There are issues with updating statistic but them can be solved. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-30 09:44 Konstantin Knizhnik <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-30 09:44 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 30.01.2020 12:23, Pavel Stehule wrote: > > Building regular index requires two kinds of lock: > 1. You have to lock pg_class to make changes in system catalog. > 2. You need to lock heap relation to pervent concurrent updates > while building index. > > GTT requires 1) but not 2). > Once backend inserts information about new index in system > catalog, all other sessions may use it. pg_class lock prevents any > race condition here. > And building index itself doesn't affect any other backends. > > > It is true. The difference for GTT, so any other sessions have to > build index (in your proposal) as extra operation against original plan. > What is "index"? For most parts of Postgres it is just an entry in system catalog. And only executor deals with its particular implementation and content. My point is that if we process GTT index metadata in the same way as regular index metadata, then there will be no differences for the postgres between GTT and regular indexes. And we can provide the same behavior. Concerning actual content of the index - it is local to the backend and it is safe to construct it a t any point of time (on demand). It depends only on private data and can not be somehow affected by other backends (taken in account that we preserve locking policy of regular tables). -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-30 09:52 Pavel Stehule <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Pavel Stehule @ 2020-01-30 09:52 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> čt 30. 1. 2020 v 10:44 odesílatel Konstantin Knizhnik < [email protected]> napsal: > > > On 30.01.2020 12:23, Pavel Stehule wrote: > > > Building regular index requires two kinds of lock: >> 1. You have to lock pg_class to make changes in system catalog. >> 2. You need to lock heap relation to pervent concurrent updates while >> building index. >> >> GTT requires 1) but not 2). >> Once backend inserts information about new index in system catalog, all >> other sessions may use it. pg_class lock prevents any race condition here. >> And building index itself doesn't affect any other backends. >> > > It is true. The difference for GTT, so any other sessions have to build > index (in your proposal) as extra operation against original plan. > > What is "index"? > For most parts of Postgres it is just an entry in system catalog. > And only executor deals with its particular implementation and content. > > My point is that if we process GTT index metadata in the same way as > regular index metadata, > then there will be no differences for the postgres between GTT and regular > indexes. > And we can provide the same behavior. > There should be a difference - index on regular table is created by one process. Same thing is not possible on GTT. So there should be a difference every time. You can reduce some differences, but minimally me and Robert don't feel it well. Starting a building index from routine, that is used for reading from buffer doesn't look well. I can accept some stranges, but I need to have feeling so it is necessary. I don't think so it is necessary in this case. Regards Pavel > Concerning actual content of the index - it is local to the backend and it > is safe to construct it a t any point of time (on demand). > It depends only on private data and can not be somehow affected by other > backends (taken in account that we preserve locking policy of regular > tables). > > > -- > Konstantin Knizhnik > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-30 10:02 Konstantin Knizhnik <[email protected]> parent: Pavel Stehule <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: Konstantin Knizhnik @ 2020-01-30 10:02 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On 30.01.2020 12:52, Pavel Stehule wrote: > > > čt 30. 1. 2020 v 10:44 odesílatel Konstantin Knizhnik > <[email protected] <mailto:[email protected]>> napsal: > > > > On 30.01.2020 12:23, Pavel Stehule wrote: >> >> Building regular index requires two kinds of lock: >> 1. You have to lock pg_class to make changes in system catalog. >> 2. You need to lock heap relation to pervent concurrent >> updates while building index. >> >> GTT requires 1) but not 2). >> Once backend inserts information about new index in system >> catalog, all other sessions may use it. pg_class lock >> prevents any race condition here. >> And building index itself doesn't affect any other backends. >> >> >> It is true. The difference for GTT, so any other sessions have to >> build index (in your proposal) as extra operation against >> original plan. >> > What is "index"? > For most parts of Postgres it is just an entry in system catalog. > And only executor deals with its particular implementation and > content. > > My point is that if we process GTT index metadata in the same way > as regular index metadata, > then there will be no differences for the postgres between GTT and > regular indexes. > And we can provide the same behavior. > > > There should be a difference - index on regular table is created by > one process. Same thing is not possible on GTT. So there should be a > difference every time. Metadata of GTT index is also created by one process. And actual content of the index is not interesting for most parts of Postgres. > > You can reduce some differences, but minimally me and Robert don't > feel it well. Starting a building index from routine, that is used for > reading from buffer doesn't look well. I can accept some stranges, but > I need to have feeling so it is necessary. I don't think so it is > necessary in this case. Sorry, but "don't feel it well", "doesn't look well" looks more likeliterary criticism rather than code review;) Yes, I agree that it is unnatural to call btindex from _bt_getbuf. But what can go wrong here? -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-30 10:10 Pavel Stehule <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Pavel Stehule @ 2020-01-30 10:10 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> čt 30. 1. 2020 v 11:02 odesílatel Konstantin Knizhnik < [email protected]> napsal: > > > On 30.01.2020 12:52, Pavel Stehule wrote: > > > > čt 30. 1. 2020 v 10:44 odesílatel Konstantin Knizhnik < > [email protected]> napsal: > >> >> >> On 30.01.2020 12:23, Pavel Stehule wrote: >> >> >> Building regular index requires two kinds of lock: >>> 1. You have to lock pg_class to make changes in system catalog. >>> 2. You need to lock heap relation to pervent concurrent updates while >>> building index. >>> >>> GTT requires 1) but not 2). >>> Once backend inserts information about new index in system catalog, all >>> other sessions may use it. pg_class lock prevents any race condition here. >>> And building index itself doesn't affect any other backends. >>> >> >> It is true. The difference for GTT, so any other sessions have to build >> index (in your proposal) as extra operation against original plan. >> >> What is "index"? >> For most parts of Postgres it is just an entry in system catalog. >> And only executor deals with its particular implementation and content. >> >> My point is that if we process GTT index metadata in the same way as >> regular index metadata, >> then there will be no differences for the postgres between GTT and >> regular indexes. >> And we can provide the same behavior. >> > > There should be a difference - index on regular table is created by one > process. Same thing is not possible on GTT. So there should be a difference > every time. > > > Metadata of GTT index is also created by one process. And actual content > of the index is not interesting for most parts of Postgres. > > > You can reduce some differences, but minimally me and Robert don't feel it > well. Starting a building index from routine, that is used for reading from > buffer doesn't look well. I can accept some stranges, but I need to have > feeling so it is necessary. I don't think so it is necessary in this case. > > > Sorry, but "don't feel it well", "doesn't look well" looks more like > literary criticism rather than code review;) > The design is subjective. I am sure, so your solution can work, like mine, or any other. But I am not sure, so your solution is good for practical usage. > Yes, I agree that it is unnatural to call btindex from _bt_getbuf. But > what can go wrong here? > creating index as side effect of table reading. Just the side effect too much big. > -- > Konstantin Knizhnik > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-30 14:06 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Pavel Stehule <[email protected]> 1 sibling, 0 replies; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-30 14:06 UTC (permalink / raw) To: Pavel Stehule <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月29日 上午1:54,Pavel Stehule <[email protected]> 写道: > > > > út 28. 1. 2020 v 18:13 odesílatel Pavel Stehule <[email protected] <mailto:[email protected]>> napsal: > > > út 28. 1. 2020 v 18:12 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: > > >> 2020年1月29日 上午12:40,Pavel Stehule <[email protected] <mailto:[email protected]>> 写道: >> >> >> >> út 28. 1. 2020 v 17:01 odesílatel 曾文旌(义从) <[email protected] <mailto:[email protected]>> napsal: >> >> >>> 2020年1月24日 上午4:47,Robert Haas <[email protected] <mailto:[email protected]>> 写道: >>> >>> On Sat, Jan 11, 2020 at 8:51 PM Tomas Vondra >>> <[email protected] <mailto:[email protected]>> wrote: >>>> I proposed just ignoring those new indexes because it seems much simpler >>>> than alternative solutions that I can think of, and it's not like those >>>> other solutions don't have other issues. >>> >>> +1. >> I complete the implementation of this feature. >> When a session x create an index idx_a on GTT A then >> For session x, idx_a is valid when after create index. >> For session y, before session x create index done, GTT A has some data, then index_a is invalid. >> For session z, before session x create index done, GTT A has no data, then index_a is valid. >> >>> >>>> For example, I've looked at the "on demand" building as implemented in >>>> global_private_temp-8.patch, I kinda doubt adding a bunch of index build >>>> calls into various places in index code seems somewht suspicious. >>> >>> +1. I can't imagine that's a safe or sane thing to do. >>> >>> -- >>> Robert Haas >>> EnterpriseDB: http://www.enterprisedb.com <http://www.enterprisedb.com/; >>> The Enterprise PostgreSQL Company >> >> Opinion by Pavel >> + rel->rd_islocaltemp = true; <<<<<<< if this is valid, then the name of field "rd_islocaltemp" is not probably best >> I renamed rd_islocaltemp >> >> I don't see any change? > Rename rd_islocaltemp to rd_istemp in global_temporary_table_v8-pg13.patch > > ok :) > > I found a bug > > postgres=# create global temp table x(a int); > CREATE TABLE > postgres=# insert into x values(1); > INSERT 0 1 > postgres=# create index on x (a); > CREATE INDEX > postgres=# create index on x((a + 1)); > CREATE INDEX > postgres=# analyze x; > WARNING: oid 16468 not a relation > ANALYZE The bug has been fixed in the global_temporary_table_v9-pg13.patch Wenjing > > other behave looks well for me. > > Regards > > Pavel > > > Pavel > > > Wenjing > > > >> >> >> >> Opinion by Konstantin Knizhnik >> 1 Fixed comments >> 2 Fixed assertion >> >> >> Please help me review. >> >> >> Wenjing >> > Attachments: [application/octet-stream] global_temporary_table_v9-pg13.patch (153.6K, ../../[email protected]/3-global_temporary_table_v9-pg13.patch) download | inline diff: diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 79430d2..babb5f3 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -158,6 +158,19 @@ static relopt_bool boolRelOpts[] = }, true }, + /* + * For global temp table only + * use ShareUpdateExclusiveLock for ensure safety + */ + { + { + "on_commit_delete_rows", + "global temp table on commit options", + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, + ShareUpdateExclusiveLock + }, + true + }, /* list terminator */ {{NULL}} }; @@ -1486,6 +1499,8 @@ bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind) { static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)}, {"fillfactor", RELOPT_TYPE_INT, offsetof(StdRdOptions, fillfactor)}, {"autovacuum_enabled", RELOPT_TYPE_BOOL, offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, enabled)}, @@ -1586,13 +1601,18 @@ build_reloptions(Datum reloptions, bool validate, bytea * partitioned_table_reloptions(Datum reloptions, bool validate) { + static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)} + }; + /* * There are no options for partitioned tables yet, but this is able to do * some validation. */ return (bytea *) build_reloptions(reloptions, validate, RELOPT_KIND_PARTITIONED, - 0, NULL, 0); + sizeof(StdRdOptions), tab, lengthof(tab)); } /* diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index dd975b1..1610e7d 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -1013,7 +1013,9 @@ gistGetFakeLSN(Relation rel) { static XLogRecPtr counter = FirstNormalUnloggedLSN; - if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + /* global temp is same as local temp table */ + if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + rel->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { /* * Temporary relations are only accessible in our session, so a simple diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 4871b7f..16b00c9 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -149,7 +149,9 @@ hashbuild(Relation heap, Relation index, IndexInfo *indexInfo) * metapage, nor the first bitmap page. */ sort_threshold = (maintenance_work_mem * 1024L) / BLCKSZ; - if (index->rd_rel->relpersistence != RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + if (!(index->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + index->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) sort_threshold = Min(sort_threshold, NBuffers); else sort_threshold = Min(sort_threshold, NLocBuffer); diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index 3fa4b76..b54882d 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -598,7 +598,7 @@ heapam_relation_set_new_filenode(Relation rel, */ *minmulti = GetOldestMultiXactId(); - srel = RelationCreateStorage(*newrnode, persistence); + srel = RelationCreateStorage(*newrnode, persistence, rel); /* * If required, set up an init fork for an unlogged table so that it can @@ -651,7 +651,7 @@ heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index 8ce5011..0d6ae76 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -62,6 +62,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/dbcommands.h" #include "commands/progress.h" #include "commands/vacuum.h" @@ -399,9 +400,9 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, Assert(params->index_cleanup != VACOPT_TERNARY_DEFAULT); Assert(params->truncate != VACOPT_TERNARY_DEFAULT); - /* not every AM requires these to be valid, but heap does */ - Assert(TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); - Assert(MultiXactIdIsValid(onerel->rd_rel->relminmxid)); + /* not every AM requires these to be valid, but regular heap does */ + Assert(RELATION_IS_GLOBAL_TEMP(onerel) ^ TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); + Assert(RELATION_IS_GLOBAL_TEMP(onerel) ^ MultiXactIdIsValid(onerel->rd_rel->relminmxid)); /* measure elapsed time iff autovacuum logging requires it */ if (IsAutoVacuumWorkerProcess() && params->log_min_duration >= 0) diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index f05cbe7..946c9d2 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -763,7 +763,14 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access) /* Read an existing block of the relation */ buf = ReadBuffer(rel, blkno); LockBuffer(buf, access); - _bt_checkpage(rel, buf); + + /* global temp table may be not yet initialized for this backend. */ + if (RELATION_IS_GLOBAL_TEMP(rel) && + blkno == BTREE_METAPAGE && + PageIsNew(BufferGetPage(buf))) + _bt_initmetapage(BufferGetPage(buf), P_NONE, 0); + else + _bt_checkpage(rel, buf); } else { diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 3813ead..fd731d8 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6325,6 +6325,10 @@ StartupXLOG(void) else recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID; + /* clean temp relation files */ + if (max_active_gtt > 0) + RemovePgTempFiles(); + /* * Check for signal files, and if so set up state for offline recovery */ diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index f8f0b48..dc8bbb1 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -42,6 +42,7 @@ OBJS = \ pg_subscription.o \ pg_type.o \ storage.o \ + storage_gtt.o \ toasting.o include $(top_srcdir)/src/backend/common.mk diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c index 7d6acae..3be8d63 100644 --- a/src/backend/catalog/catalog.c +++ b/src/backend/catalog/catalog.c @@ -393,7 +393,9 @@ GetNewRelFileNode(Oid reltablespace, Relation pg_class, char relpersistence) switch (relpersistence) { + /* global temp table is same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); break; case RELPERSISTENCE_UNLOGGED: diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 0fdff29..210d019 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -61,6 +61,7 @@ #include "catalog/pg_type.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "commands/tablecmds.h" #include "commands/typecmds.h" #include "executor/executor.h" @@ -99,6 +100,7 @@ static void AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -404,6 +406,10 @@ heap_create(const char *relname, relpersistence, relkind); + /* global temp table not create storage file when catalog create */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + create_storage = false; + /* * Have the storage manager create the relation's disk file, if needed. * @@ -427,7 +433,7 @@ heap_create(const char *relname, case RELKIND_INDEX: case RELKIND_SEQUENCE: - RelationCreateStorage(rel->rd_node, relpersistence); + RelationCreateStorage(rel->rd_node, relpersistence, rel); break; case RELKIND_RELATION: @@ -956,6 +962,7 @@ AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -994,8 +1001,18 @@ AddNewRelationTuple(Relation pg_class_desc, break; } - new_rel_reltup->relfrozenxid = relfrozenxid; - new_rel_reltup->relminmxid = relminmxid; + /* global temp table not remember transaction info in catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + new_rel_reltup->relfrozenxid = InvalidTransactionId; + new_rel_reltup->relminmxid = InvalidMultiXactId; + } + else + { + new_rel_reltup->relfrozenxid = relfrozenxid; + new_rel_reltup->relminmxid = relminmxid; + } + new_rel_reltup->relowner = relowner; new_rel_reltup->reltype = new_type_oid; new_rel_reltup->reloftype = reloftype; @@ -1357,6 +1374,7 @@ heap_create_with_catalog(const char *relname, reloftypeid, ownerid, relkind, + relpersistence, relfrozenxid, relminmxid, PointerGetDatum(relacl), @@ -1441,11 +1459,15 @@ heap_create_with_catalog(const char *relname, */ StoreConstraints(new_rel_desc, cooked_constraints, is_internal); - /* - * If there's a special on-commit action, remember it - */ - if (oncommit != ONCOMMIT_NOOP) - register_on_commit_action(relid, oncommit); + /* global temp table register action when storage init */ + if (relpersistence != RELPERSISTENCE_GLOBAL_TEMP) + { + /* + * If there's a special on-commit action, remember it + */ + if (oncommit != ONCOMMIT_NOOP) + register_on_commit_action(relid, oncommit); + } /* * ok, the relation has been cataloged, so close our relations and return @@ -1937,6 +1959,13 @@ heap_drop_with_catalog(Oid relid) if (relid == defaultPartOid) update_default_partition_oid(parentOid, InvalidOid); + /* We allow to drop global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not drop relation when other backend attached this global temp table"); + } + /* * Schedule unlinking of the relation's physical files at commit. */ @@ -3165,7 +3194,7 @@ RemoveStatistics(Oid relid, AttrNumber attnum) * the specified relation. Caller must hold exclusive lock on rel. */ static void -RelationTruncateIndexes(Relation heapRelation) +RelationTruncateIndexes(Relation heapRelation, LOCKMODE lockmode) { ListCell *indlist; @@ -3176,8 +3205,12 @@ RelationTruncateIndexes(Relation heapRelation) Relation currentIndex; IndexInfo *indexInfo; + if (RELATION_IS_GLOBAL_TEMP(heapRelation) && + !gtt_storage_attached(indexId)) + continue; + /* Open the index relation; use exclusive lock, just to be sure */ - currentIndex = index_open(indexId, AccessExclusiveLock); + currentIndex = index_open(indexId, lockmode); /* * Fetch info needed for index_build. Since we know there are no @@ -3223,8 +3256,13 @@ heap_truncate(List *relids) { Oid rid = lfirst_oid(cell); Relation rel; + LOCKMODE lockmode = AccessExclusiveLock; - rel = table_open(rid, AccessExclusiveLock); + /* truncate global temp table only need RowExclusiveLock */ + if (get_rel_persistence(rid) == RELPERSISTENCE_GLOBAL_TEMP) + lockmode = RowExclusiveLock; + + rel = table_open(rid, lockmode); relations = lappend(relations, rel); } @@ -3257,6 +3295,8 @@ void heap_truncate_one_rel(Relation rel) { Oid toastrelid; + LOCKMODE lockmode = AccessExclusiveLock; + bool truncate_toastrel = false; /* * Truncate the relation. Partitioned tables have no storage, so there is @@ -3265,23 +3305,40 @@ heap_truncate_one_rel(Relation rel) if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) return; + toastrelid = rel->rd_rel->reltoastrelid; + + /* + * Truncate global temp table only need RowExclusiveLock + */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + lockmode = RowExclusiveLock; + if (OidIsValid(toastrelid) && + gtt_storage_attached(toastrelid)) + truncate_toastrel = true; + } + else if (OidIsValid(toastrelid)) + truncate_toastrel = true; + /* Truncate the underlying relation */ table_relation_nontransactional_truncate(rel); /* If the relation has indexes, truncate the indexes too */ - RelationTruncateIndexes(rel); + RelationTruncateIndexes(rel, lockmode); /* If there is a toast table, truncate that too */ - toastrelid = rel->rd_rel->reltoastrelid; - if (OidIsValid(toastrelid)) + if (truncate_toastrel) { - Relation toastrel = table_open(toastrelid, AccessExclusiveLock); + Relation toastrel = table_open(toastrelid, lockmode); table_relation_nontransactional_truncate(toastrel); - RelationTruncateIndexes(toastrel); + RelationTruncateIndexes(toastrel, lockmode); /* keep the lock... */ table_close(toastrel, NoLock); } + + if (RELATION_IS_GLOBAL_TEMP(rel)) + up_gtt_relstats(rel, 0, 0, 0, RecentXmin, InvalidMultiXactId); } /* diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 8880586..0852073 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -52,6 +52,7 @@ #include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/event_trigger.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -877,6 +878,22 @@ index_create(Relation heapRelation, indexRelationName, RelationGetRelationName(heapRelation)))); } + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + if (accessMethodObjectId != BTREE_AM_OID) + elog(ERROR, "only support btree index on global temp table"); + + /* No support create index on global temp table use concurrent mode yet */ + if (concurrent) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot create indexes on global temporary tables using concurrent mode"))); + + /* if global temp table not init storage, then skip build index */ + if (!gtt_storage_attached(heapRelation->rd_node.relNode)) + flags |= INDEX_CREATE_SKIP_BUILD; + } + /* * construct tuple descriptor for index tuples */ @@ -2054,6 +2071,13 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) */ CheckTableNotInUse(userIndexRelation, "DROP INDEX"); + /* We allow to drop index on global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(userHeapRelation)) + { + if (is_other_backend_use_gtt(userHeapRelation->rd_node)) + elog(ERROR, "can not drop index when other backend attached this global temp table."); + } + /* * Drop Index Concurrently is more or less the reverse process of Create * Index Concurrently. @@ -2660,6 +2684,11 @@ index_update_stats(Relation rel, HeapTuple tuple; Form_pg_class rd_rel; bool dirty; + bool is_gtt = false; + + /* update index stats into localhash and rel_rd_rel for global temp table */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + is_gtt = true; /* * We always update the pg_class row using a non-transactional, @@ -2745,21 +2774,35 @@ index_update_stats(Relation rel, else /* don't bother for indexes */ relallvisible = 0; - if (rd_rel->relpages != (int32) relpages) + if (is_gtt) + rel->rd_rel->relpages = (int32) relpages; + else if (rd_rel->relpages != (int32) relpages) { rd_rel->relpages = (int32) relpages; dirty = true; } - if (rd_rel->reltuples != (float4) reltuples) + + if (is_gtt) + rel->rd_rel->reltuples = (float4) reltuples; + else if (rd_rel->reltuples != (float4) reltuples) { rd_rel->reltuples = (float4) reltuples; dirty = true; } - if (rd_rel->relallvisible != (int32) relallvisible) + + if (is_gtt) + rel->rd_rel->relallvisible = (int32) relallvisible; + else if (rd_rel->relallvisible != (int32) relallvisible) { rd_rel->relallvisible = (int32) relallvisible; dirty = true; } + + if (is_gtt) + { + up_gtt_relstats(rel, relpages, reltuples, relallvisible, + InvalidTransactionId, InvalidMultiXactId); + } } /* @@ -2873,6 +2916,15 @@ index_build(Relation heapRelation, pgstat_progress_update_multi_param(6, index, val); } + if (RELATION_IS_GLOBAL_TEMP(indexRelation)) + { + if (!gtt_storage_attached(indexRelation->rd_node.relNode)) + { + gtt_force_enable_index(indexRelation); + RelationCreateStorage(indexRelation->rd_node, RELPERSISTENCE_GLOBAL_TEMP, indexRelation); + } + } + /* * Call the access method's build procedure */ @@ -3468,6 +3520,15 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence, errmsg("cannot reindex temporary tables of other sessions"))); /* + * Because global temp table cannot change relfilenode + * no support reindex on global temp table yet. + */ + if (RELATION_IS_GLOBAL_TEMP(iRel)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot reindex global temporary tables"))); + + /* * Also check for active uses of the index in the current transaction; we * don't want to reindex underneath an open indexscan. */ diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index e70243a..301da79 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -647,6 +647,13 @@ RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid) errmsg("cannot create temporary relation in non-temporary schema"))); } break; + /* global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + if (isAnyTempNamespace(nspid)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("cannot create global temp relations in temporary schemas"))); + break; case RELPERSISTENCE_PERMANENT: if (isTempOrTempToastNamespace(nspid)) newRelation->relpersistence = RELPERSISTENCE_TEMP; diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index fddfbf1..671c614 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -26,6 +26,7 @@ #include "access/xlogutils.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "storage/freespace.h" #include "storage/smgr.h" @@ -75,7 +76,7 @@ static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */ * transaction aborts later on, the storage will be destroyed. */ SMgrRelation -RelationCreateStorage(RelFileNode rnode, char relpersistence) +RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel) { PendingRelDelete *pending; SMgrRelation srel; @@ -85,6 +86,8 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) switch (relpersistence) { case RELPERSISTENCE_TEMP: + /* global temp table use same storage strategy as local temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); needs_wal = false; break; @@ -117,6 +120,10 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) pending->next = pendingDeletes; pendingDeletes = pending; + /* remember global temp table storage info to localhash */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && rel) + remember_gtt_storage_info(rnode, rel); + return srel; } @@ -486,8 +493,15 @@ smgrDoPendingDeletes(bool isCommit) smgrdounlinkall(srels, nrels, false); for (i = 0; i < nrels; i++) + { smgrclose(srels[i]); + /* clean global temp table flags when transaction commit or rollback */ + if (SmgrIsTemp(srels[i]) && + gtt_storage_attached(srels[i]->smgr_rnode.node.relNode)) + forget_gtt_storage_info(srels[i]->smgr_rnode.node.relNode); + } + pfree(srels); } } diff --git a/src/backend/catalog/storage_gtt.c b/src/backend/catalog/storage_gtt.c new file mode 100644 index 0000000..71be416 --- /dev/null +++ b/src/backend/catalog/storage_gtt.c @@ -0,0 +1,1174 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.c + * code to create and destroy physical storage for global temparary table + * + * IDENTIFICATION + * src/backend/catalog/storage_gtt.c + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "access/table.h" +#include "access/visibilitymap.h" +#include "access/xact.h" +#include "access/xlog.h" +#include "access/xloginsert.h" +#include "access/xlogutils.h" +#include "access/htup_details.h" +#include "access/multixact.h" +#include "catalog/storage.h" +#include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" +#include "catalog/heap.h" +#include "catalog/namespace.h" +#include "catalog/pg_type.h" +#include "catalog/pg_statistic.h" +#include "commands/tablecmds.h" +#include "funcapi.h" +#include "nodes/primnodes.h" +#include "nodes/pg_list.h" +#include "nodes/execnodes.h" +#include "miscadmin.h" +#include "storage/freespace.h" +#include "storage/smgr.h" +#include "storage/ipc.h" +#include "storage/proc.h" +#include "storage/procarray.h" +#include "storage/lwlock.h" +#include "storage/shmem.h" +#include "storage/sinvaladt.h" +#include "utils/memutils.h" +#include "utils/rel.h" +#include "utils/hsearch.h" +#include "utils/catcache.h" +#include "utils/lsyscache.h" +#include <utils/relcache.h> +#include "utils/inval.h" +#include "utils/guc.h" + + +/* Copy from bitmapset.c, because gtt used the function in bitmapset.c */ +#define WORDNUM(x) ((x) / BITS_PER_BITMAPWORD) +#define BITNUM(x) ((x) % BITS_PER_BITMAPWORD) + +#define BITMAPSET_SIZE(nwords) \ + (offsetof(Bitmapset, words) + (nwords) * sizeof(bitmapword)) + +static bool gtt_cleaner_exit_registered = false; +static HTAB *gtt_storage_local_hash = NULL; +static HTAB *active_gtt_shared_hash = NULL; +static MemoryContext gtt_relstats_context = NULL; + +/* relfrozenxid of all gtts in the current session */ +static List *gtt_session_relfrozenxid_list = NIL; +static TransactionId gtt_session_frozenxid = InvalidTransactionId; + +typedef struct gtt_ctl_data +{ + LWLock lock; + int max_entry; + int entry_size; +}gtt_ctl_data; + +static gtt_ctl_data *gtt_shared_ctl = NULL; + +typedef struct +{ + RelFileNode rnode; + Bitmapset *map; + /* bitmap data */ +} gtt_shared_hash_entry; + +typedef struct +{ + Oid relid; + + Oid spcnode; + /* pg_class stat */ + int32 relpages; + float4 reltuples; + int32 relallvisible; + TransactionId relfrozenxid; + TransactionId relminmxid; + char relkind; + bool on_commit_delete; + + /* pg_statistic */ + int natts; + int *attnum; + HeapTuple *att_stat_tups; +} gtt_local_hash_entry; + +static Size action_gtt_shared_hash_entry_size(void); +static void gtt_storage_checkin(RelFileNode rnode); +static void gtt_storage_checkout(RelFileNode rnode, bool skiplock); +static void gtt_storage_removeall(int code, Datum arg); +static void insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid); +static void remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid); +static void set_gtt_session_relfrozenxid(void); + +Datum pg_get_gtt_statistics(PG_FUNCTION_ARGS); +Datum pg_get_gtt_relstats(PG_FUNCTION_ARGS); +Datum pg_gtt_attached_pid(PG_FUNCTION_ARGS); +Datum pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS); + + +static Size +action_gtt_shared_hash_entry_size(void) +{ + int wordnum; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + wordnum = WORDNUM(MaxBackends + 1); + hash_entry_size += MAXALIGN(sizeof(gtt_shared_hash_entry)); + hash_entry_size += MAXALIGN(BITMAPSET_SIZE(wordnum + 1)); + + return hash_entry_size; +} + +Size +active_gtt_shared_hash_size(void) +{ + Size size = 0; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + size = MAXALIGN(sizeof(gtt_ctl_data)); + hash_entry_size = action_gtt_shared_hash_entry_size(); + size += hash_estimate_size(max_active_gtt, hash_entry_size); + + return size; +} + +void +active_gtt_shared_hash_init(void) +{ + HASHCTL info; + bool found; + + if (max_active_gtt <= 0) + return; + + gtt_shared_ctl = + ShmemInitStruct("gtt_shared_ctl", + sizeof(gtt_ctl_data), + &found); + + if (!found) + { + LWLockRegisterTranche(LWTRANCHE_GTT_CTL, "gtt_shared_ctl"); + LWLockInitialize(>t_shared_ctl->lock, LWTRANCHE_GTT_CTL); + gtt_shared_ctl->max_entry = max_active_gtt; + gtt_shared_ctl->entry_size = action_gtt_shared_hash_entry_size(); + } + + info.keysize = sizeof(RelFileNode); + info.entrysize = gtt_shared_ctl->entry_size; + active_gtt_shared_hash = + ShmemInitHash("active gtt shared hash", + gtt_shared_ctl->max_entry, + gtt_shared_ctl->max_entry, + &info, HASH_ELEM | HASH_BLOBS | HASH_FIXED_SIZE); +} + +static void +gtt_storage_checkin(RelFileNode rnode) +{ + gtt_shared_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + entry = (gtt_shared_hash_entry *) hash_search(active_gtt_shared_hash, + &rnode, HASH_ENTER_NULL, &found); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of shared memory"), + errhint("You might need to increase max_active_gtt."))); + } + + if (found == false) + { + int wordnum; + + entry->map = (Bitmapset *)((char *)entry + MAXALIGN(sizeof(gtt_shared_hash_entry))); + wordnum = WORDNUM(MaxBackends + 1); + memset(entry->map, 0, BITMAPSET_SIZE(wordnum + 1)); + entry->map->nwords = wordnum + 1; + } + + bms_add_member(entry->map, MyBackendId); + LWLockRelease(>t_shared_ctl->lock); +} + +static void +gtt_storage_checkout(RelFileNode rnode, bool skiplock) +{ + gtt_shared_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (!skiplock) + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + + entry = hash_search(active_gtt_shared_hash, + (void *) &(rnode), HASH_FIND, NULL); + + if (entry == NULL) + { + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + elog(WARNING, "relfilenode %u/%u/%u not exist in gtt shared hash when forget", + rnode.dbNode, rnode.spcNode, rnode.relNode); + return; + } + + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + bms_del_member(entry->map, MyBackendId); + + if (bms_is_empty(entry->map)) + { + if (!hash_search(active_gtt_shared_hash, &rnode, HASH_REMOVE, NULL)) + elog(PANIC, "gtt shared hash table corrupted"); + } + + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + return; +} + +Bitmapset * +copy_active_gtt_bitmap(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + Bitmapset *map_copy = NULL; + + if (max_active_gtt <= 0) + return NULL; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return NULL; + } + + Assert(entry->map); + if (!bms_is_empty(entry->map)) + map_copy = bms_copy(entry->map); + + LWLockRelease(>t_shared_ctl->lock); + + return map_copy; +} + +bool +is_other_backend_use_gtt(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + bool in_use = false; + int num_use = 0; + + if (max_active_gtt <= 0) + return false; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return false; + } + + Assert(entry->map); + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + + num_use = bms_num_members(entry->map); + if (num_use == 0) + in_use = false; + else if (num_use == 1) + { + if(bms_is_member(MyBackendId, entry->map)) + in_use = false; + else + in_use = true; + } + else + in_use = true; + + LWLockRelease(>t_shared_ctl->lock); + + return in_use; +} + +void +remember_gtt_storage_info(RelFileNode rnode, Relation rel) +{ + gtt_local_hash_entry *entry; + MemoryContext oldcontext; + Oid relid = rnode.relNode; + bool found; + int natts = 0; + + if (max_active_gtt <= 0) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Global temporary table feature is disable"), + errhint("You might need to increase max_active_gtt to enable this feature."))); + + if (RecoveryInProgress()) + elog(ERROR, "readonly mode not support access global temp table yet"); + + if (rel->rd_rel->relkind == RELKIND_INDEX && + (!rel->rd_index->indisvalid || + !rel->rd_index->indisready || + !rel->rd_index->indislive)) + elog(ERROR, "invalid gtt index %s not allow to create stroage file", RelationGetRelationName(rel)); + + if (gtt_storage_local_hash == NULL) + { +#define GTT_LOCAL_HASH_SIZE 1024 + /* First time through: initialize the hash table */ + HASHCTL ctl; + + MemSet(&ctl, 0, sizeof(ctl)); + ctl.keysize = sizeof(Oid); + ctl.entrysize = sizeof(gtt_local_hash_entry); + gtt_storage_local_hash = + hash_create("global temp relation table", + GTT_LOCAL_HASH_SIZE, + &ctl, HASH_ELEM | HASH_BLOBS); + + if (!CacheMemoryContext) + CreateCacheMemoryContext(); + + gtt_relstats_context = + AllocSetContextCreate(CacheMemoryContext, + "gtt relstats context", + ALLOCSET_DEFAULT_SIZES); + } + + /* Look up or create an entry */ + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_ENTER, &found); + + if (found) + { + elog(ERROR, "backend %d relid %u already exists in global temp table local hash", + MyBackendId, relid); + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + + entry->spcnode = rnode.spcNode; + entry->relpages = 0; + entry->reltuples = 0; + entry->relallvisible = 0; + entry->relkind = rel->rd_rel->relkind; + natts = RelationGetNumberOfAttributes(rel); + entry->natts = natts; + entry->attnum = palloc0(sizeof(int) * natts); + entry->att_stat_tups = palloc0(sizeof(HeapTuple) * natts); + /* only heap contain transaction information */ + if (entry->relkind == RELKIND_RELATION || + entry->relkind == RELKIND_PARTITIONED_TABLE) + { + if (RELATION_GTT_ON_COMMIT_DELETE(rel)) + { + entry->on_commit_delete = true; + register_on_commit_action(rel->rd_node.relNode, ONCOMMIT_DELETE_ROWS); + } + + entry->relfrozenxid = RecentXmin; + entry->relminmxid = GetOldestMultiXactId(); + insert_gtt_relfrozenxid_to_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + gtt_storage_checkin(rnode); + } + else + { + entry->on_commit_delete = false; + entry->relfrozenxid = 0; + entry->relminmxid = 0; + } + + MemoryContextSwitchTo(oldcontext); + + if (!gtt_cleaner_exit_registered) + { + before_shmem_exit(gtt_storage_removeall, 0); + gtt_cleaner_exit_registered = true; + } + + return; +} + +void +forget_gtt_storage_info(Oid relid) +{ + gtt_local_hash_entry *entry = NULL; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, NULL); + + if (entry) + { + int i; + + if (entry->relkind == RELKIND_RELATION || + entry->relkind == RELKIND_PARTITIONED_TABLE) + { + RelFileNode rnode; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + gtt_storage_checkout(rnode, false); + + Assert(TransactionIdIsNormal(entry->relfrozenxid)); + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + } + + for (i = 0; i < entry->natts; i++) + { + if (entry->att_stat_tups[i]) + { + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + } + } + + pfree(entry->attnum); + pfree(entry->att_stat_tups); + } + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_REMOVE, NULL); + + return; +} + +/* is the storage file was created in this backend */ +bool +gtt_storage_attached(Oid relid) +{ + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, &found); + + return found; +} + +static void +gtt_storage_removeall(int code, Datum arg) +{ + HASH_SEQ_STATUS status; + gtt_local_hash_entry *entry; + int nrels = 0, + maxrels = 0; + SMgrRelation *srels = NULL; + RelFileNode *rnodes = NULL; + char *relkinds = NULL; + + if (gtt_storage_local_hash == NULL) + return; + + hash_seq_init(&status, gtt_storage_local_hash); + while ((entry = (gtt_local_hash_entry *) hash_seq_search(&status)) != NULL) + { + SMgrRelation srel; + RelFileNode rnode; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + srel = smgropen(rnode, MyBackendId); + + /* allocate the initial array, or extend it, if needed */ + if (maxrels == 0) + { + maxrels = 32; + srels = palloc(sizeof(SMgrRelation) * maxrels); + rnodes = palloc(sizeof(RelFileNode) * maxrels); + relkinds = palloc(sizeof(char) * maxrels); + } + else if (maxrels <= nrels) + { + maxrels *= 2; + srels = repalloc(srels, sizeof(SMgrRelation) * maxrels); + rnodes = repalloc(rnodes, sizeof(RelFileNode) * maxrels); + relkinds = repalloc(relkinds, sizeof(char) * maxrels); + } + + srels[nrels] = srel; + rnodes[nrels] = rnode; + relkinds[nrels] = entry->relkind; + nrels++; + } + + if (nrels > 0) + { + int i; + + smgrdounlinkall(srels, nrels, false); + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + for (i = 0; i < nrels; i++) + { + smgrclose(srels[i]); + if (relkinds[i] == RELKIND_RELATION) + gtt_storage_checkout(rnodes[i], true); + } + LWLockRelease(>t_shared_ctl->lock); + + pfree(srels); + pfree(rnodes); + pfree(relkinds); + } + + MyProc->session_gtt_frozenxid = InvalidTransactionId; + + return; +} + +/* + * Update global temp table relstats(relpage/reltuple/relallvisible) + * to local hashtable + */ +void +up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid) +{ + Oid relid = RelationGetRelid(relation); + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return; + + Assert(entry->spcnode); + + if (num_pages >= 0 && + entry->relpages != (int32)num_pages) + entry->relpages = (int32)num_pages; + + if (num_tuples >= 0 && + num_tuples != (float4)entry->reltuples) + entry->reltuples = (float4)num_tuples; + + /* only heap contain transaction information and relallvisible */ + if (entry->relkind == RELKIND_RELATION) + { + if (entry->relallvisible >= 0 && + entry->relallvisible != (int32)num_all_visible_pages) + { + entry->relallvisible = (int32)num_all_visible_pages; + } + + if (TransactionIdIsNormal(relfrozenxid) && + entry->relfrozenxid != relfrozenxid && + (TransactionIdPrecedes(entry->relfrozenxid, relfrozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), entry->relfrozenxid))) + { + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + entry->relfrozenxid = relfrozenxid; + insert_gtt_relfrozenxid_to_ordered_list(relfrozenxid); + set_gtt_session_relfrozenxid(); + } + + if (MultiXactIdIsValid(relminmxid) && + entry->relminmxid != relminmxid && + (MultiXactIdPrecedes(entry->relminmxid, relminmxid) || + MultiXactIdPrecedes(ReadNextMultiXactId(), entry->relminmxid))) + { + entry->relminmxid = relminmxid; + } + } + + return; +} + +/* + * Search global temp table relstats(relpage/reltuple/relallvisible) + * from local hashtable. + */ +bool +get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid) +{ + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return false; + + Assert(entry->relid == relid); + + if (relpages) + *relpages = entry->relpages; + + if (reltuples) + *reltuples = entry->reltuples; + + if (relallvisible) + *relallvisible = entry->relallvisible; + + if (relfrozenxid) + *relfrozenxid = entry->relfrozenxid; + + if (relminmxid) + *relminmxid = entry->relminmxid; + + return true; +} + +/* + * Update global temp table statistic info(definition is same as pg_statistic) + * to local hashtable where ananyze global temp table + */ +void +up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull) +{ + gtt_local_hash_entry *entry; + bool found; + MemoryContext oldcontext; + int i = 0; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return; + + /* todo */ + if (entry->natts < natts) + { + elog(WARNING, "reloid %u not support update attstat after add colunm", reloid); + return; + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + Assert(entry->relid == reloid); + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == 0) + { + entry->attnum[i] = attnum; + break; + } + else if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + break; + } + } + + Assert(i < entry->natts); + Assert(entry->att_stat_tups[i] == NULL); + entry->att_stat_tups[i] = heap_form_tuple(tupleDescriptor, values, isnull); + MemoryContextSwitchTo(oldcontext); + + return; +} + +/* + * Search global temp table statistic info(definition is same as pg_statistic) + * from local hashtable. + */ +HeapTuple +get_gtt_att_statistic(Oid reloid, int attnum, bool inh) +{ + gtt_local_hash_entry *entry; + bool found; + int i = 0; + + if (max_active_gtt <= 0) + return NULL; + + if (gtt_storage_local_hash == NULL) + return NULL; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return NULL; + + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + return entry->att_stat_tups[i]; + } + } + + return NULL; +} + +void +release_gtt_statistic_cache(HeapTuple tup) +{ + /* do nothing */ + return; +} + +static void +insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid) +{ + MemoryContext oldcontext; + ListCell *cell; + int i; + + Assert(TransactionIdIsNormal(relfrozenxid)); + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + /* Does the datum belong at the front? */ + if (gtt_session_relfrozenxid_list == NIL || + TransactionIdFollowsOrEquals(relfrozenxid, + linitial_oid(gtt_session_relfrozenxid_list))) + { + gtt_session_relfrozenxid_list = + lcons_oid(relfrozenxid, gtt_session_relfrozenxid_list); + MemoryContextSwitchTo(oldcontext); + + return; + } + + /* No, so find the entry it belongs after */ + i = 0; + foreach (cell, gtt_session_relfrozenxid_list) + { + if (TransactionIdFollowsOrEquals(relfrozenxid, lfirst_oid(cell))) + break; + + i++; + } + gtt_session_relfrozenxid_list = + list_insert_nth_oid(gtt_session_relfrozenxid_list, i, relfrozenxid); + MemoryContextSwitchTo(oldcontext); + + return; +} + +static void +remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid) +{ + gtt_session_relfrozenxid_list = + list_delete_oid(gtt_session_relfrozenxid_list, relfrozenxid); +} + +static void +set_gtt_session_relfrozenxid(void) +{ + TransactionId gtt_frozenxid = InvalidTransactionId; + + if (gtt_session_relfrozenxid_list) + gtt_frozenxid = llast_oid(gtt_session_relfrozenxid_list); + + gtt_session_frozenxid = gtt_frozenxid; + if (MyProc->session_gtt_frozenxid != gtt_frozenxid) + MyProc->session_gtt_frozenxid = gtt_frozenxid; +} + +Datum +pg_get_gtt_statistics(PG_FUNCTION_ARGS) +{ + HeapTuple tuple; + Relation rel = NULL; + int attnum = PG_GETARG_INT32(1); + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + MemoryContext oldcontext; + Tuplestorestate *tupstore; + Relation pg_tatistic = NULL; + TupleDesc sd; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not " \ + "allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + pg_tatistic = table_open(StatisticRelationId, AccessShareLock); + sd = RelationGetDescr(pg_tatistic); + + tuple = get_gtt_att_statistic(reloid, attnum, false); + if (tuple) + { + Datum values[31]; + bool isnull[31]; + HeapTuple res = NULL; + + memset(&values, 0, sizeof(values)); + memset(&isnull, 0, sizeof(isnull)); + heap_deform_tuple(tuple, sd, values, isnull); + res = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, res); + } + + table_close(rel, NoLock); + table_close(pg_tatistic, AccessShareLock); + tuplestore_donestoring(tupstore); + + return (Datum) 0; +} + +Datum +pg_get_gtt_relstats(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + uint32 relfrozenxid = 0; + uint32 relminmxid = 0; + Relation rel = NULL; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + if (get_gtt_relstats(reloid, + &relpages, &reltuples, &relallvisible, + &relfrozenxid, &relminmxid)) + { + Datum values[5]; + bool isnull[5]; + + memset(isnull, 0, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(relpages); + values[1] = Float4GetDatum((float4)reltuples); + values[2] = Int32GetDatum(relallvisible); + values[3] = UInt32GetDatum(relfrozenxid); + values[4] = UInt32GetDatum(relminmxid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_gtt_attached_pid(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + Relation rel = NULL; + PGPROC *proc = NULL; + Bitmapset *map = NULL; + pid_t pid = 0; + int backendid = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + map = copy_active_gtt_bitmap(rel->rd_node); + if (map) + { + backendid = bms_first_member(map); + + do + { + proc = BackendIdGetProc(backendid); + pid = proc->pid; + if (pid > 0) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = UInt32GetDatum(reloid); + values[1] = Int32GetDatum(pid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + backendid = bms_next_member(map, backendid); + } while (backendid > 0); + + pfree(map); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + int num_xid = MaxBackends + 1; + int *pids = NULL; + uint32 *xids = NULL; + int i = 0; + int j = 0; + uint32 oldest = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + if (max_active_gtt <= 0) + return (Datum) 0; + + if (RecoveryInProgress()) + return (Datum) 0; + + pids = palloc0(sizeof(int) * num_xid); + xids = palloc0(sizeof(int) * num_xid); + oldest = list_all_session_gtt_frozenxids(num_xid, pids, xids, &i); + if (i > 0) + { + if (i > 0) + { + pids[i] = 0; + xids[i] = oldest; + i++; + } + + for(j = 0; j < i; j++) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(pids[j]); + values[1] = UInt32GetDatum(xids[j]); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + } + tuplestore_donestoring(tupstore); + pfree(pids); + pfree(xids); + + return (Datum) 0; +} + +void +gtt_force_enable_index(Relation index) +{ + Oid indexOid = RelationGetRelid(index); + + if (!RELATION_IS_GLOBAL_TEMP(index)) + return; + + Assert(index->rd_rel->relkind == RELKIND_INDEX); + Assert(OidIsValid(indexOid)); + + index->rd_index->indisvalid = true; + index->rd_index->indislive = true; + index->rd_index->indisready = true; +} + +void +gtt_fix_index_state(Relation index) +{ + Oid indexOid = RelationGetRelid(index); + Oid relOid = index->rd_index->indrelid; + + if (!RELATION_IS_GLOBAL_TEMP(index)) + return; + + if (!index->rd_index->indisvalid) + return; + + if (gtt_storage_attached(relOid) && + !gtt_storage_attached(indexOid)) + { + index->rd_index->indisvalid = false; + index->rd_index->indislive = false; + index->rd_index->indisready = false; + } + + return; +} + diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index c9e6060..d814ff2 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -186,6 +186,91 @@ CREATE OR REPLACE VIEW pg_sequences AS WHERE NOT pg_is_other_temp_schema(N.oid) AND relkind = 'S'; +-- For global temporary table +CREATE VIEW pg_gtt_relstats WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_relstats(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_attached_pids WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_gtt_attached_pid(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_stats WITH (security_barrier) AS +SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN s.stakind1 = 1 THEN s.stavalues1 + WHEN s.stakind2 = 1 THEN s.stavalues2 + WHEN s.stakind3 = 1 THEN s.stavalues3 + WHEN s.stakind4 = 1 THEN s.stavalues4 + WHEN s.stakind5 = 1 THEN s.stavalues5 + END AS most_common_vals, + CASE + WHEN s.stakind1 = 1 THEN s.stanumbers1 + WHEN s.stakind2 = 1 THEN s.stanumbers2 + WHEN s.stakind3 = 1 THEN s.stanumbers3 + WHEN s.stakind4 = 1 THEN s.stanumbers4 + WHEN s.stakind5 = 1 THEN s.stanumbers5 + END AS most_common_freqs, + CASE + WHEN s.stakind1 = 2 THEN s.stavalues1 + WHEN s.stakind2 = 2 THEN s.stavalues2 + WHEN s.stakind3 = 2 THEN s.stavalues3 + WHEN s.stakind4 = 2 THEN s.stavalues4 + WHEN s.stakind5 = 2 THEN s.stavalues5 + END AS histogram_bounds, + CASE + WHEN s.stakind1 = 3 THEN s.stanumbers1[1] + WHEN s.stakind2 = 3 THEN s.stanumbers2[1] + WHEN s.stakind3 = 3 THEN s.stanumbers3[1] + WHEN s.stakind4 = 3 THEN s.stanumbers4[1] + WHEN s.stakind5 = 3 THEN s.stanumbers5[1] + END AS correlation, + CASE + WHEN s.stakind1 = 4 THEN s.stavalues1 + WHEN s.stakind2 = 4 THEN s.stavalues2 + WHEN s.stakind3 = 4 THEN s.stavalues3 + WHEN s.stakind4 = 4 THEN s.stavalues4 + WHEN s.stakind5 = 4 THEN s.stavalues5 + END AS most_common_elems, + CASE + WHEN s.stakind1 = 4 THEN s.stanumbers1 + WHEN s.stakind2 = 4 THEN s.stanumbers2 + WHEN s.stakind3 = 4 THEN s.stanumbers3 + WHEN s.stakind4 = 4 THEN s.stanumbers4 + WHEN s.stakind5 = 4 THEN s.stanumbers5 + END AS most_common_elem_freqs, + CASE + WHEN s.stakind1 = 5 THEN s.stanumbers1 + WHEN s.stakind2 = 5 THEN s.stanumbers2 + WHEN s.stakind3 = 5 THEN s.stanumbers3 + WHEN s.stakind4 = 5 THEN s.stanumbers4 + WHEN s.stakind5 = 5 THEN s.stanumbers5 + END AS elem_count_histogram + FROM + pg_class c + JOIN pg_attribute a ON c.oid = a.attrelid + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_statistics(c.oid, a.attnum, ''::text) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') and NOT a.attisdropped AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + CREATE VIEW pg_stats WITH (security_barrier) AS SELECT nspname AS schemaname, diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index c4420dd..977a984 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -34,6 +34,7 @@ #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "commands/dbcommands.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -103,7 +104,7 @@ static int acquire_inherited_sample_rows(Relation onerel, int elevel, HeapTuple *rows, int targrows, double *totalrows, double *totaldeadrows); static void update_attstats(Oid relid, bool inh, - int natts, VacAttrStats **vacattrstats); + int natts, VacAttrStats **vacattrstats, char relpersistence); static Datum std_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); @@ -586,14 +587,15 @@ do_analyze_rel(Relation onerel, VacuumParams *params, * pg_statistic for columns we didn't process, we leave them alone.) */ update_attstats(RelationGetRelid(onerel), inh, - attr_cnt, vacattrstats); + attr_cnt, vacattrstats, RelationGetRelPersistence(onerel)); for (ind = 0; ind < nindexes; ind++) { AnlIndexData *thisdata = &indexdata[ind]; update_attstats(RelationGetRelid(Irel[ind]), false, - thisdata->attr_cnt, thisdata->vacattrstats); + thisdata->attr_cnt, thisdata->vacattrstats, + RelationGetRelPersistence(Irel[ind])); } /* @@ -1456,7 +1458,7 @@ acquire_inherited_sample_rows(Relation onerel, int elevel, * by taking a self-exclusive lock on the relation in analyze_rel(). */ static void -update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) +update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats, char relpersistence) { Relation sd; int attno; @@ -1558,31 +1560,45 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) } } - /* Is there already a pg_statistic tuple for this attribute? */ - oldtup = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(relid), - Int16GetDatum(stats->attr->attnum), - BoolGetDatum(inh)); - - if (HeapTupleIsValid(oldtup)) + /* Update column statistic to localhash, not catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { - /* Yes, replace it */ - stup = heap_modify_tuple(oldtup, - RelationGetDescr(sd), - values, - nulls, - replaces); - ReleaseSysCache(oldtup); - CatalogTupleUpdate(sd, &stup->t_self, stup); + up_gtt_att_statistic(relid, + stats->attr->attnum, + inh, + natts, + RelationGetDescr(sd), + values, + nulls); } else { - /* No, insert new tuple */ - stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); - CatalogTupleInsert(sd, stup); - } + /* Is there already a pg_statistic tuple for this attribute? */ + oldtup = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(relid), + Int16GetDatum(stats->attr->attnum), + BoolGetDatum(inh)); - heap_freetuple(stup); + if (HeapTupleIsValid(oldtup)) + { + /* Yes, replace it */ + stup = heap_modify_tuple(oldtup, + RelationGetDescr(sd), + values, + nulls, + replaces); + ReleaseSysCache(oldtup); + CatalogTupleUpdate(sd, &stup->t_self, stup); + } + else + { + /* No, insert new tuple */ + stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); + CatalogTupleInsert(sd, stup); + } + + heap_freetuple(stup); + } } table_close(sd, RowExclusiveLock); diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index e9d7a7f..3088e26 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -391,6 +391,12 @@ cluster_rel(Oid tableOid, Oid indexOid, int options) errmsg("cannot vacuum temporary tables of other sessions"))); } + /* not support cluster global temp table yet */ + if (RELATION_IS_GLOBAL_TEMP(OldHeap)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("not support cluster global temporary tables yet"))); + /* * Also check for active uses of the relation in the current transaction, * including open scans and pending AFTER trigger events. diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index ec20ba3..a29cc00 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2614,6 +2614,16 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind, !isTempNamespace(classtuple->relnamespace)) continue; + /* not support reindex on global temp table, so skip it */ + if (classtuple->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + ereport(WARNING, + (errmsg("global temp table \"%s.%s\" skip reindexed", + get_namespace_name(get_rel_namespace(relid)), + get_rel_name(relid)))); + continue; + } + /* Check user/system classification, and optionally skip */ if (objectKind == REINDEX_OBJECT_SYSTEM && !IsSystemClass(relid, classtuple)) diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c index 329ab84..dfa257c 100644 --- a/src/backend/commands/lockcmds.c +++ b/src/backend/commands/lockcmds.c @@ -96,7 +96,8 @@ RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, * transaction. */ relpersistence = get_rel_persistence(relid); - if (relpersistence == RELPERSISTENCE_TEMP) + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPNAMESPACE; /* Check permissions. */ diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 6aab73b..44f350d 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -94,7 +94,7 @@ static HTAB *seqhashtab = NULL; /* hash table for SeqTable items */ */ static SeqTableData *last_used_seq = NULL; -static void fill_seq_with_data(Relation rel, HeapTuple tuple); +static void fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf); static Relation lock_and_open_sequence(SeqTable seq); static void create_seq_hashtable(void); static void init_sequence(Oid relid, SeqTable *p_elm, Relation *p_rel); @@ -108,6 +108,7 @@ static void init_params(ParseState *pstate, List *options, bool for_identity, List **owned_by); static void do_setval(Oid relid, int64 next, bool iscalled); static void process_owned_by(Relation seqrel, List *owned_by, bool for_identity); +int64 get_seqence_start_value(Oid seqid); /* @@ -222,7 +223,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq) /* now initialize the sequence's data */ tuple = heap_form_tuple(tupDesc, value, null); - fill_seq_with_data(rel, tuple); + fill_seq_with_data(rel, tuple, InvalidBuffer); /* process OWNED BY if given */ if (owned_by) @@ -327,7 +328,7 @@ ResetSequence(Oid seq_relid) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seq_rel, tuple); + fill_seq_with_data(seq_rel, tuple, InvalidBuffer); /* Clear local cache so that we don't think we have cached numbers */ /* Note that we do not change the currval() state */ @@ -340,17 +341,21 @@ ResetSequence(Oid seq_relid) * Initialize a sequence's relation with the specified tuple as content */ static void -fill_seq_with_data(Relation rel, HeapTuple tuple) +fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf) { - Buffer buf; Page page; sequence_magic *sm; OffsetNumber offnum; + bool lockBuffer = false; /* Initialize first page of relation with special magic number */ - buf = ReadBuffer(rel, P_NEW); - Assert(BufferGetBlockNumber(buf) == 0); + if (buf == InvalidBuffer) + { + buf = ReadBuffer(rel, P_NEW); + Assert(BufferGetBlockNumber(buf) == 0); + lockBuffer = true; + } page = BufferGetPage(buf); @@ -360,7 +365,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) /* Now insert sequence tuple */ - LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); + if (lockBuffer) + LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); /* * Since VACUUM does not process sequences, we have to force the tuple to @@ -410,7 +416,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) END_CRIT_SECTION(); - UnlockReleaseBuffer(buf); + if (lockBuffer) + UnlockReleaseBuffer(buf); } /* @@ -502,7 +509,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seqrel, newdatatuple); + fill_seq_with_data(seqrel, newdatatuple, InvalidBuffer); } /* process OWNED BY if given */ @@ -1178,6 +1185,25 @@ read_seq_tuple(Relation rel, Buffer *buf, HeapTuple seqdatatuple) LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); page = BufferGetPage(*buf); + if (GlobalTempRelationPageIsNotInitialized(rel, page)) + { + /* Initialize sequence for global temporary tables */ + Datum value[SEQ_COL_LASTCOL] = {0}; + bool null[SEQ_COL_LASTCOL] = {false}; + HeapTuple tuple; + int64 startv = get_seqence_start_value(RelationGetRelid(rel)); + + /* + * last_value from pg_sequence.seqstart + * log_cnt = 0 + * is_called = false + */ + value[SEQ_COL_LASTVAL-1] = Int64GetDatumFast(startv); /* start sequence with 1 */ + + tuple = heap_form_tuple(RelationGetDescr(rel), value, null); + fill_seq_with_data(rel, tuple, *buf); + heap_freetuple(tuple); + } sm = (sequence_magic *) PageGetSpecialPointer(page); if (sm->magic != SEQ_MAGIC) @@ -1954,3 +1980,23 @@ seq_mask(char *page, BlockNumber blkno) mask_unused_space(page); } + +int64 +get_seqence_start_value(Oid seqid) +{ + HeapTuple seqtuple; + Form_pg_sequence seqform; + int64 start; + + seqtuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(seqid)); + if (!HeapTupleIsValid(seqtuple)) + elog(ERROR, "cache lookup failed for sequence %u", + seqid); + + seqform = (Form_pg_sequence) GETSTRUCT(seqtuple); + start = seqform->seqstart; + ReleaseSysCache(seqtuple); + + return start; +} + diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 70589dd..81bd3e5 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -47,6 +47,7 @@ #include "catalog/storage.h" #include "catalog/storage_xlog.h" #include "catalog/toasting.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/comment.h" #include "commands/defrem.h" @@ -552,6 +553,7 @@ static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTbl); static List *GetParentedForeignKeyRefs(Relation partition); static void ATDetachCheckNoForeignKeyRefs(Relation partition); +static bool has_oncommit_option(List *options); /* ---------------------------------------------------------------- @@ -597,6 +599,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, LOCKMODE parentLockmode; const char *accessMethod = NULL; Oid accessMethodId = InvalidOid; + bool has_oncommit_clause = false; /* * Truncate relname to appropriate length (probably a waste of time, as @@ -607,8 +610,10 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Check consistency of arguments */ + /* global temp table same as local temp table */ if (stmt->oncommit != ONCOMMIT_NOOP - && stmt->relation->relpersistence != RELPERSISTENCE_TEMP) + && !(stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("ON COMMIT can only be used on temporary tables"))); @@ -638,7 +643,9 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, * code. This is needed because calling code might not expect untrusted * tables to appear in pg_temp at the front of its search path. */ - if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP + /* global temp table same as local temp table */ + if ((stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) && InSecurityRestrictedOperation()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -739,6 +746,57 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Parse and validate reloptions, if any. */ + /* global temp table */ + has_oncommit_clause = has_oncommit_option(stmt->options); + if (stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (relkind == RELKIND_RELATION || relkind == RELKIND_PARTITIONED_TABLE)) + { + /* inherit table or parition table inherit on commit property from parent table*/ + if (inheritOids && stmt->oncommit == ONCOMMIT_NOOP && !has_oncommit_clause) + { + Oid parent = linitial_oid(inheritOids); + Relation relation = table_open(parent, NoLock); + + if (!RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "The parent table must be global temporary table"); + + if (RELATION_GTT_ON_COMMIT_DELETE(relation)) + stmt->oncommit = ONCOMMIT_DELETE_ROWS; + else + stmt->oncommit = ONCOMMIT_PRESERVE_ROWS; + table_close(relation, NoLock); + } + + if (has_oncommit_clause) + { + if (stmt->oncommit != ONCOMMIT_NOOP) + elog(ERROR, "can not defeine global temp table with on commit and with clause at same time"); + } + else + { + DefElem *opt = makeNode(DefElem); + + opt->type = T_DefElem; + opt->defnamespace = NULL; + opt->defname = "on_commit_delete_rows"; + opt->defaction = DEFELEM_UNSPEC; + + /* use reloptions to remember on commit clause */ + if (stmt->oncommit == ONCOMMIT_DELETE_ROWS) + opt->arg = (Node *)makeString("true"); + else if (stmt->oncommit == ONCOMMIT_PRESERVE_ROWS) + opt->arg = (Node *)makeString("false"); + else if (stmt->oncommit == ONCOMMIT_NOOP) + opt->arg = (Node *)makeString("false"); + else + elog(ERROR, "global temp table not support on commit drop clause"); + + stmt->options = lappend(stmt->options, opt); + } + } + else if (has_oncommit_clause) + elog(ERROR, "regular table cannot specifie on_commit_delete_rows"); + reloptions = transformRelOptions((Datum) 0, stmt->options, NULL, validnsps, true, false); @@ -1816,7 +1874,8 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged, * table or the current physical file to be thrown away anyway. */ if (rel->rd_createSubid == mySubid || - rel->rd_newRelfilenodeSubid == mySubid) + rel->rd_newRelfilenodeSubid == mySubid || + RELATION_IS_GLOBAL_TEMP(rel)) { /* Immediate, non-rollbackable truncation is OK */ heap_truncate_one_rel(rel); @@ -3375,6 +3434,13 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo * specially. */ targetrelation = relation_open(myrelid, is_index ? ShareUpdateExclusiveLock : AccessExclusiveLock); + + if (RELATION_IS_GLOBAL_TEMP(targetrelation)) + { + if (is_other_backend_use_gtt(targetrelation->rd_node)) + elog(ERROR, "can not rename relation when other backend attached this global temp table"); + } + namespaceId = RelationGetNamespace(targetrelation); /* @@ -3550,6 +3616,13 @@ AlterTable(AlterTableStmt *stmt, LOCKMODE lockmode, /* Caller is required to provide an adequate lock. */ rel = relation_open(context->relid, NoLock); + /* We allow to alter global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not alter relation when other backend attached this global temp table"); + } + CheckTableNotInUse(rel, "ALTER TABLE"); ATController(stmt, rel, stmt->cmds, stmt->relation->inh, lockmode, context); @@ -8123,6 +8196,13 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, errmsg("referenced relation \"%s\" is not a table", RelationGetRelationName(pkrel)))); + /* global temp table not support foreign key constraint yet */ + if (RELATION_IS_GLOBAL_TEMP(pkrel)) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("referenced relation \"%s\" is not a global temp table", + RelationGetRelationName(pkrel)))); + if (!allowSystemTableMods && IsSystemRelation(pkrel)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -8162,6 +8242,12 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("constraints on temporary tables must involve temporary tables of this session"))); break; + /* global temp table not support foreign key constraint yet */ + case RELPERSISTENCE_GLOBAL_TEMP: + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("not support foreign key constraints on global temp table yet"))); + break; } /* @@ -13199,7 +13285,7 @@ index_copy_data(Relation rel, RelFileNode newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, @@ -14606,7 +14692,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged) */ switch (rel->rd_rel->relpersistence) { + /* global temp table same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("cannot change logged status of table \"%s\" because it is temporary", @@ -17246,3 +17334,20 @@ ATDetachCheckNoForeignKeyRefs(Relation partition) table_close(rel, NoLock); } } + +static bool +has_oncommit_option(List *options) +{ + ListCell *listptr; + + foreach(listptr, options) + { + DefElem *def = (DefElem *) lfirst(listptr); + + if (pg_strcasecmp(def->defname, "on_commit_delete_rows") == 0) + return true; + } + + return false; +} + diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index d625d17..69ad24f 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -35,6 +35,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/defrem.h" #include "commands/vacuum.h" @@ -1217,6 +1218,17 @@ vac_update_relstats(Relation relation, HeapTuple ctup; Form_pg_class pgcform; bool dirty; + bool is_gtt = false; + + /* global temp table remember relstats to localhash and rel->rd_rel, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(relation)) + { + is_gtt = true; + up_gtt_relstats(relation, + num_pages, num_tuples, + num_all_visible_pages, + frozenxid, minmulti); + } rd = table_open(RelationRelationId, RowExclusiveLock); @@ -1230,17 +1242,26 @@ vac_update_relstats(Relation relation, /* Apply statistical updates, if any, to copied tuple */ dirty = false; - if (pgcform->relpages != (int32) num_pages) + + if (is_gtt) + relation->rd_rel->relpages = (int32) num_pages; + else if (pgcform->relpages != (int32) num_pages) { pgcform->relpages = (int32) num_pages; dirty = true; } - if (pgcform->reltuples != (float4) num_tuples) + + if (is_gtt) + relation->rd_rel->reltuples = (float4) num_tuples; + else if (pgcform->reltuples != (float4) num_tuples) { pgcform->reltuples = (float4) num_tuples; dirty = true; } - if (pgcform->relallvisible != (int32) num_all_visible_pages) + + if (is_gtt) + relation->rd_rel->relallvisible = (int32) num_all_visible_pages; + else if (pgcform->relallvisible != (int32) num_all_visible_pages) { pgcform->relallvisible = (int32) num_all_visible_pages; dirty = true; @@ -1285,7 +1306,8 @@ vac_update_relstats(Relation relation, * This should match vac_update_datfrozenxid() concerning what we consider * to be "in the future". */ - if (TransactionIdIsNormal(frozenxid) && + if (!is_gtt && + TransactionIdIsNormal(frozenxid) && pgcform->relfrozenxid != frozenxid && (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || TransactionIdPrecedes(ReadNewTransactionId(), @@ -1296,7 +1318,8 @@ vac_update_relstats(Relation relation, } /* Similarly for relminmxid */ - if (MultiXactIdIsValid(minmulti) && + if (!is_gtt && + MultiXactIdIsValid(minmulti) && pgcform->relminmxid != minmulti && (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) @@ -1394,6 +1417,10 @@ vac_update_datfrozenxid(void) continue; } + /* global temp table relstats not in pg_class */ + if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + continue; + /* * Some table AMs might not need per-relation xid / multixid horizons. * It therefore seems reasonable to allow relfrozenxid and relminmxid @@ -1451,6 +1478,25 @@ vac_update_datfrozenxid(void) Assert(TransactionIdIsNormal(newFrozenXid)); Assert(MultiXactIdIsValid(newMinMulti)); + /* + * Global temp table get frozenxid from MyProc + * to avoid the vacuum truncate clog that gtt need. + */ + if (max_active_gtt > 0) + { + TransactionId oldest_gtt_frozenxid = + list_all_session_gtt_frozenxids(0, NULL, NULL, NULL); + + if (TransactionIdIsNormal(oldest_gtt_frozenxid) && + TransactionIdPrecedes(oldest_gtt_frozenxid, newFrozenXid)) + { + ereport(WARNING, + (errmsg("global temp table oldest FrozenXid is far in the past"), + errhint("please truncate them or kill those sessions that use them."))); + newFrozenXid = oldest_gtt_frozenxid; + } + } + /* Now fetch the pg_database tuple we need to update. */ relation = table_open(DatabaseRelationId, RowExclusiveLock); diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index ee5c3a6..0d7a2d4 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -787,6 +787,9 @@ ExecCheckXactReadOnly(PlannedStmt *plannedstmt) if (isTempNamespace(get_rel_namespace(rte->relid))) continue; + if (get_rel_persistence(rte->relid) == RELPERSISTENCE_GLOBAL_TEMP) + continue; + PreventCommandIfReadOnly(CreateCommandTag((Node *) plannedstmt)); } diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 8286d9c..c3992a4 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -591,6 +591,8 @@ static void set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) { + char relpersistence; + /* * The flag has previously been initialized to false, so we can just * return if it becomes clear that we can't safely set it. @@ -618,7 +620,11 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, * the rest of the necessary infrastructure right now anyway. So * for now, bail out if we see a temporary table. */ - if (get_rel_persistence(rte->relid) == RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + relpersistence = get_rel_persistence(rte->relid); + + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) return; /* diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index d6f2153..310a9e2 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -6312,7 +6312,9 @@ plan_create_index_workers(Oid tableOid, Oid indexOid) * Furthermore, any index predicate or index expressions must be parallel * safe. */ + /* global temp table is same as local temp table */ if (heap->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + heap->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP || !is_parallel_safe(root, (Node *) RelationGetIndexExpressions(index)) || !is_parallel_safe(root, (Node *) RelationGetIndexPredicate(index))) { diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 748bebf..a5ddbcd 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2579,6 +2579,11 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("materialized views must not use temporary tables or views"))); + if (is_query_using_gtt(query)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialized views must not use global temporary tables or views"))); + /* * A materialized view would either need to save parameters for use in * maintaining/loading the data or prohibit them entirely. The latter diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 1b0edf5..492639f 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3290,17 +3290,11 @@ OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; } | LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; } | GLOBAL TEMPORARY { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; } | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; } @@ -11591,19 +11585,13 @@ OptTempTableName: } | GLOBAL TEMPORARY opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED opt_table qualified_name { diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index b875a50..123945b 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -81,6 +81,7 @@ static void expandTupleDesc(TupleDesc tupdesc, Alias *eref, List **colnames, List **colvars); static int specialAttNum(const char *attname); static bool isQueryUsingTempRelation_walker(Node *node, void *context); +static bool is_query_using_gtt_walker(Node *node, void *context); /* @@ -3579,3 +3580,49 @@ isQueryUsingTempRelation_walker(Node *node, void *context) isQueryUsingTempRelation_walker, context); } + +/* check if the query uses global temp table */ +static bool +is_query_using_gtt_walker(Node *node, void *context) +{ + if (node == NULL) + return false; + + if (IsA(node, Query)) + { + Query *query = (Query *) node; + ListCell *rtable; + + foreach(rtable, query->rtable) + { + RangeTblEntry *rte = lfirst(rtable); + + if (rte->rtekind == RTE_RELATION) + { + Relation rel = relation_open(rte->relid, AccessShareLock); + char relpersistence = rel->rd_rel->relpersistence; + + relation_close(rel, AccessShareLock); + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + return true; + } + } + + return query_tree_walker(query, + is_query_using_gtt_walker, + context, + QTW_IGNORE_JOINALIASES); + } + + return expression_tree_walker(node, + is_query_using_gtt_walker, + context); +} + +/* check if the query uses global temp table */ +bool +is_query_using_gtt(Query *query) +{ + return is_query_using_gtt_walker((Node *) query, NULL); +} + diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index ee2d2b5..9c9abaa 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -437,6 +437,9 @@ generateSerialExtraStmts(CreateStmtContext *cxt, ColumnDef *column, seqstmt->sequence = makeRangeVar(snamespace, sname, -1); seqstmt->options = seqoptions; + if (cxt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + seqstmt->sequence->relpersistence = cxt->relation->relpersistence; + /* * If a sequence data type was specified, add it to the options. Prepend * to the list rather than append; in case a user supplied their own AS diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 6d1f28c..ed837d1 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2086,6 +2086,11 @@ do_autovacuum(void) } continue; } + else if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + /* autovacuum skip vacuum global temp table */ + continue; + } /* Fetch reloptions and the pgstat entry for this table */ relopts = extract_autovac_opts(tuple, pg_class_desc); @@ -2152,7 +2157,9 @@ do_autovacuum(void) /* * We cannot safely process other backends' temp tables, so skip 'em. */ - if (classForm->relpersistence == RELPERSISTENCE_TEMP) + /* autovacuum skip vacuum global temp table */ + if (classForm->relpersistence == RELPERSISTENCE_TEMP || + classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) continue; relid = classForm->oid; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index aba3960..3c4b96c 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -37,6 +37,7 @@ #include "access/xlog.h" #include "catalog/catalog.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "executor/instrument.h" #include "lib/binaryheap.h" #include "miscadmin.h" @@ -52,6 +53,7 @@ #include "utils/rel.h" #include "utils/resowner_private.h" #include "utils/timestamp.h" +#include "utils/guc.h" /* Note: these two macros only work on shared buffers, not local ones! */ @@ -432,7 +434,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref) static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, - bool *hit); + bool *hit, Relation rel); static bool PinBuffer(BufferDesc *buf, BufferAccessStrategy strategy); static void PinBuffer_Locked(BufferDesc *buf); static void UnpinBuffer(BufferDesc *buf, bool fixOwner); @@ -664,7 +666,8 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, */ pgstat_count_buffer_read(reln); buf = ReadBuffer_common(reln->rd_smgr, reln->rd_rel->relpersistence, - forkNum, blockNum, mode, strategy, &hit); + forkNum, blockNum, mode, strategy, &hit, + reln); if (hit) pgstat_count_buffer_hit(reln); return buf; @@ -692,7 +695,7 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, Assert(InRecovery); return ReadBuffer_common(smgr, RELPERSISTENCE_PERMANENT, forkNum, blockNum, - mode, strategy, &hit); + mode, strategy, &hit, NULL); } @@ -704,7 +707,8 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, - BufferAccessStrategy strategy, bool *hit) + BufferAccessStrategy strategy, bool *hit, + Relation rel) { BufferDesc *bufHdr; Block bufBlock; @@ -719,6 +723,15 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, isExtend = (blockNum == P_NEW); + /* create storage when first read data page for gtt */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (isExtend || blockNum == 0) && + forkNum == MAIN_FORKNUM && + !gtt_storage_attached(smgr->smgr_rnode.node.relNode)) + { + RelationCreateStorage(smgr->smgr_rnode.node, relpersistence, rel); + } + TRACE_POSTGRESQL_BUFFER_READ_START(forkNum, blockNum, smgr->smgr_rnode.node.spcNode, smgr->smgr_rnode.node.dbNode, @@ -2809,6 +2822,16 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln) BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum) { + /* + * When this backend not init gtt storage + * return 0 + */ + if (RELATION_IS_GLOBAL_TEMP(relation) && + !gtt_storage_attached(relation->rd_node.relNode)) + { + return 0; + } + switch (relation->rd_rel->relkind) { case RELKIND_SEQUENCE: diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c index 427b0d5..7adb969 100644 --- a/src/backend/storage/ipc/ipci.c +++ b/src/backend/storage/ipc/ipci.c @@ -21,6 +21,7 @@ #include "access/nbtree.h" #include "access/subtrans.h" #include "access/twophase.h" +#include "catalog/storage_gtt.h" #include "commands/async.h" #include "miscadmin.h" #include "pgstat.h" @@ -147,6 +148,7 @@ CreateSharedMemoryAndSemaphores(void) size = add_size(size, BTreeShmemSize()); size = add_size(size, SyncScanShmemSize()); size = add_size(size, AsyncShmemSize()); + size = add_size(size, active_gtt_shared_hash_size()); #ifdef EXEC_BACKEND size = add_size(size, ShmemBackendArraySize()); #endif @@ -217,6 +219,8 @@ CreateSharedMemoryAndSemaphores(void) SUBTRANSShmemInit(); MultiXactShmemInit(); InitBufferPool(); + /* global temporary table */ + active_gtt_shared_hash_init(); /* * Set up lock manager diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index c3adb2e..eb95e5f 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -62,6 +62,7 @@ #include "utils/builtins.h" #include "utils/rel.h" #include "utils/snapmgr.h" +#include "utils/guc.h" #define UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) @@ -4087,3 +4088,77 @@ KnownAssignedXidsReset(void) LWLockRelease(ProcArrayLock); } + +/* + * search all active backend to get oldest frozenxid + * for global temp table. + */ +int +list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n) +{ + ProcArrayStruct *arrayP = procArray; + TransactionId result = InvalidTransactionId; + int index; + int flags = 0; + int i = 0; + + if (max_active_gtt <= 0) + return 0; + + if (max_size > 0) + { + Assert(pids); + Assert(xids); + Assert(n); + *n = 0; + } + + if (max_active_gtt <= 0) + return InvalidTransactionId; + + if (RecoveryInProgress()) + return InvalidTransactionId; + + flags |= PROC_IS_AUTOVACUUM; + flags |= PROC_IN_LOGICAL_DECODING; + + LWLockAcquire(ProcArrayLock, LW_SHARED); + if (max_size > 0 && max_size < arrayP->numProcs) + { + LWLockRelease(ProcArrayLock); + elog(ERROR, "list_all_gtt_frozenxids require more array"); + } + + for (index = 0; index < arrayP->numProcs; index++) + { + int pgprocno = arrayP->pgprocnos[index]; + volatile PGPROC *proc = &allProcs[pgprocno]; + volatile PGXACT *pgxact = &allPgXact[pgprocno]; + + if (pgxact->vacuumFlags & flags) + continue; + + if (proc->databaseId == MyDatabaseId && + TransactionIdIsNormal(proc->session_gtt_frozenxid)) + { + if (result == InvalidTransactionId) + result = proc->session_gtt_frozenxid; + else if (TransactionIdPrecedes(proc->session_gtt_frozenxid, result)) + result = proc->session_gtt_frozenxid; + + if (max_size > 0) + { + pids[i] = proc->pid; + xids[i] = proc->session_gtt_frozenxid; + i++; + } + } + } + LWLockRelease(ProcArrayLock); + + if (max_size > 0) + *n = i; + + return result; +} + diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 32df8c8..e4e1125 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -395,6 +395,7 @@ InitProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; @@ -577,6 +578,7 @@ InitAuxiliaryProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index c5b771c..e7725ce 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -646,6 +646,12 @@ mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, */ if (zero_damaged_pages || InRecovery) MemSet(buffer, 0, BLCKSZ); + else if(SmgrIsTemp(reln) && blocknum == 0 && forknum == MAIN_FORKNUM) + { + /* global temp table init btree meta page */ + MemSet(buffer, 0, BLCKSZ); + mdwrite(reln, forknum, blocknum, buffer, true); + } else ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c index 8406644..0d99321 100644 --- a/src/backend/utils/adt/dbsize.c +++ b/src/backend/utils/adt/dbsize.c @@ -1008,6 +1008,9 @@ pg_relation_filepath(PG_FUNCTION_ARGS) Assert(backend != InvalidBackendId); } break; + case RELPERSISTENCE_GLOBAL_TEMP: + backend = BackendIdForTempRelations(); + break; default: elog(ERROR, "invalid relpersistence: %c", relform->relpersistence); backend = InvalidBackendId; /* placate compiler */ diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 7c6f057..eb10cf2 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -112,6 +112,7 @@ #include "catalog/pg_operator.h" #include "catalog/pg_statistic.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "executor/nodeAgg.h" #include "miscadmin.h" #include "nodes/makefuncs.h" @@ -4578,12 +4579,25 @@ examine_variable(PlannerInfo *root, Node *node, int varRelid, } else if (index->indpred == NIL) { - vardata->statsTuple = - SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(index->indexoid), - Int16GetDatum(pos + 1), - BoolGetDatum(false)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(index->indexoid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = + get_gtt_att_statistic(index->indexoid, + Int16GetDatum(pos + 1), + false); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + vardata->statsTuple = + SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(index->indexoid), + Int16GetDatum(pos + 1), + BoolGetDatum(false)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -4708,15 +4722,27 @@ examine_simple_variable(PlannerInfo *root, Var *var, } else if (rte->rtekind == RTE_RELATION) { - /* - * Plain table or parent of an inheritance appendrel, so look up the - * column in pg_statistic - */ - vardata->statsTuple = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(rte->relid), - Int16GetDatum(var->varattno), - BoolGetDatum(rte->inh)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(rte->relid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = get_gtt_att_statistic(rte->relid, + var->varattno, + rte->inh); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + /* + * Plain table or parent of an inheritance appendrel, so look up the + * column in pg_statistic + */ + vardata->statsTuple = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(rte->relid), + Int16GetDatum(var->varattno), + BoolGetDatum(rte->inh)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -6098,6 +6124,7 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, { /* Simple variable --- look to stats for the underlying table */ RangeTblEntry *rte = planner_rt_fetch(index->rel->relid, root); + char rel_persistence = get_rel_persistence(rte->relid); Assert(rte->rtekind == RTE_RELATION); relid = rte->relid; @@ -6115,6 +6142,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + rte->inh); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -6126,6 +6160,8 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* Expression --- maybe there are stats for the index itself */ relid = index->indexoid; colnum = 1; @@ -6141,6 +6177,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -7054,6 +7097,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, /* attempt to lookup stats in relation for this index column */ if (attnum != 0) { + char rel_persistence = get_rel_persistence(rte->relid); + /* Simple variable -- look to stats for the underlying table */ if (get_relation_stats_hook && (*get_relation_stats_hook) (root, rte, attnum, &vardata)) @@ -7066,6 +7111,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(rte->relid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = @@ -7078,6 +7131,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* * Looks like we've found an expression column in the index. Let's * see if there's any stats for it. @@ -7097,6 +7152,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(index->indexoid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 1e3e6d3..345e3e9 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -34,6 +34,7 @@ #include "catalog/pg_statistic.h" #include "catalog/pg_transform.h" #include "catalog/pg_type.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "utils/array.h" @@ -2878,6 +2879,18 @@ get_attavgwidth(Oid relid, AttrNumber attnum) if (stawidth > 0) return stawidth; } + if (get_rel_persistence(relid) == RELPERSISTENCE_GLOBAL_TEMP) + { + tp = get_gtt_att_statistic(relid, attnum, false); + if (!HeapTupleIsValid(tp)) + return 0; + + stawidth = ((Form_pg_statistic) GETSTRUCT(tp))->stawidth; + if (stawidth > 0) + return stawidth; + else + return 0; + } tp = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(relid), Int16GetDatum(attnum), diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index df025a5..8df9c7c 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -63,6 +63,7 @@ #include "catalog/pg_type.h" #include "catalog/schemapg.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/policy.h" #include "commands/trigger.h" #include "miscadmin.h" @@ -1124,6 +1125,29 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) relation->rd_islocaltemp = false; } break; + case RELPERSISTENCE_GLOBAL_TEMP: + { + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + + relation->rd_backend = BackendIdForTempRelations(); + /* + * For global temp table, all backend can use + * this relation, so rd_islocaltemp is true + * in every backend. + */ + relation->rd_islocaltemp = true; + get_gtt_relstats(RelationGetRelid(relation), + &relpages, + &reltuples, + &relallvisible, + NULL, NULL); + relation->rd_rel->relpages = (int32)relpages; + relation->rd_rel->reltuples = (float4)reltuples; + relation->rd_rel->relallvisible = (int32)relallvisible; + } + break; default: elog(ERROR, "invalid relpersistence: %c", relation->rd_rel->relpersistence); @@ -1178,6 +1202,7 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) case RELKIND_PARTITIONED_INDEX: Assert(relation->rd_rel->relam != InvalidOid); RelationInitIndexAccessInfo(relation); + gtt_fix_index_state(relation); break; case RELKIND_RELATION: case RELKIND_TOASTVALUE: @@ -2217,6 +2242,8 @@ RelationReloadIndexInfo(Relation relation) HeapTupleHeaderGetXmin(tuple->t_data)); ReleaseSysCache(tuple); + + gtt_fix_index_state(relation); } /* Okay, now it's valid again */ @@ -3313,6 +3340,15 @@ RelationBuildLocalRelation(const char *relname, rel->rd_backend = BackendIdForTempRelations(); rel->rd_islocaltemp = true; break; + case RELPERSISTENCE_GLOBAL_TEMP: + rel->rd_backend = BackendIdForTempRelations(); + /* + * For global temp table, all backend can use + * this relation, so rd_islocaltemp is true + * in every backend. + */ + rel->rd_islocaltemp = true; + break; default: elog(ERROR, "invalid relpersistence: %c", relpersistence); break; @@ -3427,6 +3463,9 @@ RelationSetNewRelfilenode(Relation relation, char persistence) TransactionId freezeXid = InvalidTransactionId; RelFileNode newrnode; + if (RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "global temp table does not allow setting new relfilenode"); + /* Allocate a new relfilenode */ newrelfilenode = GetNewRelFileNode(relation->rd_rel->reltablespace, NULL, persistence); @@ -3467,7 +3506,7 @@ RelationSetNewRelfilenode(Relation relation, char persistence) /* handle these directly, at least for now */ SMgrRelation srel; - srel = RelationCreateStorage(newrnode, persistence); + srel = RelationCreateStorage(newrnode, persistence, relation); smgrclose(srel); } break; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index cacbe90..9c4220b 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -140,6 +140,18 @@ char *GUC_check_errmsg_string; char *GUC_check_errdetail_string; char *GUC_check_errhint_string; +/* + * num = 0 means disable global temp table feature. + * global temp table define can still storage in catalog + * just can not use. + * num > 0 means database can management num active global temp table. + */ +#define MIN_NUM_ACTIVE_GTT 0 +#define DEFAULT_NUM_ACTIVE_GTT 1000 +#define MAX_NUM_ACTIVE_GTT 1000000 + +int max_active_gtt = MIN_NUM_ACTIVE_GTT; + static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3, 4); static void set_config_sourcefile(const char *name, char *sourcefile, @@ -2012,6 +2024,15 @@ static struct config_bool ConfigureNamesBool[] = static struct config_int ConfigureNamesInt[] = { { + {"max_active_global_temporary_table", PGC_POSTMASTER, UNGROUPED, + gettext_noop("max active global temporary table."), + NULL + }, + &max_active_gtt, + DEFAULT_NUM_ACTIVE_GTT, MIN_NUM_ACTIVE_GTT, MAX_NUM_ACTIVE_GTT, + NULL, NULL, NULL + }, + { {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Forces a switch to the next WAL file if a " "new file has not been started within N seconds."), diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index ec3e2c6..d3697d2 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15583,6 +15583,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) { char *ftoptions = NULL; char *srvname = NULL; + char *table_type = NULL; switch (tbinfo->relkind) { @@ -15634,9 +15635,15 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) binary_upgrade_set_pg_class_oids(fout, q, tbinfo->dobj.catId.oid, false); + if (tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED) + table_type = "UNLOGGED "; + else if (tbinfo->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + table_type = "GLOBAL TEMPORARY "; + else + table_type = ""; + appendPQExpBuffer(q, "CREATE %s%s %s", - tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ? - "UNLOGGED " : "", + table_type, reltypename, qualrelname); diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index f3c7eb9..28134e2 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3723,7 +3723,8 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys if (pset.sversion >= 90100) { appendPQExpBuffer(&buf, - ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + ",\n CASE c.relpersistence WHEN 'g' THEN '%s' WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + gettext_noop("session"), gettext_noop("permanent"), gettext_noop("temporary"), gettext_noop("unlogged"), diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index dc03fbd..8bd6d09 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -1016,6 +1016,8 @@ static const pgsql_thing_t words_after_create[] = { {"FOREIGN TABLE", NULL, NULL, NULL}, {"FUNCTION", NULL, NULL, Query_for_list_of_functions}, {"GROUP", Query_for_list_of_roles}, + {"GLOBAL", NULL, NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE GLOBAL TEMP/TEMPORARY TABLE + * ... */ {"INDEX", NULL, NULL, &Query_for_list_of_indexes}, {"LANGUAGE", Query_for_list_of_languages}, {"LARGE OBJECT", NULL, NULL, NULL, THING_NO_CREATE | THING_NO_DROP}, @@ -2378,6 +2380,9 @@ psql_completion(const char *text, int start, int end) /* CREATE FOREIGN DATA WRAPPER */ else if (Matches("CREATE", "FOREIGN", "DATA", "WRAPPER", MatchAny)) COMPLETE_WITH("HANDLER", "VALIDATOR", "OPTIONS"); + /* CREATE GLOBAL TEMP/TEMPORARY*/ + else if (Matches("CREATE", "GLOBAL")) + COMPLETE_WITH("TEMP", "TEMPORARY"); /* CREATE INDEX --- is allowed inside CREATE SCHEMA, so use TailMatches */ /* First off we complete CREATE UNIQUE with "INDEX" */ @@ -2586,6 +2591,8 @@ psql_completion(const char *text, int start, int end) /* Complete "CREATE TEMP/TEMPORARY" with the possible temp objects */ else if (TailMatches("CREATE", "TEMP|TEMPORARY")) COMPLETE_WITH("SEQUENCE", "TABLE", "VIEW"); + else if (TailMatches("CREATE", "GLOBAL", "TEMP|TEMPORARY")) + COMPLETE_WITH("TABLE"); /* Complete "CREATE UNLOGGED" with TABLE or MATVIEW */ else if (TailMatches("CREATE", "UNLOGGED")) COMPLETE_WITH("TABLE", "MATERIALIZED VIEW"); diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index a12fc1f..78958e4 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -165,6 +165,7 @@ typedef FormData_pg_class *Form_pg_class; #define RELPERSISTENCE_PERMANENT 'p' /* regular table */ #define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */ #define RELPERSISTENCE_TEMP 't' /* temporary table */ +#define RELPERSISTENCE_GLOBAL_TEMP 'g' /* global temporary table */ /* default selection for replica identity (primary key or nothing) */ #define REPLICA_IDENTITY_DEFAULT 'd' diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 2228256..4d5d13a 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5504,6 +5504,40 @@ proparallel => 'r', prorettype => 'float8', proargtypes => 'oid', prosrc => 'pg_stat_get_xact_function_self_time' }, +# For global temporary table +{ oid => '4191', + descr => 'List local statistics for global temporary table', + proname => 'pg_get_gtt_statistics', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid int4 anyelement', + proallargtypes => '{oid,int4,anyelement,oid,int2,bool,float4,int4,float4,int2,int2,int2,int2,int2,oid,oid,oid,oid,oid,oid,oid,oid,oid,oid,_float4,_float4,_float4,_float4,_float4,anyarray,anyarray,anyarray,anyarray,anyarray}', + proargmodes => '{i,i,i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}', + proargnames => '{relid,att,x,starelid,staattnum,stainherit,stanullfrac,stawidth,stadistinct,stakind1,stakind2,stakind3,stakind4,stakind5,staop1,staop2,staop3,staop4,staop5,stacoll1,stacoll2,stacoll3,stacoll4,stacoll5,stanumbers1,stanumbers2,stanumbers3,stanumbers4,stanumbers5,stavalues1,stavalues2,stavalues3,stavalues4,stavalues5}', + prosrc => 'pg_get_gtt_statistics' }, +{ oid => '4192', + descr => 'List local relstats for global temporary table', + proname => 'pg_get_gtt_relstats', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,int4,float4,int4,xid,xid}', + proargmodes => '{i,o,o,o,o,o}', + proargnames => '{relid,relpages,reltuples,relallvisible,relfrozenxid,relminmxid}', + prosrc => 'pg_get_gtt_relstats' }, +{ oid => '4193', + descr => 'List attached pid for one global temporary table', + proname => 'pg_gtt_attached_pid', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,oid,int4}', + proargmodes => '{i,o,o}', + proargnames => '{relid,relid,pid}', + prosrc => 'pg_gtt_attached_pid' }, +{ oid => '4194', + descr => 'List those backends that have used global temporary table', + proname => 'pg_list_gtt_relfrozenxids', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => '', + proallargtypes => '{int4,xid}', + proargmodes => '{o,o}', + proargnames => '{pid,relfrozenxid}', + prosrc => 'pg_list_gtt_relfrozenxids' }, + { oid => '3788', descr => 'statistics: timestamp of the current statistics snapshot', proname => 'pg_stat_get_snapshot_timestamp', provolatile => 's', diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h index 048003c..af48cdf 100644 --- a/src/include/catalog/storage.h +++ b/src/include/catalog/storage.h @@ -19,7 +19,7 @@ #include "storage/smgr.h" #include "utils/relcache.h" -extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence); +extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel); extern void RelationDropStorage(Relation rel); extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit); extern void RelationTruncate(Relation rel, BlockNumber nblocks); diff --git a/src/include/catalog/storage_gtt.h b/src/include/catalog/storage_gtt.h new file mode 100644 index 0000000..aa80cb5 --- /dev/null +++ b/src/include/catalog/storage_gtt.h @@ -0,0 +1,41 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.h + * prototypes for functions in backend/catalog/storage_gtt.c + * + * src/include/catalog/storage_gtt.h + * + *------------------------------------------------------------------------- + */ +#ifndef STORAGE_GTT_H +#define STORAGE_GTT_H + +#include "access/htup.h" +#include "storage/block.h" +#include "storage/relfilenode.h" +#include "utils/relcache.h" + +extern Size active_gtt_shared_hash_size(void); +extern void active_gtt_shared_hash_init(void); +extern void remember_gtt_storage_info(RelFileNode rnode, Relation rel); +extern void forget_gtt_storage_info(Oid relid); +extern bool is_other_backend_use_gtt(RelFileNode node); +extern bool gtt_storage_attached(Oid relid); +extern Bitmapset *copy_active_gtt_bitmap(RelFileNode node); +extern void up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull); +extern HeapTuple get_gtt_att_statistic(Oid reloid, int attnum, bool inh); +extern void release_gtt_statistic_cache(HeapTuple tup); +extern void up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid); +extern bool get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid); +extern void gtt_force_enable_index(Relation index); +extern void gtt_fix_index_state(Relation index); + +#endif /* STORAGE_H */ diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index 93f9446..14cafae 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -120,4 +120,7 @@ extern Oid attnumTypeId(Relation rd, int attid); extern Oid attnumCollationId(Relation rd, int attid); extern bool isQueryUsingTempRelation(Query *query); +/* global temp table check */ +extern bool is_query_using_gtt(Query *query); + #endif /* PARSE_RELATION_H */ diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 870ecb5..92c590e 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -405,6 +405,8 @@ do { \ #define PageClearPrunable(page) \ (((PageHeader) (page))->pd_prune_xid = InvalidTransactionId) +#define GlobalTempRelationPageIsNotInitialized(rel, page) \ + ((rel)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && PageIsNew(page)) /* ---------------------------------------------------------------- * extern declarations diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 8fda8e4..172eae9 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -220,6 +220,7 @@ typedef enum BuiltinTrancheIds LWTRANCHE_TBM, LWTRANCHE_PARALLEL_APPEND, LWTRANCHE_SXACT, + LWTRANCHE_GTT_CTL, LWTRANCHE_FIRST_USER_DEFINED } BuiltinTrancheIds; diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index d217801..8adde87 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -117,6 +117,8 @@ struct PGPROC Oid tempNamespaceId; /* OID of temp schema this backend is * using */ + TransactionId session_gtt_frozenxid; /* session level global temp table relfrozenxid */ + bool isBackgroundWorker; /* true if background worker. */ /* diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index a5c7d0c..a86f61f 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -125,4 +125,6 @@ extern void ProcArraySetReplicationSlotXmin(TransactionId xmin, extern void ProcArrayGetReplicationSlotXmin(TransactionId *xmin, TransactionId *catalog_xmin); +extern int list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n); + #endif /* PROCARRAY_H */ diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index ce93ace..0f7262e 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -281,6 +281,10 @@ extern int tcp_user_timeout; extern bool trace_sort; #endif +/* global temporary table */ +extern int max_active_gtt; +/* end */ + /* * Functions exported by guc.c */ diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 44ed04d..b308cb8 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -57,7 +57,7 @@ typedef struct RelationData struct SMgrRelationData *rd_smgr; /* cached file handle, or NULL */ int rd_refcnt; /* reference count */ BackendId rd_backend; /* owning backend id, if temporary relation */ - bool rd_islocaltemp; /* rel is a temp rel of this session */ + bool rd_islocaltemp; /* rel is a temp rel of this session */ bool rd_isnailed; /* rel is nailed in cache */ bool rd_isvalid; /* relcache entry is valid */ bool rd_indexvalid; /* is rd_indexlist valid? (also rd_pkindex and @@ -277,6 +277,7 @@ typedef struct StdRdOptions int parallel_workers; /* max number of parallel workers */ bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */ bool vacuum_truncate; /* enables vacuum to truncate a relation */ + bool on_commit_delete_rows; /* global temp table */ } StdRdOptions; #define HEAP_MIN_FILLFACTOR 10 @@ -535,11 +536,13 @@ typedef struct ViewOptions * True if relation's pages are stored in local buffers. */ #define RelationUsesLocalBuffers(relation) \ - ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP || \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) /* * RELATION_IS_LOCAL - * If a rel is either temp or newly created in the current transaction, + * If a rel is either local temp or global temp relation + * or newly created in the current transaction, * it can be assumed to be accessible only to the current backend. * This is typically used to decide that we can skip acquiring locks. * @@ -602,6 +605,17 @@ typedef struct ViewOptions RelationNeedsWAL(relation) && \ !IsCatalogRelation(relation)) +/* global temp table implementations */ +#define RELATION_IS_GLOBAL_TEMP(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + +#define RELATION_GTT_ON_COMMIT_DELETE(relation) \ + ((relation)->rd_options && \ + ((relation)->rd_rel->relkind == RELKIND_RELATION || (relation)->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) && \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP ? \ + ((StdRdOptions *) (relation)->rd_options)->on_commit_delete_rows : false) + +#define RelationGetRelPersistence(relation) ((relation)->rd_rel->relpersistence) + /* routines in utils/cache/relcache.c */ extern void RelationIncrementReferenceCount(Relation rel); extern void RelationDecrementReferenceCount(Relation rel); diff --git a/src/test/regress/expected/gtt_clean.out b/src/test/regress/expected/gtt_clean.out new file mode 100644 index 0000000..50ca9ac --- /dev/null +++ b/src/test/regress/expected/gtt_clean.out @@ -0,0 +1,7 @@ +reset search_path; +drop schema gtt cascade; +NOTICE: drop cascades to 4 other objects +DETAIL: drop cascades to table gtt.gtt1 +drop cascades to table gtt.gtt2 +drop cascades to table gtt.gtt3 +drop cascades to table gtt.gtt_t_kenyon diff --git a/src/test/regress/expected/gtt_function.out b/src/test/regress/expected/gtt_function.out new file mode 100644 index 0000000..e21e540 --- /dev/null +++ b/src/test/regress/expected/gtt_function.out @@ -0,0 +1,282 @@ +CREATE SCHEMA IF NOT EXISTS gtt_function; +set search_path=gtt_function,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt_test_rename(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); +ERROR: cannot create indexes on global temporary tables using concurrent mode +-- ERROR +cluster gtt1 using gtt1_pkey; +ERROR: not support cluster global temporary tables yet +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; +ERROR: ON COMMIT can only be used on temporary tables +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); +ERROR: regular table cannot specifie on_commit_delete_rows +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; + count +------- + 2 +(1 row) + +commit; +select count(*) from p_table01; + count +------- + 0 +(1 row) + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +ERROR: The parent table must be global temporary table +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + relname | relkind | relpersistence | reloptions +---------------------------------+---------+----------------+------------------------------- + p_table01 | p | g | {on_commit_delete_rows=true} + p_table01_2017 | r | g | {on_commit_delete_rows=true} + p_table01_2018 | r | g | {on_commit_delete_rows=true} + p_table01_id_seq | S | g | + p_table02 | p | g | {on_commit_delete_rows=false} + p_table02_2017 | r | g | {on_commit_delete_rows=false} + p_table02_2018 | r | g | {on_commit_delete_rows=false} + p_table02_id_seq | S | g | + tbl_inherits_parent | r | p | + tbl_inherits_parent_global_temp | r | g | {on_commit_delete_rows=true} + tbl_inherits_partition | r | g | {on_commit_delete_rows=true} +(11 rows) + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; +ERROR: global temp table not support on commit drop clause +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; +ERROR: can not defeine global temp table with on commit and with clause at same time +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); +--ok +alter table gtt_test_rename rename to gtt_test; +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; + id | a +----+--- + 2 | 1 + 3 | 2 +(2 rows) + +truncate gtt_seq; +select * from gtt_seq order by id; + id | a +----+--- +(0 rows) + +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + id | a +----+--- + 4 | 3 +(1 row) + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; +ERROR: materialized views must not use global temporary tables or views +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +ERROR: only support btree index on global temp table +create index idx_err on gtt1 using gist (a); +ERROR: data type integer has no default operator class for access method "gist" +HINT: You must specify an operator class for the index or define a default operator class for the data type. +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +ERROR: only support btree index on global temp table +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); +ERROR: only support btree index on global temp table +--ok +create global temp table gt (a SERIAL,b int); +begin; +set transaction_read_only = true; +insert into gt (b) values(1); +select * from gt; + a | b +---+--- + 1 | 1 +(1 row) + +commit; +--ok +create global temp table gt1(a int); +insert into gt1 values(generate_series(1,100000)); +create index idx_gt1_1 on gt1 (a); +create index idx_gt1_2 on gt1((a + 1)); +create index idx_gt1_3 on gt1((a*10),(a+a),(a-1)); +explain select * from gt1 where a=1; + QUERY PLAN +--------------------------------------------------------------------------- + Bitmap Heap Scan on gt1 (cost=12.17..482.50 rows=500 width=4) + Recheck Cond: (a = 1) + -> Bitmap Index Scan on idx_gt1_1 (cost=0.00..12.04 rows=500 width=0) + Index Cond: (a = 1) +(4 rows) + +explain select * from gt1 where a=200000; + QUERY PLAN +--------------------------------------------------------------------------- + Bitmap Heap Scan on gt1 (cost=12.17..482.50 rows=500 width=4) + Recheck Cond: (a = 200000) + -> Bitmap Index Scan on idx_gt1_1 (cost=0.00..12.04 rows=500 width=0) + Index Cond: (a = 200000) +(4 rows) + +explain select * from gt1 where a*10=300; + QUERY PLAN +--------------------------------------------------------------------------- + Bitmap Heap Scan on gt1 (cost=12.29..483.88 rows=500 width=4) + Recheck Cond: ((a * 10) = 300) + -> Bitmap Index Scan on idx_gt1_3 (cost=0.00..12.17 rows=500 width=0) + Index Cond: ((a * 10) = 300) +(4 rows) + +explain select * from gt1 where a*10=3; + QUERY PLAN +--------------------------------------------------------------------------- + Bitmap Heap Scan on gt1 (cost=12.29..483.88 rows=500 width=4) + Recheck Cond: ((a * 10) = 3) + -> Bitmap Index Scan on idx_gt1_3 (cost=0.00..12.17 rows=500 width=0) + Index Cond: ((a * 10) = 3) +(4 rows) + +analyze gt1; +explain select * from gt1 where a=1; + QUERY PLAN +-------------------------------------------------------------------------- + Index Only Scan using idx_gt1_1 on gt1 (cost=0.29..8.31 rows=1 width=4) + Index Cond: (a = 1) +(2 rows) + +explain select * from gt1 where a=200000; + QUERY PLAN +-------------------------------------------------------------------------- + Index Only Scan using idx_gt1_1 on gt1 (cost=0.29..8.31 rows=1 width=4) + Index Cond: (a = 200000) +(2 rows) + +explain select * from gt1 where a*10=300; + QUERY PLAN +--------------------------------------------------------------------- + Index Scan using idx_gt1_3 on gt1 (cost=0.42..8.44 rows=1 width=4) + Index Cond: ((a * 10) = 300) +(2 rows) + +explain select * from gt1 where a*10=3; + QUERY PLAN +--------------------------------------------------------------------- + Index Scan using idx_gt1_3 on gt1 (cost=0.42..8.44 rows=1 width=4) + Index Cond: ((a * 10) = 3) +(2 rows) + +reset search_path; +drop schema gtt_function cascade; +NOTICE: drop cascades to 17 other objects +DETAIL: drop cascades to table gtt_function.gtt1 +drop cascades to table gtt_function.gtt_test +drop cascades to table gtt_function.gtt2 +drop cascades to table gtt_function.gtt3 +drop cascades to table gtt_function.tmp_t0 +drop cascades to table gtt_function.tbl_inherits_parent +drop cascades to table gtt_function.tbl_inherits_parent_global_temp +drop cascades to table gtt_function.products +drop cascades to table gtt_function.measurement +drop cascades to table gtt_function.p_table01 +drop cascades to table gtt_function.p_table02 +drop cascades to table gtt_function.tbl_inherits_partition +drop cascades to table gtt_function.gtt5 +drop cascades to table gtt_function.mytable +drop cascades to table gtt_function.gtt_seq +drop cascades to table gtt_function.gt +drop cascades to table gtt_function.gt1 diff --git a/src/test/regress/expected/gtt_parallel_1.out b/src/test/regress/expected/gtt_parallel_1.out new file mode 100644 index 0000000..30d8a7b --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_1.out @@ -0,0 +1,84 @@ +set search_path=gtt,sys; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_parallel_2.out b/src/test/regress/expected/gtt_parallel_2.out new file mode 100644 index 0000000..850ef3e --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_2.out @@ -0,0 +1,161 @@ +set search_path=gtt,sys; +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +commit; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 + 3 | test1 +(3 rows) + +rollback; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test2 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; + a | b +---+------- + 3 | test3 +(1 row) + +rollback; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; + a | b +---+------- + 5 | test5 +(1 row) + +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + a | b +---+------- + 6 | test6 +(1 row) + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; + count +-------- + 100000 +(1 row) + +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + QUERY PLAN +------------------------------------ + Index Scan using gtt3_pkey on gtt3 + Index Cond: (a = 300) +(2 rows) + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; + relname | pg_relation_size | pg_relation_size | pg_table_size | pg_indexes_size | pg_total_relation_size +--------------+------------------+------------------+---------------+-----------------+------------------------ + gtt_t_kenyon | 450560 | 8192 | 499712 | 475136 | 974848 +(1 row) + +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + relname +-------------- + gtt_t_kenyon +(1 row) + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + relname | pg_relation_size | pg_table_size | pg_total_relation_size +--------------------+------------------+---------------+------------------------ + idx_gtt_t_kenyon_1 | 65536 | 65536 | 65536 + idx_gtt_t_kenyon_2 | 409600 | 409600 | 409600 +(2 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_prepare.out b/src/test/regress/expected/gtt_prepare.out new file mode 100644 index 0000000..9fe5fd4 --- /dev/null +++ b/src/test/regress/expected/gtt_prepare.out @@ -0,0 +1,9 @@ +CREATE SCHEMA IF NOT EXISTS gtt; +set search_path=gtt,sys; +create global temp table gtt1(a int primary key, b text) on commit delete rows; +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text); +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; diff --git a/src/test/regress/expected/gtt_stats.out b/src/test/regress/expected/gtt_stats.out new file mode 100644 index 0000000..b258b7c --- /dev/null +++ b/src/test/regress/expected/gtt_stats.out @@ -0,0 +1,76 @@ +CREATE SCHEMA IF NOT EXISTS gtt_stats; +set search_path=gtt_stats,sys; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +insert into gtt values(generate_series(1,10000),'test'); +-- expect 1 +select count(*) from pg_gtt_attached_pids; + count +------- + 1 +(1 row) + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 2 +(1 row) + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 0 | 0 | 0 +(1 row) + +-- expect 0 +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+------------------+-------------+-------------------+------------------------+---------------------- +(0 rows) + +analyze gtt; +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 55 | 10000 | 0 +(1 row) + +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------------------+------------------------+---------------------- + gtt_stats | gtt | a | f | 0 | 4 | -1 | | | {1,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,8700,8800,8900,9000,9100,9200,9300,9400,9500,9600,9700,9800,9900,10000} | 1 | | | + gtt_stats | gtt | b | f | 0 | 5 | 1 | {test} | {1} | | 1 | | | +(2 rows) + +reset search_path; +drop schema gtt_stats cascade; +NOTICE: drop cascades to table gtt_stats.gtt diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 2ab2115..4f4eb46 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1349,6 +1349,93 @@ pg_group| SELECT pg_authid.rolname AS groname, WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin); +pg_gtt_attached_pids| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relid, + s.pid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_gtt_attached_pid(c.oid) s(relid, pid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_relstats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relpages, + s.reltuples, + s.relallvisible, + s.relfrozenxid, + s.relminmxid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_relstats(c.oid) s(relpages, reltuples, relallvisible, relfrozenxid, relminmxid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_stats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN (s.stakind1 = 1) THEN s.stavalues1 + WHEN (s.stakind2 = 1) THEN s.stavalues2 + WHEN (s.stakind3 = 1) THEN s.stavalues3 + WHEN (s.stakind4 = 1) THEN s.stavalues4 + WHEN (s.stakind5 = 1) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_vals, + CASE + WHEN (s.stakind1 = 1) THEN s.stanumbers1 + WHEN (s.stakind2 = 1) THEN s.stanumbers2 + WHEN (s.stakind3 = 1) THEN s.stanumbers3 + WHEN (s.stakind4 = 1) THEN s.stanumbers4 + WHEN (s.stakind5 = 1) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_freqs, + CASE + WHEN (s.stakind1 = 2) THEN s.stavalues1 + WHEN (s.stakind2 = 2) THEN s.stavalues2 + WHEN (s.stakind3 = 2) THEN s.stavalues3 + WHEN (s.stakind4 = 2) THEN s.stavalues4 + WHEN (s.stakind5 = 2) THEN s.stavalues5 + ELSE NULL::text[] + END AS histogram_bounds, + CASE + WHEN (s.stakind1 = 3) THEN s.stanumbers1[1] + WHEN (s.stakind2 = 3) THEN s.stanumbers2[1] + WHEN (s.stakind3 = 3) THEN s.stanumbers3[1] + WHEN (s.stakind4 = 3) THEN s.stanumbers4[1] + WHEN (s.stakind5 = 3) THEN s.stanumbers5[1] + ELSE NULL::real + END AS correlation, + CASE + WHEN (s.stakind1 = 4) THEN s.stavalues1 + WHEN (s.stakind2 = 4) THEN s.stavalues2 + WHEN (s.stakind3 = 4) THEN s.stavalues3 + WHEN (s.stakind4 = 4) THEN s.stavalues4 + WHEN (s.stakind5 = 4) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_elems, + CASE + WHEN (s.stakind1 = 4) THEN s.stanumbers1 + WHEN (s.stakind2 = 4) THEN s.stanumbers2 + WHEN (s.stakind3 = 4) THEN s.stanumbers3 + WHEN (s.stakind4 = 4) THEN s.stanumbers4 + WHEN (s.stakind5 = 4) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_elem_freqs, + CASE + WHEN (s.stakind1 = 5) THEN s.stanumbers1 + WHEN (s.stakind2 = 5) THEN s.stanumbers2 + WHEN (s.stakind3 = 5) THEN s.stanumbers3 + WHEN (s.stakind4 = 5) THEN s.stanumbers4 + WHEN (s.stakind5 = 5) THEN s.stanumbers5 + ELSE NULL::real[] + END AS elem_count_histogram + FROM ((pg_class c + JOIN pg_attribute a ON ((c.oid = a.attrelid))) + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_statistics(c.oid, (a.attnum)::integer, ''::text) s(starelid, staattnum, stainherit, stanullfrac, stawidth, stadistinct, stakind1, stakind2, stakind3, stakind4, stakind5, staop1, staop2, staop3, staop4, staop5, stacoll1, stacoll2, stacoll3, stacoll4, stacoll5, stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5, stavalues1, stavalues2, stavalues3, stavalues4, stavalues5) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND (NOT a.attisdropped) AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); pg_hba_file_rules| SELECT a.line_number, a.type, a.database, diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index d2b17dd..80e577f 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -121,3 +121,10 @@ test: fast_default # run stats by itself because its delay may be insufficient under heavy load test: stats + +# global temp table test +test: gtt_stats +test: gtt_function +test: gtt_prepare +test: gtt_parallel_1 gtt_parallel_2 +test: gtt_clean diff --git a/src/test/regress/sql/gtt_clean.sql b/src/test/regress/sql/gtt_clean.sql new file mode 100644 index 0000000..f3cf710 --- /dev/null +++ b/src/test/regress/sql/gtt_clean.sql @@ -0,0 +1,6 @@ + + +reset search_path; + +drop schema gtt cascade; + diff --git a/src/test/regress/sql/gtt_function.sql b/src/test/regress/sql/gtt_function.sql new file mode 100644 index 0000000..784c537 --- /dev/null +++ b/src/test/regress/sql/gtt_function.sql @@ -0,0 +1,187 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_function; + +set search_path=gtt_function,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt_test_rename(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); + +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; + +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); + +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); + +-- ERROR +cluster gtt1 using gtt1_pkey; + +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; + +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); + +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); + +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; +commit; + +select count(*) from p_table01; + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; + +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; + +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; + +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; + +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); + +--ok +alter table gtt_test_rename rename to gtt_test; + +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); + +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; + +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; +truncate gtt_seq; +select * from gtt_seq order by id; +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; + +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +create index idx_err on gtt1 using gist (a); +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); + +--ok +create global temp table gt (a SERIAL,b int); +begin; +set transaction_read_only = true; +insert into gt (b) values(1); +select * from gt; +commit; + +--ok +create global temp table gt1(a int); +insert into gt1 values(generate_series(1,100000)); +create index idx_gt1_1 on gt1 (a); +create index idx_gt1_2 on gt1((a + 1)); +create index idx_gt1_3 on gt1((a*10),(a+a),(a-1)); +explain select * from gt1 where a=1; +explain select * from gt1 where a=200000; +explain select * from gt1 where a*10=300; +explain select * from gt1 where a*10=3; +analyze gt1; +explain select * from gt1 where a=1; +explain select * from gt1 where a=200000; +explain select * from gt1 where a*10=300; +explain select * from gt1 where a*10=3; + +reset search_path; + +drop schema gtt_function cascade; + diff --git a/src/test/regress/sql/gtt_parallel_1.sql b/src/test/regress/sql/gtt_parallel_1.sql new file mode 100644 index 0000000..d7d81de --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_1.sql @@ -0,0 +1,42 @@ + + +set search_path=gtt,sys; + +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +commit; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +rollback; +select * from gtt1 order by a; + +truncate gtt1; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +select * from gtt1 order by a; +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + +begin; +select * from gtt1 order by a; +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +commit; +select * from gtt1 order by a; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_parallel_2.sql b/src/test/regress/sql/gtt_parallel_2.sql new file mode 100644 index 0000000..5203c2b --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_2.sql @@ -0,0 +1,76 @@ + + +set search_path=gtt,sys; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; +commit; +select * from gtt3 order by a; + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +truncate gtt3; +select * from gtt3 order by a; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; +truncate gtt3; +select * from gtt3 order by a; +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +begin; +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_prepare.sql b/src/test/regress/sql/gtt_prepare.sql new file mode 100644 index 0000000..2f4d883 --- /dev/null +++ b/src/test/regress/sql/gtt_prepare.sql @@ -0,0 +1,16 @@ + +CREATE SCHEMA IF NOT EXISTS gtt; + +set search_path=gtt,sys; + +create global temp table gtt1(a int primary key, b text) on commit delete rows; + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text); + +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; + diff --git a/src/test/regress/sql/gtt_stats.sql b/src/test/regress/sql/gtt_stats.sql new file mode 100644 index 0000000..f041892 --- /dev/null +++ b/src/test/regress/sql/gtt_stats.sql @@ -0,0 +1,42 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_stats; + +set search_path=gtt_stats,sys; + +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +insert into gtt values(generate_series(1,10000),'test'); + +-- expect 1 +select count(*) from pg_gtt_attached_pids; + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +-- expect 0 +select * from pg_gtt_stats order by tablename; + +analyze gtt; + +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +select * from pg_gtt_stats order by tablename; + +reset search_path; + +drop schema gtt_stats cascade; + ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-30 14:17 =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> parent: Robert Haas <[email protected]> 0 siblings, 1 reply; 1038+ messages in thread From: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= @ 2020-01-30 14:17 UTC (permalink / raw) To: Robert Haas <[email protected]>; Pavel Stehule <[email protected]>; +Cc: Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; pgsql-hackers; =?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= <[email protected]>; =?UTF-8?B?Q2FpLCBMZQ==?= <[email protected]>; =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= <[email protected]> > 2020年1月29日 下午9:48,Robert Haas <[email protected]> 写道: > > On Tue, Jan 28, 2020 at 12:12 PM 曾文旌(义从) <[email protected]> wrote: >>> Opinion by Pavel >>> + rel->rd_islocaltemp = true; <<<<<<< if this is valid, then the name of field "rd_islocaltemp" is not probably best >>> I renamed rd_islocaltemp >> >> I don't see any change? >> >> Rename rd_islocaltemp to rd_istemp in global_temporary_table_v8-pg13.patch > > In view of commit 6919b7e3294702adc39effd16634b2715d04f012, I think > that this has approximately a 0% chance of being acceptable. If you're > setting a field in a way that is inconsistent with the current use of > the field, you're probably doing it wrong, because the field has an > existing purpose to which new code must conform. And if you're not > doing that, then you don't need to rename it. Thank you for pointing it out. I've rolled back the rename. But I still need rd_localtemp to be true, The reason is that 1 GTT The GTT needs to support DML in read-only transactions ,like local temp table. 2 GTT does not need to hold the lock before modifying the index buffer ,also like local temp table. Please give me feedback. Wenjing > > -- > Robert Haas > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company Attachments: [application/octet-stream] global_temporary_table_v9-pg13.patch (153.6K, ../../[email protected]/2-global_temporary_table_v9-pg13.patch) download | inline diff: diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 79430d2..babb5f3 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -158,6 +158,19 @@ static relopt_bool boolRelOpts[] = }, true }, + /* + * For global temp table only + * use ShareUpdateExclusiveLock for ensure safety + */ + { + { + "on_commit_delete_rows", + "global temp table on commit options", + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, + ShareUpdateExclusiveLock + }, + true + }, /* list terminator */ {{NULL}} }; @@ -1486,6 +1499,8 @@ bytea * default_reloptions(Datum reloptions, bool validate, relopt_kind kind) { static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)}, {"fillfactor", RELOPT_TYPE_INT, offsetof(StdRdOptions, fillfactor)}, {"autovacuum_enabled", RELOPT_TYPE_BOOL, offsetof(StdRdOptions, autovacuum) + offsetof(AutoVacOpts, enabled)}, @@ -1586,13 +1601,18 @@ build_reloptions(Datum reloptions, bool validate, bytea * partitioned_table_reloptions(Datum reloptions, bool validate) { + static const relopt_parse_elt tab[] = { + {"on_commit_delete_rows", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, on_commit_delete_rows)} + }; + /* * There are no options for partitioned tables yet, but this is able to do * some validation. */ return (bytea *) build_reloptions(reloptions, validate, RELOPT_KIND_PARTITIONED, - 0, NULL, 0); + sizeof(StdRdOptions), tab, lengthof(tab)); } /* diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index dd975b1..1610e7d 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -1013,7 +1013,9 @@ gistGetFakeLSN(Relation rel) { static XLogRecPtr counter = FirstNormalUnloggedLSN; - if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + /* global temp is same as local temp table */ + if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + rel->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { /* * Temporary relations are only accessible in our session, so a simple diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 4871b7f..16b00c9 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -149,7 +149,9 @@ hashbuild(Relation heap, Relation index, IndexInfo *indexInfo) * metapage, nor the first bitmap page. */ sort_threshold = (maintenance_work_mem * 1024L) / BLCKSZ; - if (index->rd_rel->relpersistence != RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + if (!(index->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + index->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) sort_threshold = Min(sort_threshold, NBuffers); else sort_threshold = Min(sort_threshold, NLocBuffer); diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index 3fa4b76..b54882d 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -598,7 +598,7 @@ heapam_relation_set_new_filenode(Relation rel, */ *minmulti = GetOldestMultiXactId(); - srel = RelationCreateStorage(*newrnode, persistence); + srel = RelationCreateStorage(*newrnode, persistence, rel); /* * If required, set up an init fork for an unlogged table so that it can @@ -651,7 +651,7 @@ heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index 8ce5011..0d6ae76 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -62,6 +62,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/dbcommands.h" #include "commands/progress.h" #include "commands/vacuum.h" @@ -399,9 +400,9 @@ heap_vacuum_rel(Relation onerel, VacuumParams *params, Assert(params->index_cleanup != VACOPT_TERNARY_DEFAULT); Assert(params->truncate != VACOPT_TERNARY_DEFAULT); - /* not every AM requires these to be valid, but heap does */ - Assert(TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); - Assert(MultiXactIdIsValid(onerel->rd_rel->relminmxid)); + /* not every AM requires these to be valid, but regular heap does */ + Assert(RELATION_IS_GLOBAL_TEMP(onerel) ^ TransactionIdIsNormal(onerel->rd_rel->relfrozenxid)); + Assert(RELATION_IS_GLOBAL_TEMP(onerel) ^ MultiXactIdIsValid(onerel->rd_rel->relminmxid)); /* measure elapsed time iff autovacuum logging requires it */ if (IsAutoVacuumWorkerProcess() && params->log_min_duration >= 0) diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index f05cbe7..946c9d2 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -763,7 +763,14 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access) /* Read an existing block of the relation */ buf = ReadBuffer(rel, blkno); LockBuffer(buf, access); - _bt_checkpage(rel, buf); + + /* global temp table may be not yet initialized for this backend. */ + if (RELATION_IS_GLOBAL_TEMP(rel) && + blkno == BTREE_METAPAGE && + PageIsNew(BufferGetPage(buf))) + _bt_initmetapage(BufferGetPage(buf), P_NONE, 0); + else + _bt_checkpage(rel, buf); } else { diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 3813ead..fd731d8 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6325,6 +6325,10 @@ StartupXLOG(void) else recoveryTargetTLI = ControlFile->checkPointCopy.ThisTimeLineID; + /* clean temp relation files */ + if (max_active_gtt > 0) + RemovePgTempFiles(); + /* * Check for signal files, and if so set up state for offline recovery */ diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index f8f0b48..dc8bbb1 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -42,6 +42,7 @@ OBJS = \ pg_subscription.o \ pg_type.o \ storage.o \ + storage_gtt.o \ toasting.o include $(top_srcdir)/src/backend/common.mk diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c index 7d6acae..3be8d63 100644 --- a/src/backend/catalog/catalog.c +++ b/src/backend/catalog/catalog.c @@ -393,7 +393,9 @@ GetNewRelFileNode(Oid reltablespace, Relation pg_class, char relpersistence) switch (relpersistence) { + /* global temp table is same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); break; case RELPERSISTENCE_UNLOGGED: diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 0fdff29..210d019 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -61,6 +61,7 @@ #include "catalog/pg_type.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "commands/tablecmds.h" #include "commands/typecmds.h" #include "executor/executor.h" @@ -99,6 +100,7 @@ static void AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -404,6 +406,10 @@ heap_create(const char *relname, relpersistence, relkind); + /* global temp table not create storage file when catalog create */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + create_storage = false; + /* * Have the storage manager create the relation's disk file, if needed. * @@ -427,7 +433,7 @@ heap_create(const char *relname, case RELKIND_INDEX: case RELKIND_SEQUENCE: - RelationCreateStorage(rel->rd_node, relpersistence); + RelationCreateStorage(rel->rd_node, relpersistence, rel); break; case RELKIND_RELATION: @@ -956,6 +962,7 @@ AddNewRelationTuple(Relation pg_class_desc, Oid reloftype, Oid relowner, char relkind, + char relpersistence, TransactionId relfrozenxid, TransactionId relminmxid, Datum relacl, @@ -994,8 +1001,18 @@ AddNewRelationTuple(Relation pg_class_desc, break; } - new_rel_reltup->relfrozenxid = relfrozenxid; - new_rel_reltup->relminmxid = relminmxid; + /* global temp table not remember transaction info in catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + new_rel_reltup->relfrozenxid = InvalidTransactionId; + new_rel_reltup->relminmxid = InvalidMultiXactId; + } + else + { + new_rel_reltup->relfrozenxid = relfrozenxid; + new_rel_reltup->relminmxid = relminmxid; + } + new_rel_reltup->relowner = relowner; new_rel_reltup->reltype = new_type_oid; new_rel_reltup->reloftype = reloftype; @@ -1357,6 +1374,7 @@ heap_create_with_catalog(const char *relname, reloftypeid, ownerid, relkind, + relpersistence, relfrozenxid, relminmxid, PointerGetDatum(relacl), @@ -1441,11 +1459,15 @@ heap_create_with_catalog(const char *relname, */ StoreConstraints(new_rel_desc, cooked_constraints, is_internal); - /* - * If there's a special on-commit action, remember it - */ - if (oncommit != ONCOMMIT_NOOP) - register_on_commit_action(relid, oncommit); + /* global temp table register action when storage init */ + if (relpersistence != RELPERSISTENCE_GLOBAL_TEMP) + { + /* + * If there's a special on-commit action, remember it + */ + if (oncommit != ONCOMMIT_NOOP) + register_on_commit_action(relid, oncommit); + } /* * ok, the relation has been cataloged, so close our relations and return @@ -1937,6 +1959,13 @@ heap_drop_with_catalog(Oid relid) if (relid == defaultPartOid) update_default_partition_oid(parentOid, InvalidOid); + /* We allow to drop global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not drop relation when other backend attached this global temp table"); + } + /* * Schedule unlinking of the relation's physical files at commit. */ @@ -3165,7 +3194,7 @@ RemoveStatistics(Oid relid, AttrNumber attnum) * the specified relation. Caller must hold exclusive lock on rel. */ static void -RelationTruncateIndexes(Relation heapRelation) +RelationTruncateIndexes(Relation heapRelation, LOCKMODE lockmode) { ListCell *indlist; @@ -3176,8 +3205,12 @@ RelationTruncateIndexes(Relation heapRelation) Relation currentIndex; IndexInfo *indexInfo; + if (RELATION_IS_GLOBAL_TEMP(heapRelation) && + !gtt_storage_attached(indexId)) + continue; + /* Open the index relation; use exclusive lock, just to be sure */ - currentIndex = index_open(indexId, AccessExclusiveLock); + currentIndex = index_open(indexId, lockmode); /* * Fetch info needed for index_build. Since we know there are no @@ -3223,8 +3256,13 @@ heap_truncate(List *relids) { Oid rid = lfirst_oid(cell); Relation rel; + LOCKMODE lockmode = AccessExclusiveLock; - rel = table_open(rid, AccessExclusiveLock); + /* truncate global temp table only need RowExclusiveLock */ + if (get_rel_persistence(rid) == RELPERSISTENCE_GLOBAL_TEMP) + lockmode = RowExclusiveLock; + + rel = table_open(rid, lockmode); relations = lappend(relations, rel); } @@ -3257,6 +3295,8 @@ void heap_truncate_one_rel(Relation rel) { Oid toastrelid; + LOCKMODE lockmode = AccessExclusiveLock; + bool truncate_toastrel = false; /* * Truncate the relation. Partitioned tables have no storage, so there is @@ -3265,23 +3305,40 @@ heap_truncate_one_rel(Relation rel) if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) return; + toastrelid = rel->rd_rel->reltoastrelid; + + /* + * Truncate global temp table only need RowExclusiveLock + */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + lockmode = RowExclusiveLock; + if (OidIsValid(toastrelid) && + gtt_storage_attached(toastrelid)) + truncate_toastrel = true; + } + else if (OidIsValid(toastrelid)) + truncate_toastrel = true; + /* Truncate the underlying relation */ table_relation_nontransactional_truncate(rel); /* If the relation has indexes, truncate the indexes too */ - RelationTruncateIndexes(rel); + RelationTruncateIndexes(rel, lockmode); /* If there is a toast table, truncate that too */ - toastrelid = rel->rd_rel->reltoastrelid; - if (OidIsValid(toastrelid)) + if (truncate_toastrel) { - Relation toastrel = table_open(toastrelid, AccessExclusiveLock); + Relation toastrel = table_open(toastrelid, lockmode); table_relation_nontransactional_truncate(toastrel); - RelationTruncateIndexes(toastrel); + RelationTruncateIndexes(toastrel, lockmode); /* keep the lock... */ table_close(toastrel, NoLock); } + + if (RELATION_IS_GLOBAL_TEMP(rel)) + up_gtt_relstats(rel, 0, 0, 0, RecentXmin, InvalidMultiXactId); } /* diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 8880586..0852073 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -52,6 +52,7 @@ #include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/event_trigger.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -877,6 +878,22 @@ index_create(Relation heapRelation, indexRelationName, RelationGetRelationName(heapRelation)))); } + if (RELATION_IS_GLOBAL_TEMP(heapRelation)) + { + if (accessMethodObjectId != BTREE_AM_OID) + elog(ERROR, "only support btree index on global temp table"); + + /* No support create index on global temp table use concurrent mode yet */ + if (concurrent) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot create indexes on global temporary tables using concurrent mode"))); + + /* if global temp table not init storage, then skip build index */ + if (!gtt_storage_attached(heapRelation->rd_node.relNode)) + flags |= INDEX_CREATE_SKIP_BUILD; + } + /* * construct tuple descriptor for index tuples */ @@ -2054,6 +2071,13 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) */ CheckTableNotInUse(userIndexRelation, "DROP INDEX"); + /* We allow to drop index on global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(userHeapRelation)) + { + if (is_other_backend_use_gtt(userHeapRelation->rd_node)) + elog(ERROR, "can not drop index when other backend attached this global temp table."); + } + /* * Drop Index Concurrently is more or less the reverse process of Create * Index Concurrently. @@ -2660,6 +2684,11 @@ index_update_stats(Relation rel, HeapTuple tuple; Form_pg_class rd_rel; bool dirty; + bool is_gtt = false; + + /* update index stats into localhash and rel_rd_rel for global temp table */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + is_gtt = true; /* * We always update the pg_class row using a non-transactional, @@ -2745,21 +2774,35 @@ index_update_stats(Relation rel, else /* don't bother for indexes */ relallvisible = 0; - if (rd_rel->relpages != (int32) relpages) + if (is_gtt) + rel->rd_rel->relpages = (int32) relpages; + else if (rd_rel->relpages != (int32) relpages) { rd_rel->relpages = (int32) relpages; dirty = true; } - if (rd_rel->reltuples != (float4) reltuples) + + if (is_gtt) + rel->rd_rel->reltuples = (float4) reltuples; + else if (rd_rel->reltuples != (float4) reltuples) { rd_rel->reltuples = (float4) reltuples; dirty = true; } - if (rd_rel->relallvisible != (int32) relallvisible) + + if (is_gtt) + rel->rd_rel->relallvisible = (int32) relallvisible; + else if (rd_rel->relallvisible != (int32) relallvisible) { rd_rel->relallvisible = (int32) relallvisible; dirty = true; } + + if (is_gtt) + { + up_gtt_relstats(rel, relpages, reltuples, relallvisible, + InvalidTransactionId, InvalidMultiXactId); + } } /* @@ -2873,6 +2916,15 @@ index_build(Relation heapRelation, pgstat_progress_update_multi_param(6, index, val); } + if (RELATION_IS_GLOBAL_TEMP(indexRelation)) + { + if (!gtt_storage_attached(indexRelation->rd_node.relNode)) + { + gtt_force_enable_index(indexRelation); + RelationCreateStorage(indexRelation->rd_node, RELPERSISTENCE_GLOBAL_TEMP, indexRelation); + } + } + /* * Call the access method's build procedure */ @@ -3468,6 +3520,15 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence, errmsg("cannot reindex temporary tables of other sessions"))); /* + * Because global temp table cannot change relfilenode + * no support reindex on global temp table yet. + */ + if (RELATION_IS_GLOBAL_TEMP(iRel)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot reindex global temporary tables"))); + + /* * Also check for active uses of the index in the current transaction; we * don't want to reindex underneath an open indexscan. */ diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index e70243a..301da79 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -647,6 +647,13 @@ RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid) errmsg("cannot create temporary relation in non-temporary schema"))); } break; + /* global temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: + if (isAnyTempNamespace(nspid)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("cannot create global temp relations in temporary schemas"))); + break; case RELPERSISTENCE_PERMANENT: if (isTempOrTempToastNamespace(nspid)) newRelation->relpersistence = RELPERSISTENCE_TEMP; diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index fddfbf1..671c614 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -26,6 +26,7 @@ #include "access/xlogutils.h" #include "catalog/storage.h" #include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "storage/freespace.h" #include "storage/smgr.h" @@ -75,7 +76,7 @@ static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */ * transaction aborts later on, the storage will be destroyed. */ SMgrRelation -RelationCreateStorage(RelFileNode rnode, char relpersistence) +RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel) { PendingRelDelete *pending; SMgrRelation srel; @@ -85,6 +86,8 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) switch (relpersistence) { case RELPERSISTENCE_TEMP: + /* global temp table use same storage strategy as local temp table */ + case RELPERSISTENCE_GLOBAL_TEMP: backend = BackendIdForTempRelations(); needs_wal = false; break; @@ -117,6 +120,10 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence) pending->next = pendingDeletes; pendingDeletes = pending; + /* remember global temp table storage info to localhash */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && rel) + remember_gtt_storage_info(rnode, rel); + return srel; } @@ -486,8 +493,15 @@ smgrDoPendingDeletes(bool isCommit) smgrdounlinkall(srels, nrels, false); for (i = 0; i < nrels; i++) + { smgrclose(srels[i]); + /* clean global temp table flags when transaction commit or rollback */ + if (SmgrIsTemp(srels[i]) && + gtt_storage_attached(srels[i]->smgr_rnode.node.relNode)) + forget_gtt_storage_info(srels[i]->smgr_rnode.node.relNode); + } + pfree(srels); } } diff --git a/src/backend/catalog/storage_gtt.c b/src/backend/catalog/storage_gtt.c new file mode 100644 index 0000000..71be416 --- /dev/null +++ b/src/backend/catalog/storage_gtt.c @@ -0,0 +1,1174 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.c + * code to create and destroy physical storage for global temparary table + * + * IDENTIFICATION + * src/backend/catalog/storage_gtt.c + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "access/table.h" +#include "access/visibilitymap.h" +#include "access/xact.h" +#include "access/xlog.h" +#include "access/xloginsert.h" +#include "access/xlogutils.h" +#include "access/htup_details.h" +#include "access/multixact.h" +#include "catalog/storage.h" +#include "catalog/storage_xlog.h" +#include "catalog/storage_gtt.h" +#include "catalog/heap.h" +#include "catalog/namespace.h" +#include "catalog/pg_type.h" +#include "catalog/pg_statistic.h" +#include "commands/tablecmds.h" +#include "funcapi.h" +#include "nodes/primnodes.h" +#include "nodes/pg_list.h" +#include "nodes/execnodes.h" +#include "miscadmin.h" +#include "storage/freespace.h" +#include "storage/smgr.h" +#include "storage/ipc.h" +#include "storage/proc.h" +#include "storage/procarray.h" +#include "storage/lwlock.h" +#include "storage/shmem.h" +#include "storage/sinvaladt.h" +#include "utils/memutils.h" +#include "utils/rel.h" +#include "utils/hsearch.h" +#include "utils/catcache.h" +#include "utils/lsyscache.h" +#include <utils/relcache.h> +#include "utils/inval.h" +#include "utils/guc.h" + + +/* Copy from bitmapset.c, because gtt used the function in bitmapset.c */ +#define WORDNUM(x) ((x) / BITS_PER_BITMAPWORD) +#define BITNUM(x) ((x) % BITS_PER_BITMAPWORD) + +#define BITMAPSET_SIZE(nwords) \ + (offsetof(Bitmapset, words) + (nwords) * sizeof(bitmapword)) + +static bool gtt_cleaner_exit_registered = false; +static HTAB *gtt_storage_local_hash = NULL; +static HTAB *active_gtt_shared_hash = NULL; +static MemoryContext gtt_relstats_context = NULL; + +/* relfrozenxid of all gtts in the current session */ +static List *gtt_session_relfrozenxid_list = NIL; +static TransactionId gtt_session_frozenxid = InvalidTransactionId; + +typedef struct gtt_ctl_data +{ + LWLock lock; + int max_entry; + int entry_size; +}gtt_ctl_data; + +static gtt_ctl_data *gtt_shared_ctl = NULL; + +typedef struct +{ + RelFileNode rnode; + Bitmapset *map; + /* bitmap data */ +} gtt_shared_hash_entry; + +typedef struct +{ + Oid relid; + + Oid spcnode; + /* pg_class stat */ + int32 relpages; + float4 reltuples; + int32 relallvisible; + TransactionId relfrozenxid; + TransactionId relminmxid; + char relkind; + bool on_commit_delete; + + /* pg_statistic */ + int natts; + int *attnum; + HeapTuple *att_stat_tups; +} gtt_local_hash_entry; + +static Size action_gtt_shared_hash_entry_size(void); +static void gtt_storage_checkin(RelFileNode rnode); +static void gtt_storage_checkout(RelFileNode rnode, bool skiplock); +static void gtt_storage_removeall(int code, Datum arg); +static void insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid); +static void remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid); +static void set_gtt_session_relfrozenxid(void); + +Datum pg_get_gtt_statistics(PG_FUNCTION_ARGS); +Datum pg_get_gtt_relstats(PG_FUNCTION_ARGS); +Datum pg_gtt_attached_pid(PG_FUNCTION_ARGS); +Datum pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS); + + +static Size +action_gtt_shared_hash_entry_size(void) +{ + int wordnum; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + wordnum = WORDNUM(MaxBackends + 1); + hash_entry_size += MAXALIGN(sizeof(gtt_shared_hash_entry)); + hash_entry_size += MAXALIGN(BITMAPSET_SIZE(wordnum + 1)); + + return hash_entry_size; +} + +Size +active_gtt_shared_hash_size(void) +{ + Size size = 0; + Size hash_entry_size = 0; + + if (max_active_gtt <= 0) + return 0; + + size = MAXALIGN(sizeof(gtt_ctl_data)); + hash_entry_size = action_gtt_shared_hash_entry_size(); + size += hash_estimate_size(max_active_gtt, hash_entry_size); + + return size; +} + +void +active_gtt_shared_hash_init(void) +{ + HASHCTL info; + bool found; + + if (max_active_gtt <= 0) + return; + + gtt_shared_ctl = + ShmemInitStruct("gtt_shared_ctl", + sizeof(gtt_ctl_data), + &found); + + if (!found) + { + LWLockRegisterTranche(LWTRANCHE_GTT_CTL, "gtt_shared_ctl"); + LWLockInitialize(>t_shared_ctl->lock, LWTRANCHE_GTT_CTL); + gtt_shared_ctl->max_entry = max_active_gtt; + gtt_shared_ctl->entry_size = action_gtt_shared_hash_entry_size(); + } + + info.keysize = sizeof(RelFileNode); + info.entrysize = gtt_shared_ctl->entry_size; + active_gtt_shared_hash = + ShmemInitHash("active gtt shared hash", + gtt_shared_ctl->max_entry, + gtt_shared_ctl->max_entry, + &info, HASH_ELEM | HASH_BLOBS | HASH_FIXED_SIZE); +} + +static void +gtt_storage_checkin(RelFileNode rnode) +{ + gtt_shared_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + entry = (gtt_shared_hash_entry *) hash_search(active_gtt_shared_hash, + &rnode, HASH_ENTER_NULL, &found); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of shared memory"), + errhint("You might need to increase max_active_gtt."))); + } + + if (found == false) + { + int wordnum; + + entry->map = (Bitmapset *)((char *)entry + MAXALIGN(sizeof(gtt_shared_hash_entry))); + wordnum = WORDNUM(MaxBackends + 1); + memset(entry->map, 0, BITMAPSET_SIZE(wordnum + 1)); + entry->map->nwords = wordnum + 1; + } + + bms_add_member(entry->map, MyBackendId); + LWLockRelease(>t_shared_ctl->lock); +} + +static void +gtt_storage_checkout(RelFileNode rnode, bool skiplock) +{ + gtt_shared_hash_entry *entry; + + if (max_active_gtt <= 0) + return; + + if (!skiplock) + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + + entry = hash_search(active_gtt_shared_hash, + (void *) &(rnode), HASH_FIND, NULL); + + if (entry == NULL) + { + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + elog(WARNING, "relfilenode %u/%u/%u not exist in gtt shared hash when forget", + rnode.dbNode, rnode.spcNode, rnode.relNode); + return; + } + + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + bms_del_member(entry->map, MyBackendId); + + if (bms_is_empty(entry->map)) + { + if (!hash_search(active_gtt_shared_hash, &rnode, HASH_REMOVE, NULL)) + elog(PANIC, "gtt shared hash table corrupted"); + } + + if (!skiplock) + LWLockRelease(>t_shared_ctl->lock); + + return; +} + +Bitmapset * +copy_active_gtt_bitmap(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + Bitmapset *map_copy = NULL; + + if (max_active_gtt <= 0) + return NULL; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return NULL; + } + + Assert(entry->map); + if (!bms_is_empty(entry->map)) + map_copy = bms_copy(entry->map); + + LWLockRelease(>t_shared_ctl->lock); + + return map_copy; +} + +bool +is_other_backend_use_gtt(RelFileNode node) +{ + gtt_shared_hash_entry *entry; + bool in_use = false; + int num_use = 0; + + if (max_active_gtt <= 0) + return false; + + LWLockAcquire(>t_shared_ctl->lock, LW_SHARED); + entry = hash_search(active_gtt_shared_hash, + (void *) &(node), HASH_FIND, NULL); + + if (entry == NULL) + { + LWLockRelease(>t_shared_ctl->lock); + return false; + } + + Assert(entry->map); + Assert(MyBackendId >= 1 && MyBackendId <= MaxBackends); + + num_use = bms_num_members(entry->map); + if (num_use == 0) + in_use = false; + else if (num_use == 1) + { + if(bms_is_member(MyBackendId, entry->map)) + in_use = false; + else + in_use = true; + } + else + in_use = true; + + LWLockRelease(>t_shared_ctl->lock); + + return in_use; +} + +void +remember_gtt_storage_info(RelFileNode rnode, Relation rel) +{ + gtt_local_hash_entry *entry; + MemoryContext oldcontext; + Oid relid = rnode.relNode; + bool found; + int natts = 0; + + if (max_active_gtt <= 0) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Global temporary table feature is disable"), + errhint("You might need to increase max_active_gtt to enable this feature."))); + + if (RecoveryInProgress()) + elog(ERROR, "readonly mode not support access global temp table yet"); + + if (rel->rd_rel->relkind == RELKIND_INDEX && + (!rel->rd_index->indisvalid || + !rel->rd_index->indisready || + !rel->rd_index->indislive)) + elog(ERROR, "invalid gtt index %s not allow to create stroage file", RelationGetRelationName(rel)); + + if (gtt_storage_local_hash == NULL) + { +#define GTT_LOCAL_HASH_SIZE 1024 + /* First time through: initialize the hash table */ + HASHCTL ctl; + + MemSet(&ctl, 0, sizeof(ctl)); + ctl.keysize = sizeof(Oid); + ctl.entrysize = sizeof(gtt_local_hash_entry); + gtt_storage_local_hash = + hash_create("global temp relation table", + GTT_LOCAL_HASH_SIZE, + &ctl, HASH_ELEM | HASH_BLOBS); + + if (!CacheMemoryContext) + CreateCacheMemoryContext(); + + gtt_relstats_context = + AllocSetContextCreate(CacheMemoryContext, + "gtt relstats context", + ALLOCSET_DEFAULT_SIZES); + } + + /* Look up or create an entry */ + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_ENTER, &found); + + if (found) + { + elog(ERROR, "backend %d relid %u already exists in global temp table local hash", + MyBackendId, relid); + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + + entry->spcnode = rnode.spcNode; + entry->relpages = 0; + entry->reltuples = 0; + entry->relallvisible = 0; + entry->relkind = rel->rd_rel->relkind; + natts = RelationGetNumberOfAttributes(rel); + entry->natts = natts; + entry->attnum = palloc0(sizeof(int) * natts); + entry->att_stat_tups = palloc0(sizeof(HeapTuple) * natts); + /* only heap contain transaction information */ + if (entry->relkind == RELKIND_RELATION || + entry->relkind == RELKIND_PARTITIONED_TABLE) + { + if (RELATION_GTT_ON_COMMIT_DELETE(rel)) + { + entry->on_commit_delete = true; + register_on_commit_action(rel->rd_node.relNode, ONCOMMIT_DELETE_ROWS); + } + + entry->relfrozenxid = RecentXmin; + entry->relminmxid = GetOldestMultiXactId(); + insert_gtt_relfrozenxid_to_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + gtt_storage_checkin(rnode); + } + else + { + entry->on_commit_delete = false; + entry->relfrozenxid = 0; + entry->relminmxid = 0; + } + + MemoryContextSwitchTo(oldcontext); + + if (!gtt_cleaner_exit_registered) + { + before_shmem_exit(gtt_storage_removeall, 0); + gtt_cleaner_exit_registered = true; + } + + return; +} + +void +forget_gtt_storage_info(Oid relid) +{ + gtt_local_hash_entry *entry = NULL; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, NULL); + + if (entry) + { + int i; + + if (entry->relkind == RELKIND_RELATION || + entry->relkind == RELKIND_PARTITIONED_TABLE) + { + RelFileNode rnode; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + gtt_storage_checkout(rnode, false); + + Assert(TransactionIdIsNormal(entry->relfrozenxid)); + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + set_gtt_session_relfrozenxid(); + } + + for (i = 0; i < entry->natts; i++) + { + if (entry->att_stat_tups[i]) + { + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + } + } + + pfree(entry->attnum); + pfree(entry->att_stat_tups); + } + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_REMOVE, NULL); + + return; +} + +/* is the storage file was created in this backend */ +bool +gtt_storage_attached(Oid relid) +{ + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + hash_search(gtt_storage_local_hash, + (void *) &(relid), HASH_FIND, &found); + + return found; +} + +static void +gtt_storage_removeall(int code, Datum arg) +{ + HASH_SEQ_STATUS status; + gtt_local_hash_entry *entry; + int nrels = 0, + maxrels = 0; + SMgrRelation *srels = NULL; + RelFileNode *rnodes = NULL; + char *relkinds = NULL; + + if (gtt_storage_local_hash == NULL) + return; + + hash_seq_init(&status, gtt_storage_local_hash); + while ((entry = (gtt_local_hash_entry *) hash_seq_search(&status)) != NULL) + { + SMgrRelation srel; + RelFileNode rnode; + + rnode.spcNode = entry->spcnode; + rnode.dbNode = MyDatabaseId; + rnode.relNode = entry->relid; + + srel = smgropen(rnode, MyBackendId); + + /* allocate the initial array, or extend it, if needed */ + if (maxrels == 0) + { + maxrels = 32; + srels = palloc(sizeof(SMgrRelation) * maxrels); + rnodes = palloc(sizeof(RelFileNode) * maxrels); + relkinds = palloc(sizeof(char) * maxrels); + } + else if (maxrels <= nrels) + { + maxrels *= 2; + srels = repalloc(srels, sizeof(SMgrRelation) * maxrels); + rnodes = repalloc(rnodes, sizeof(RelFileNode) * maxrels); + relkinds = repalloc(relkinds, sizeof(char) * maxrels); + } + + srels[nrels] = srel; + rnodes[nrels] = rnode; + relkinds[nrels] = entry->relkind; + nrels++; + } + + if (nrels > 0) + { + int i; + + smgrdounlinkall(srels, nrels, false); + + LWLockAcquire(>t_shared_ctl->lock, LW_EXCLUSIVE); + for (i = 0; i < nrels; i++) + { + smgrclose(srels[i]); + if (relkinds[i] == RELKIND_RELATION) + gtt_storage_checkout(rnodes[i], true); + } + LWLockRelease(>t_shared_ctl->lock); + + pfree(srels); + pfree(rnodes); + pfree(relkinds); + } + + MyProc->session_gtt_frozenxid = InvalidTransactionId; + + return; +} + +/* + * Update global temp table relstats(relpage/reltuple/relallvisible) + * to local hashtable + */ +void +up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid) +{ + Oid relid = RelationGetRelid(relation); + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return; + + Assert(entry->spcnode); + + if (num_pages >= 0 && + entry->relpages != (int32)num_pages) + entry->relpages = (int32)num_pages; + + if (num_tuples >= 0 && + num_tuples != (float4)entry->reltuples) + entry->reltuples = (float4)num_tuples; + + /* only heap contain transaction information and relallvisible */ + if (entry->relkind == RELKIND_RELATION) + { + if (entry->relallvisible >= 0 && + entry->relallvisible != (int32)num_all_visible_pages) + { + entry->relallvisible = (int32)num_all_visible_pages; + } + + if (TransactionIdIsNormal(relfrozenxid) && + entry->relfrozenxid != relfrozenxid && + (TransactionIdPrecedes(entry->relfrozenxid, relfrozenxid) || + TransactionIdPrecedes(ReadNewTransactionId(), entry->relfrozenxid))) + { + remove_gtt_relfrozenxid_from_ordered_list(entry->relfrozenxid); + entry->relfrozenxid = relfrozenxid; + insert_gtt_relfrozenxid_to_ordered_list(relfrozenxid); + set_gtt_session_relfrozenxid(); + } + + if (MultiXactIdIsValid(relminmxid) && + entry->relminmxid != relminmxid && + (MultiXactIdPrecedes(entry->relminmxid, relminmxid) || + MultiXactIdPrecedes(ReadNextMultiXactId(), entry->relminmxid))) + { + entry->relminmxid = relminmxid; + } + } + + return; +} + +/* + * Search global temp table relstats(relpage/reltuple/relallvisible) + * from local hashtable. + */ +bool +get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid) +{ + gtt_local_hash_entry *entry; + bool found; + + if (max_active_gtt <= 0) + return false; + + if (gtt_storage_local_hash == NULL) + return false; + + entry = hash_search(gtt_storage_local_hash, + (void *) &relid, HASH_FIND, &found); + + if (!found) + return false; + + Assert(entry->relid == relid); + + if (relpages) + *relpages = entry->relpages; + + if (reltuples) + *reltuples = entry->reltuples; + + if (relallvisible) + *relallvisible = entry->relallvisible; + + if (relfrozenxid) + *relfrozenxid = entry->relfrozenxid; + + if (relminmxid) + *relminmxid = entry->relminmxid; + + return true; +} + +/* + * Update global temp table statistic info(definition is same as pg_statistic) + * to local hashtable where ananyze global temp table + */ +void +up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull) +{ + gtt_local_hash_entry *entry; + bool found; + MemoryContext oldcontext; + int i = 0; + + if (max_active_gtt <= 0) + return; + + if (gtt_storage_local_hash == NULL) + return; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return; + + /* todo */ + if (entry->natts < natts) + { + elog(WARNING, "reloid %u not support update attstat after add colunm", reloid); + return; + } + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + Assert(entry->relid == reloid); + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == 0) + { + entry->attnum[i] = attnum; + break; + } + else if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + heap_freetuple(entry->att_stat_tups[i]); + entry->att_stat_tups[i] = NULL; + break; + } + } + + Assert(i < entry->natts); + Assert(entry->att_stat_tups[i] == NULL); + entry->att_stat_tups[i] = heap_form_tuple(tupleDescriptor, values, isnull); + MemoryContextSwitchTo(oldcontext); + + return; +} + +/* + * Search global temp table statistic info(definition is same as pg_statistic) + * from local hashtable. + */ +HeapTuple +get_gtt_att_statistic(Oid reloid, int attnum, bool inh) +{ + gtt_local_hash_entry *entry; + bool found; + int i = 0; + + if (max_active_gtt <= 0) + return NULL; + + if (gtt_storage_local_hash == NULL) + return NULL; + + entry = hash_search(gtt_storage_local_hash, + (void *) &reloid, HASH_FIND, &found); + + if (!found) + return NULL; + + for (i = 0; i < entry->natts; i++) + { + if (entry->attnum[i] == attnum) + { + Assert(entry->att_stat_tups[i]); + return entry->att_stat_tups[i]; + } + } + + return NULL; +} + +void +release_gtt_statistic_cache(HeapTuple tup) +{ + /* do nothing */ + return; +} + +static void +insert_gtt_relfrozenxid_to_ordered_list(Oid relfrozenxid) +{ + MemoryContext oldcontext; + ListCell *cell; + int i; + + Assert(TransactionIdIsNormal(relfrozenxid)); + + oldcontext = MemoryContextSwitchTo(gtt_relstats_context); + /* Does the datum belong at the front? */ + if (gtt_session_relfrozenxid_list == NIL || + TransactionIdFollowsOrEquals(relfrozenxid, + linitial_oid(gtt_session_relfrozenxid_list))) + { + gtt_session_relfrozenxid_list = + lcons_oid(relfrozenxid, gtt_session_relfrozenxid_list); + MemoryContextSwitchTo(oldcontext); + + return; + } + + /* No, so find the entry it belongs after */ + i = 0; + foreach (cell, gtt_session_relfrozenxid_list) + { + if (TransactionIdFollowsOrEquals(relfrozenxid, lfirst_oid(cell))) + break; + + i++; + } + gtt_session_relfrozenxid_list = + list_insert_nth_oid(gtt_session_relfrozenxid_list, i, relfrozenxid); + MemoryContextSwitchTo(oldcontext); + + return; +} + +static void +remove_gtt_relfrozenxid_from_ordered_list(Oid relfrozenxid) +{ + gtt_session_relfrozenxid_list = + list_delete_oid(gtt_session_relfrozenxid_list, relfrozenxid); +} + +static void +set_gtt_session_relfrozenxid(void) +{ + TransactionId gtt_frozenxid = InvalidTransactionId; + + if (gtt_session_relfrozenxid_list) + gtt_frozenxid = llast_oid(gtt_session_relfrozenxid_list); + + gtt_session_frozenxid = gtt_frozenxid; + if (MyProc->session_gtt_frozenxid != gtt_frozenxid) + MyProc->session_gtt_frozenxid = gtt_frozenxid; +} + +Datum +pg_get_gtt_statistics(PG_FUNCTION_ARGS) +{ + HeapTuple tuple; + Relation rel = NULL; + int attnum = PG_GETARG_INT32(1); + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + MemoryContext oldcontext; + Tuplestorestate *tupstore; + Relation pg_tatistic = NULL; + TupleDesc sd; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not " \ + "allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + pg_tatistic = table_open(StatisticRelationId, AccessShareLock); + sd = RelationGetDescr(pg_tatistic); + + tuple = get_gtt_att_statistic(reloid, attnum, false); + if (tuple) + { + Datum values[31]; + bool isnull[31]; + HeapTuple res = NULL; + + memset(&values, 0, sizeof(values)); + memset(&isnull, 0, sizeof(isnull)); + heap_deform_tuple(tuple, sd, values, isnull); + res = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, res); + } + + table_close(rel, NoLock); + table_close(pg_tatistic, AccessShareLock); + tuplestore_donestoring(tupstore); + + return (Datum) 0; +} + +Datum +pg_get_gtt_relstats(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + uint32 relfrozenxid = 0; + uint32 relminmxid = 0; + Relation rel = NULL; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + if (get_gtt_relstats(reloid, + &relpages, &reltuples, &relallvisible, + &relfrozenxid, &relminmxid)) + { + Datum values[5]; + bool isnull[5]; + + memset(isnull, 0, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(relpages); + values[1] = Float4GetDatum((float4)reltuples); + values[2] = Int32GetDatum(relallvisible); + values[3] = UInt32GetDatum(relfrozenxid); + values[4] = UInt32GetDatum(relminmxid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_gtt_attached_pid(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + Oid reloid = PG_GETARG_OID(0); + char rel_persistence; + Relation rel = NULL; + PGPROC *proc = NULL; + Bitmapset *map = NULL; + pid_t pid = 0; + int backendid = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + rel = table_open(reloid, AccessShareLock); + rel_persistence = get_rel_persistence(reloid); + if (rel_persistence != RELPERSISTENCE_GLOBAL_TEMP) + { + elog(WARNING, "relation OID %u is not a global temporary table", reloid); + table_close(rel, NoLock); + return (Datum) 0; + } + + map = copy_active_gtt_bitmap(rel->rd_node); + if (map) + { + backendid = bms_first_member(map); + + do + { + proc = BackendIdGetProc(backendid); + pid = proc->pid; + if (pid > 0) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = UInt32GetDatum(reloid); + values[1] = Int32GetDatum(pid); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + backendid = bms_next_member(map, backendid); + } while (backendid > 0); + + pfree(map); + } + + tuplestore_donestoring(tupstore); + table_close(rel, NoLock); + + return (Datum) 0; +} + +Datum +pg_list_gtt_relfrozenxids(PG_FUNCTION_ARGS) +{ + ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; + TupleDesc tupdesc; + Tuplestorestate *tupstore; + MemoryContext oldcontext; + HeapTuple tuple; + int num_xid = MaxBackends + 1; + int *pids = NULL; + uint32 *xids = NULL; + int i = 0; + int j = 0; + uint32 oldest = 0; + + if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) + elog(ERROR, "return type must be a row type"); + + if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that cannot accept a set"))); + if (!(rsinfo->allowedModes & SFRM_Materialize)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialize mode required, but it is not allowed in this context"))); + + oldcontext = MemoryContextSwitchTo( + rsinfo->econtext->ecxt_per_query_memory); + tupstore = tuplestore_begin_heap(true, false, work_mem); + rsinfo->returnMode = SFRM_Materialize; + rsinfo->setResult = tupstore; + rsinfo->setDesc = tupdesc; + MemoryContextSwitchTo(oldcontext); + + if (max_active_gtt <= 0) + return (Datum) 0; + + if (RecoveryInProgress()) + return (Datum) 0; + + pids = palloc0(sizeof(int) * num_xid); + xids = palloc0(sizeof(int) * num_xid); + oldest = list_all_session_gtt_frozenxids(num_xid, pids, xids, &i); + if (i > 0) + { + if (i > 0) + { + pids[i] = 0; + xids[i] = oldest; + i++; + } + + for(j = 0; j < i; j++) + { + Datum values[2]; + bool isnull[2]; + + memset(isnull, false, sizeof(isnull)); + memset(values, 0, sizeof(values)); + values[0] = Int32GetDatum(pids[j]); + values[1] = UInt32GetDatum(xids[j]); + tuple = heap_form_tuple(tupdesc, values, isnull); + tuplestore_puttuple(tupstore, tuple); + } + } + tuplestore_donestoring(tupstore); + pfree(pids); + pfree(xids); + + return (Datum) 0; +} + +void +gtt_force_enable_index(Relation index) +{ + Oid indexOid = RelationGetRelid(index); + + if (!RELATION_IS_GLOBAL_TEMP(index)) + return; + + Assert(index->rd_rel->relkind == RELKIND_INDEX); + Assert(OidIsValid(indexOid)); + + index->rd_index->indisvalid = true; + index->rd_index->indislive = true; + index->rd_index->indisready = true; +} + +void +gtt_fix_index_state(Relation index) +{ + Oid indexOid = RelationGetRelid(index); + Oid relOid = index->rd_index->indrelid; + + if (!RELATION_IS_GLOBAL_TEMP(index)) + return; + + if (!index->rd_index->indisvalid) + return; + + if (gtt_storage_attached(relOid) && + !gtt_storage_attached(indexOid)) + { + index->rd_index->indisvalid = false; + index->rd_index->indislive = false; + index->rd_index->indisready = false; + } + + return; +} + diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index c9e6060..d814ff2 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -186,6 +186,91 @@ CREATE OR REPLACE VIEW pg_sequences AS WHERE NOT pg_is_other_temp_schema(N.oid) AND relkind = 'S'; +-- For global temporary table +CREATE VIEW pg_gtt_relstats WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_relstats(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_attached_pids WITH (security_barrier) AS + SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.* + FROM + pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_gtt_attached_pid(c.oid) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + +CREATE VIEW pg_gtt_stats WITH (security_barrier) AS +SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN s.stakind1 = 1 THEN s.stavalues1 + WHEN s.stakind2 = 1 THEN s.stavalues2 + WHEN s.stakind3 = 1 THEN s.stavalues3 + WHEN s.stakind4 = 1 THEN s.stavalues4 + WHEN s.stakind5 = 1 THEN s.stavalues5 + END AS most_common_vals, + CASE + WHEN s.stakind1 = 1 THEN s.stanumbers1 + WHEN s.stakind2 = 1 THEN s.stanumbers2 + WHEN s.stakind3 = 1 THEN s.stanumbers3 + WHEN s.stakind4 = 1 THEN s.stanumbers4 + WHEN s.stakind5 = 1 THEN s.stanumbers5 + END AS most_common_freqs, + CASE + WHEN s.stakind1 = 2 THEN s.stavalues1 + WHEN s.stakind2 = 2 THEN s.stavalues2 + WHEN s.stakind3 = 2 THEN s.stavalues3 + WHEN s.stakind4 = 2 THEN s.stavalues4 + WHEN s.stakind5 = 2 THEN s.stavalues5 + END AS histogram_bounds, + CASE + WHEN s.stakind1 = 3 THEN s.stanumbers1[1] + WHEN s.stakind2 = 3 THEN s.stanumbers2[1] + WHEN s.stakind3 = 3 THEN s.stanumbers3[1] + WHEN s.stakind4 = 3 THEN s.stanumbers4[1] + WHEN s.stakind5 = 3 THEN s.stanumbers5[1] + END AS correlation, + CASE + WHEN s.stakind1 = 4 THEN s.stavalues1 + WHEN s.stakind2 = 4 THEN s.stavalues2 + WHEN s.stakind3 = 4 THEN s.stavalues3 + WHEN s.stakind4 = 4 THEN s.stavalues4 + WHEN s.stakind5 = 4 THEN s.stavalues5 + END AS most_common_elems, + CASE + WHEN s.stakind1 = 4 THEN s.stanumbers1 + WHEN s.stakind2 = 4 THEN s.stanumbers2 + WHEN s.stakind3 = 4 THEN s.stanumbers3 + WHEN s.stakind4 = 4 THEN s.stanumbers4 + WHEN s.stakind5 = 4 THEN s.stanumbers5 + END AS most_common_elem_freqs, + CASE + WHEN s.stakind1 = 5 THEN s.stanumbers1 + WHEN s.stakind2 = 5 THEN s.stanumbers2 + WHEN s.stakind3 = 5 THEN s.stanumbers3 + WHEN s.stakind4 = 5 THEN s.stanumbers4 + WHEN s.stakind5 = 5 THEN s.stanumbers5 + END AS elem_count_histogram + FROM + pg_class c + JOIN pg_attribute a ON c.oid = a.attrelid + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace, + pg_get_gtt_statistics(c.oid, a.attnum, ''::text) as s + WHERE c.relpersistence='g' AND c.relkind in('r','p') and NOT a.attisdropped AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND (c.relrowsecurity = false OR NOT row_security_active(c.oid)); + CREATE VIEW pg_stats WITH (security_barrier) AS SELECT nspname AS schemaname, diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index c4420dd..977a984 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -34,6 +34,7 @@ #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "commands/dbcommands.h" #include "commands/progress.h" #include "commands/tablecmds.h" @@ -103,7 +104,7 @@ static int acquire_inherited_sample_rows(Relation onerel, int elevel, HeapTuple *rows, int targrows, double *totalrows, double *totaldeadrows); static void update_attstats(Oid relid, bool inh, - int natts, VacAttrStats **vacattrstats); + int natts, VacAttrStats **vacattrstats, char relpersistence); static Datum std_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); @@ -586,14 +587,15 @@ do_analyze_rel(Relation onerel, VacuumParams *params, * pg_statistic for columns we didn't process, we leave them alone.) */ update_attstats(RelationGetRelid(onerel), inh, - attr_cnt, vacattrstats); + attr_cnt, vacattrstats, RelationGetRelPersistence(onerel)); for (ind = 0; ind < nindexes; ind++) { AnlIndexData *thisdata = &indexdata[ind]; update_attstats(RelationGetRelid(Irel[ind]), false, - thisdata->attr_cnt, thisdata->vacattrstats); + thisdata->attr_cnt, thisdata->vacattrstats, + RelationGetRelPersistence(Irel[ind])); } /* @@ -1456,7 +1458,7 @@ acquire_inherited_sample_rows(Relation onerel, int elevel, * by taking a self-exclusive lock on the relation in analyze_rel(). */ static void -update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) +update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats, char relpersistence) { Relation sd; int attno; @@ -1558,31 +1560,45 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) } } - /* Is there already a pg_statistic tuple for this attribute? */ - oldtup = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(relid), - Int16GetDatum(stats->attr->attnum), - BoolGetDatum(inh)); - - if (HeapTupleIsValid(oldtup)) + /* Update column statistic to localhash, not catalog */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) { - /* Yes, replace it */ - stup = heap_modify_tuple(oldtup, - RelationGetDescr(sd), - values, - nulls, - replaces); - ReleaseSysCache(oldtup); - CatalogTupleUpdate(sd, &stup->t_self, stup); + up_gtt_att_statistic(relid, + stats->attr->attnum, + inh, + natts, + RelationGetDescr(sd), + values, + nulls); } else { - /* No, insert new tuple */ - stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); - CatalogTupleInsert(sd, stup); - } + /* Is there already a pg_statistic tuple for this attribute? */ + oldtup = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(relid), + Int16GetDatum(stats->attr->attnum), + BoolGetDatum(inh)); - heap_freetuple(stup); + if (HeapTupleIsValid(oldtup)) + { + /* Yes, replace it */ + stup = heap_modify_tuple(oldtup, + RelationGetDescr(sd), + values, + nulls, + replaces); + ReleaseSysCache(oldtup); + CatalogTupleUpdate(sd, &stup->t_self, stup); + } + else + { + /* No, insert new tuple */ + stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); + CatalogTupleInsert(sd, stup); + } + + heap_freetuple(stup); + } } table_close(sd, RowExclusiveLock); diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index e9d7a7f..3088e26 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -391,6 +391,12 @@ cluster_rel(Oid tableOid, Oid indexOid, int options) errmsg("cannot vacuum temporary tables of other sessions"))); } + /* not support cluster global temp table yet */ + if (RELATION_IS_GLOBAL_TEMP(OldHeap)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("not support cluster global temporary tables yet"))); + /* * Also check for active uses of the relation in the current transaction, * including open scans and pending AFTER trigger events. diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index ec20ba3..a29cc00 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2614,6 +2614,16 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind, !isTempNamespace(classtuple->relnamespace)) continue; + /* not support reindex on global temp table, so skip it */ + if (classtuple->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + ereport(WARNING, + (errmsg("global temp table \"%s.%s\" skip reindexed", + get_namespace_name(get_rel_namespace(relid)), + get_rel_name(relid)))); + continue; + } + /* Check user/system classification, and optionally skip */ if (objectKind == REINDEX_OBJECT_SYSTEM && !IsSystemClass(relid, classtuple)) diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c index 329ab84..dfa257c 100644 --- a/src/backend/commands/lockcmds.c +++ b/src/backend/commands/lockcmds.c @@ -96,7 +96,8 @@ RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, * transaction. */ relpersistence = get_rel_persistence(relid); - if (relpersistence == RELPERSISTENCE_TEMP) + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPNAMESPACE; /* Check permissions. */ diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 6aab73b..44f350d 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -94,7 +94,7 @@ static HTAB *seqhashtab = NULL; /* hash table for SeqTable items */ */ static SeqTableData *last_used_seq = NULL; -static void fill_seq_with_data(Relation rel, HeapTuple tuple); +static void fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf); static Relation lock_and_open_sequence(SeqTable seq); static void create_seq_hashtable(void); static void init_sequence(Oid relid, SeqTable *p_elm, Relation *p_rel); @@ -108,6 +108,7 @@ static void init_params(ParseState *pstate, List *options, bool for_identity, List **owned_by); static void do_setval(Oid relid, int64 next, bool iscalled); static void process_owned_by(Relation seqrel, List *owned_by, bool for_identity); +int64 get_seqence_start_value(Oid seqid); /* @@ -222,7 +223,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq) /* now initialize the sequence's data */ tuple = heap_form_tuple(tupDesc, value, null); - fill_seq_with_data(rel, tuple); + fill_seq_with_data(rel, tuple, InvalidBuffer); /* process OWNED BY if given */ if (owned_by) @@ -327,7 +328,7 @@ ResetSequence(Oid seq_relid) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seq_rel, tuple); + fill_seq_with_data(seq_rel, tuple, InvalidBuffer); /* Clear local cache so that we don't think we have cached numbers */ /* Note that we do not change the currval() state */ @@ -340,17 +341,21 @@ ResetSequence(Oid seq_relid) * Initialize a sequence's relation with the specified tuple as content */ static void -fill_seq_with_data(Relation rel, HeapTuple tuple) +fill_seq_with_data(Relation rel, HeapTuple tuple, Buffer buf) { - Buffer buf; Page page; sequence_magic *sm; OffsetNumber offnum; + bool lockBuffer = false; /* Initialize first page of relation with special magic number */ - buf = ReadBuffer(rel, P_NEW); - Assert(BufferGetBlockNumber(buf) == 0); + if (buf == InvalidBuffer) + { + buf = ReadBuffer(rel, P_NEW); + Assert(BufferGetBlockNumber(buf) == 0); + lockBuffer = true; + } page = BufferGetPage(buf); @@ -360,7 +365,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) /* Now insert sequence tuple */ - LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); + if (lockBuffer) + LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); /* * Since VACUUM does not process sequences, we have to force the tuple to @@ -410,7 +416,8 @@ fill_seq_with_data(Relation rel, HeapTuple tuple) END_CRIT_SECTION(); - UnlockReleaseBuffer(buf); + if (lockBuffer) + UnlockReleaseBuffer(buf); } /* @@ -502,7 +509,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt) /* * Insert the modified tuple into the new storage file. */ - fill_seq_with_data(seqrel, newdatatuple); + fill_seq_with_data(seqrel, newdatatuple, InvalidBuffer); } /* process OWNED BY if given */ @@ -1178,6 +1185,25 @@ read_seq_tuple(Relation rel, Buffer *buf, HeapTuple seqdatatuple) LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); page = BufferGetPage(*buf); + if (GlobalTempRelationPageIsNotInitialized(rel, page)) + { + /* Initialize sequence for global temporary tables */ + Datum value[SEQ_COL_LASTCOL] = {0}; + bool null[SEQ_COL_LASTCOL] = {false}; + HeapTuple tuple; + int64 startv = get_seqence_start_value(RelationGetRelid(rel)); + + /* + * last_value from pg_sequence.seqstart + * log_cnt = 0 + * is_called = false + */ + value[SEQ_COL_LASTVAL-1] = Int64GetDatumFast(startv); /* start sequence with 1 */ + + tuple = heap_form_tuple(RelationGetDescr(rel), value, null); + fill_seq_with_data(rel, tuple, *buf); + heap_freetuple(tuple); + } sm = (sequence_magic *) PageGetSpecialPointer(page); if (sm->magic != SEQ_MAGIC) @@ -1954,3 +1980,23 @@ seq_mask(char *page, BlockNumber blkno) mask_unused_space(page); } + +int64 +get_seqence_start_value(Oid seqid) +{ + HeapTuple seqtuple; + Form_pg_sequence seqform; + int64 start; + + seqtuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(seqid)); + if (!HeapTupleIsValid(seqtuple)) + elog(ERROR, "cache lookup failed for sequence %u", + seqid); + + seqform = (Form_pg_sequence) GETSTRUCT(seqtuple); + start = seqform->seqstart; + ReleaseSysCache(seqtuple); + + return start; +} + diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 70589dd..81bd3e5 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -47,6 +47,7 @@ #include "catalog/storage.h" #include "catalog/storage_xlog.h" #include "catalog/toasting.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/comment.h" #include "commands/defrem.h" @@ -552,6 +553,7 @@ static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx, Relation partitionTbl); static List *GetParentedForeignKeyRefs(Relation partition); static void ATDetachCheckNoForeignKeyRefs(Relation partition); +static bool has_oncommit_option(List *options); /* ---------------------------------------------------------------- @@ -597,6 +599,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, LOCKMODE parentLockmode; const char *accessMethod = NULL; Oid accessMethodId = InvalidOid; + bool has_oncommit_clause = false; /* * Truncate relname to appropriate length (probably a waste of time, as @@ -607,8 +610,10 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Check consistency of arguments */ + /* global temp table same as local temp table */ if (stmt->oncommit != ONCOMMIT_NOOP - && stmt->relation->relpersistence != RELPERSISTENCE_TEMP) + && !(stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP)) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("ON COMMIT can only be used on temporary tables"))); @@ -638,7 +643,9 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, * code. This is needed because calling code might not expect untrusted * tables to appear in pg_temp at the front of its search path. */ - if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP + /* global temp table same as local temp table */ + if ((stmt->relation->relpersistence == RELPERSISTENCE_TEMP || + stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) && InSecurityRestrictedOperation()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -739,6 +746,57 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, /* * Parse and validate reloptions, if any. */ + /* global temp table */ + has_oncommit_clause = has_oncommit_option(stmt->options); + if (stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (relkind == RELKIND_RELATION || relkind == RELKIND_PARTITIONED_TABLE)) + { + /* inherit table or parition table inherit on commit property from parent table*/ + if (inheritOids && stmt->oncommit == ONCOMMIT_NOOP && !has_oncommit_clause) + { + Oid parent = linitial_oid(inheritOids); + Relation relation = table_open(parent, NoLock); + + if (!RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "The parent table must be global temporary table"); + + if (RELATION_GTT_ON_COMMIT_DELETE(relation)) + stmt->oncommit = ONCOMMIT_DELETE_ROWS; + else + stmt->oncommit = ONCOMMIT_PRESERVE_ROWS; + table_close(relation, NoLock); + } + + if (has_oncommit_clause) + { + if (stmt->oncommit != ONCOMMIT_NOOP) + elog(ERROR, "can not defeine global temp table with on commit and with clause at same time"); + } + else + { + DefElem *opt = makeNode(DefElem); + + opt->type = T_DefElem; + opt->defnamespace = NULL; + opt->defname = "on_commit_delete_rows"; + opt->defaction = DEFELEM_UNSPEC; + + /* use reloptions to remember on commit clause */ + if (stmt->oncommit == ONCOMMIT_DELETE_ROWS) + opt->arg = (Node *)makeString("true"); + else if (stmt->oncommit == ONCOMMIT_PRESERVE_ROWS) + opt->arg = (Node *)makeString("false"); + else if (stmt->oncommit == ONCOMMIT_NOOP) + opt->arg = (Node *)makeString("false"); + else + elog(ERROR, "global temp table not support on commit drop clause"); + + stmt->options = lappend(stmt->options, opt); + } + } + else if (has_oncommit_clause) + elog(ERROR, "regular table cannot specifie on_commit_delete_rows"); + reloptions = transformRelOptions((Datum) 0, stmt->options, NULL, validnsps, true, false); @@ -1816,7 +1874,8 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged, * table or the current physical file to be thrown away anyway. */ if (rel->rd_createSubid == mySubid || - rel->rd_newRelfilenodeSubid == mySubid) + rel->rd_newRelfilenodeSubid == mySubid || + RELATION_IS_GLOBAL_TEMP(rel)) { /* Immediate, non-rollbackable truncation is OK */ heap_truncate_one_rel(rel); @@ -3375,6 +3434,13 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo * specially. */ targetrelation = relation_open(myrelid, is_index ? ShareUpdateExclusiveLock : AccessExclusiveLock); + + if (RELATION_IS_GLOBAL_TEMP(targetrelation)) + { + if (is_other_backend_use_gtt(targetrelation->rd_node)) + elog(ERROR, "can not rename relation when other backend attached this global temp table"); + } + namespaceId = RelationGetNamespace(targetrelation); /* @@ -3550,6 +3616,13 @@ AlterTable(AlterTableStmt *stmt, LOCKMODE lockmode, /* Caller is required to provide an adequate lock. */ rel = relation_open(context->relid, NoLock); + /* We allow to alter global temp table only this session use it */ + if (RELATION_IS_GLOBAL_TEMP(rel)) + { + if (is_other_backend_use_gtt(rel->rd_node)) + elog(ERROR, "can not alter relation when other backend attached this global temp table"); + } + CheckTableNotInUse(rel, "ALTER TABLE"); ATController(stmt, rel, stmt->cmds, stmt->relation->inh, lockmode, context); @@ -8123,6 +8196,13 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, errmsg("referenced relation \"%s\" is not a table", RelationGetRelationName(pkrel)))); + /* global temp table not support foreign key constraint yet */ + if (RELATION_IS_GLOBAL_TEMP(pkrel)) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("referenced relation \"%s\" is not a global temp table", + RelationGetRelationName(pkrel)))); + if (!allowSystemTableMods && IsSystemRelation(pkrel)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), @@ -8162,6 +8242,12 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("constraints on temporary tables must involve temporary tables of this session"))); break; + /* global temp table not support foreign key constraint yet */ + case RELPERSISTENCE_GLOBAL_TEMP: + ereport(ERROR, + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + errmsg("not support foreign key constraints on global temp table yet"))); + break; } /* @@ -13199,7 +13285,7 @@ index_copy_data(Relation rel, RelFileNode newrnode) * NOTE: any conflict in relfilenode value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(newrnode, rel->rd_rel->relpersistence); + RelationCreateStorage(newrnode, rel->rd_rel->relpersistence, rel); /* copy main fork */ RelationCopyStorage(rel->rd_smgr, dstrel, MAIN_FORKNUM, @@ -14606,7 +14692,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged) */ switch (rel->rd_rel->relpersistence) { + /* global temp table same as local temp table */ case RELPERSISTENCE_TEMP: + case RELPERSISTENCE_GLOBAL_TEMP: ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), errmsg("cannot change logged status of table \"%s\" because it is temporary", @@ -17246,3 +17334,20 @@ ATDetachCheckNoForeignKeyRefs(Relation partition) table_close(rel, NoLock); } } + +static bool +has_oncommit_option(List *options) +{ + ListCell *listptr; + + foreach(listptr, options) + { + DefElem *def = (DefElem *) lfirst(listptr); + + if (pg_strcasecmp(def->defname, "on_commit_delete_rows") == 0) + return true; + } + + return false; +} + diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index d625d17..69ad24f 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -35,6 +35,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_inherits.h" #include "catalog/pg_namespace.h" +#include "catalog/storage_gtt.h" #include "commands/cluster.h" #include "commands/defrem.h" #include "commands/vacuum.h" @@ -1217,6 +1218,17 @@ vac_update_relstats(Relation relation, HeapTuple ctup; Form_pg_class pgcform; bool dirty; + bool is_gtt = false; + + /* global temp table remember relstats to localhash and rel->rd_rel, not catalog */ + if (RELATION_IS_GLOBAL_TEMP(relation)) + { + is_gtt = true; + up_gtt_relstats(relation, + num_pages, num_tuples, + num_all_visible_pages, + frozenxid, minmulti); + } rd = table_open(RelationRelationId, RowExclusiveLock); @@ -1230,17 +1242,26 @@ vac_update_relstats(Relation relation, /* Apply statistical updates, if any, to copied tuple */ dirty = false; - if (pgcform->relpages != (int32) num_pages) + + if (is_gtt) + relation->rd_rel->relpages = (int32) num_pages; + else if (pgcform->relpages != (int32) num_pages) { pgcform->relpages = (int32) num_pages; dirty = true; } - if (pgcform->reltuples != (float4) num_tuples) + + if (is_gtt) + relation->rd_rel->reltuples = (float4) num_tuples; + else if (pgcform->reltuples != (float4) num_tuples) { pgcform->reltuples = (float4) num_tuples; dirty = true; } - if (pgcform->relallvisible != (int32) num_all_visible_pages) + + if (is_gtt) + relation->rd_rel->relallvisible = (int32) num_all_visible_pages; + else if (pgcform->relallvisible != (int32) num_all_visible_pages) { pgcform->relallvisible = (int32) num_all_visible_pages; dirty = true; @@ -1285,7 +1306,8 @@ vac_update_relstats(Relation relation, * This should match vac_update_datfrozenxid() concerning what we consider * to be "in the future". */ - if (TransactionIdIsNormal(frozenxid) && + if (!is_gtt && + TransactionIdIsNormal(frozenxid) && pgcform->relfrozenxid != frozenxid && (TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) || TransactionIdPrecedes(ReadNewTransactionId(), @@ -1296,7 +1318,8 @@ vac_update_relstats(Relation relation, } /* Similarly for relminmxid */ - if (MultiXactIdIsValid(minmulti) && + if (!is_gtt && + MultiXactIdIsValid(minmulti) && pgcform->relminmxid != minmulti && (MultiXactIdPrecedes(pgcform->relminmxid, minmulti) || MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid))) @@ -1394,6 +1417,10 @@ vac_update_datfrozenxid(void) continue; } + /* global temp table relstats not in pg_class */ + if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + continue; + /* * Some table AMs might not need per-relation xid / multixid horizons. * It therefore seems reasonable to allow relfrozenxid and relminmxid @@ -1451,6 +1478,25 @@ vac_update_datfrozenxid(void) Assert(TransactionIdIsNormal(newFrozenXid)); Assert(MultiXactIdIsValid(newMinMulti)); + /* + * Global temp table get frozenxid from MyProc + * to avoid the vacuum truncate clog that gtt need. + */ + if (max_active_gtt > 0) + { + TransactionId oldest_gtt_frozenxid = + list_all_session_gtt_frozenxids(0, NULL, NULL, NULL); + + if (TransactionIdIsNormal(oldest_gtt_frozenxid) && + TransactionIdPrecedes(oldest_gtt_frozenxid, newFrozenXid)) + { + ereport(WARNING, + (errmsg("global temp table oldest FrozenXid is far in the past"), + errhint("please truncate them or kill those sessions that use them."))); + newFrozenXid = oldest_gtt_frozenxid; + } + } + /* Now fetch the pg_database tuple we need to update. */ relation = table_open(DatabaseRelationId, RowExclusiveLock); diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index ee5c3a6..0d7a2d4 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -787,6 +787,9 @@ ExecCheckXactReadOnly(PlannedStmt *plannedstmt) if (isTempNamespace(get_rel_namespace(rte->relid))) continue; + if (get_rel_persistence(rte->relid) == RELPERSISTENCE_GLOBAL_TEMP) + continue; + PreventCommandIfReadOnly(CreateCommandTag((Node *) plannedstmt)); } diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 8286d9c..c3992a4 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -591,6 +591,8 @@ static void set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) { + char relpersistence; + /* * The flag has previously been initialized to false, so we can just * return if it becomes clear that we can't safely set it. @@ -618,7 +620,11 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel, * the rest of the necessary infrastructure right now anyway. So * for now, bail out if we see a temporary table. */ - if (get_rel_persistence(rte->relid) == RELPERSISTENCE_TEMP) + /* global temp table is same as local temp table */ + relpersistence = get_rel_persistence(rte->relid); + + if (relpersistence == RELPERSISTENCE_TEMP || + relpersistence == RELPERSISTENCE_GLOBAL_TEMP) return; /* diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index d6f2153..310a9e2 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -6312,7 +6312,9 @@ plan_create_index_workers(Oid tableOid, Oid indexOid) * Furthermore, any index predicate or index expressions must be parallel * safe. */ + /* global temp table is same as local temp table */ if (heap->rd_rel->relpersistence == RELPERSISTENCE_TEMP || + heap->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP || !is_parallel_safe(root, (Node *) RelationGetIndexExpressions(index)) || !is_parallel_safe(root, (Node *) RelationGetIndexPredicate(index))) { diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 748bebf..a5ddbcd 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2579,6 +2579,11 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("materialized views must not use temporary tables or views"))); + if (is_query_using_gtt(query)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("materialized views must not use global temporary tables or views"))); + /* * A materialized view would either need to save parameters for use in * maintaining/loading the data or prohibit them entirely. The latter diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 1b0edf5..492639f 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3290,17 +3290,11 @@ OptTemp: TEMPORARY { $$ = RELPERSISTENCE_TEMP; } | LOCAL TEMP { $$ = RELPERSISTENCE_TEMP; } | GLOBAL TEMPORARY { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); - $$ = RELPERSISTENCE_TEMP; + $$ = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; } | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; } @@ -11591,19 +11585,13 @@ OptTempTableName: } | GLOBAL TEMPORARY opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | GLOBAL TEMP opt_table qualified_name { - ereport(WARNING, - (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition(@1))); $$ = $4; - $$->relpersistence = RELPERSISTENCE_TEMP; + $$->relpersistence = RELPERSISTENCE_GLOBAL_TEMP; } | UNLOGGED opt_table qualified_name { diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index b875a50..123945b 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -81,6 +81,7 @@ static void expandTupleDesc(TupleDesc tupdesc, Alias *eref, List **colnames, List **colvars); static int specialAttNum(const char *attname); static bool isQueryUsingTempRelation_walker(Node *node, void *context); +static bool is_query_using_gtt_walker(Node *node, void *context); /* @@ -3579,3 +3580,49 @@ isQueryUsingTempRelation_walker(Node *node, void *context) isQueryUsingTempRelation_walker, context); } + +/* check if the query uses global temp table */ +static bool +is_query_using_gtt_walker(Node *node, void *context) +{ + if (node == NULL) + return false; + + if (IsA(node, Query)) + { + Query *query = (Query *) node; + ListCell *rtable; + + foreach(rtable, query->rtable) + { + RangeTblEntry *rte = lfirst(rtable); + + if (rte->rtekind == RTE_RELATION) + { + Relation rel = relation_open(rte->relid, AccessShareLock); + char relpersistence = rel->rd_rel->relpersistence; + + relation_close(rel, AccessShareLock); + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + return true; + } + } + + return query_tree_walker(query, + is_query_using_gtt_walker, + context, + QTW_IGNORE_JOINALIASES); + } + + return expression_tree_walker(node, + is_query_using_gtt_walker, + context); +} + +/* check if the query uses global temp table */ +bool +is_query_using_gtt(Query *query) +{ + return is_query_using_gtt_walker((Node *) query, NULL); +} + diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index ee2d2b5..9c9abaa 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -437,6 +437,9 @@ generateSerialExtraStmts(CreateStmtContext *cxt, ColumnDef *column, seqstmt->sequence = makeRangeVar(snamespace, sname, -1); seqstmt->options = seqoptions; + if (cxt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + seqstmt->sequence->relpersistence = cxt->relation->relpersistence; + /* * If a sequence data type was specified, add it to the options. Prepend * to the list rather than append; in case a user supplied their own AS diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 6d1f28c..ed837d1 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2086,6 +2086,11 @@ do_autovacuum(void) } continue; } + else if (classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + { + /* autovacuum skip vacuum global temp table */ + continue; + } /* Fetch reloptions and the pgstat entry for this table */ relopts = extract_autovac_opts(tuple, pg_class_desc); @@ -2152,7 +2157,9 @@ do_autovacuum(void) /* * We cannot safely process other backends' temp tables, so skip 'em. */ - if (classForm->relpersistence == RELPERSISTENCE_TEMP) + /* autovacuum skip vacuum global temp table */ + if (classForm->relpersistence == RELPERSISTENCE_TEMP || + classForm->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) continue; relid = classForm->oid; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index aba3960..3c4b96c 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -37,6 +37,7 @@ #include "access/xlog.h" #include "catalog/catalog.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "executor/instrument.h" #include "lib/binaryheap.h" #include "miscadmin.h" @@ -52,6 +53,7 @@ #include "utils/rel.h" #include "utils/resowner_private.h" #include "utils/timestamp.h" +#include "utils/guc.h" /* Note: these two macros only work on shared buffers, not local ones! */ @@ -432,7 +434,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref) static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, - bool *hit); + bool *hit, Relation rel); static bool PinBuffer(BufferDesc *buf, BufferAccessStrategy strategy); static void PinBuffer_Locked(BufferDesc *buf); static void UnpinBuffer(BufferDesc *buf, bool fixOwner); @@ -664,7 +666,8 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, */ pgstat_count_buffer_read(reln); buf = ReadBuffer_common(reln->rd_smgr, reln->rd_rel->relpersistence, - forkNum, blockNum, mode, strategy, &hit); + forkNum, blockNum, mode, strategy, &hit, + reln); if (hit) pgstat_count_buffer_hit(reln); return buf; @@ -692,7 +695,7 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, Assert(InRecovery); return ReadBuffer_common(smgr, RELPERSISTENCE_PERMANENT, forkNum, blockNum, - mode, strategy, &hit); + mode, strategy, &hit, NULL); } @@ -704,7 +707,8 @@ ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, - BufferAccessStrategy strategy, bool *hit) + BufferAccessStrategy strategy, bool *hit, + Relation rel) { BufferDesc *bufHdr; Block bufBlock; @@ -719,6 +723,15 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, isExtend = (blockNum == P_NEW); + /* create storage when first read data page for gtt */ + if (relpersistence == RELPERSISTENCE_GLOBAL_TEMP && + (isExtend || blockNum == 0) && + forkNum == MAIN_FORKNUM && + !gtt_storage_attached(smgr->smgr_rnode.node.relNode)) + { + RelationCreateStorage(smgr->smgr_rnode.node, relpersistence, rel); + } + TRACE_POSTGRESQL_BUFFER_READ_START(forkNum, blockNum, smgr->smgr_rnode.node.spcNode, smgr->smgr_rnode.node.dbNode, @@ -2809,6 +2822,16 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln) BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum) { + /* + * When this backend not init gtt storage + * return 0 + */ + if (RELATION_IS_GLOBAL_TEMP(relation) && + !gtt_storage_attached(relation->rd_node.relNode)) + { + return 0; + } + switch (relation->rd_rel->relkind) { case RELKIND_SEQUENCE: diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c index 427b0d5..7adb969 100644 --- a/src/backend/storage/ipc/ipci.c +++ b/src/backend/storage/ipc/ipci.c @@ -21,6 +21,7 @@ #include "access/nbtree.h" #include "access/subtrans.h" #include "access/twophase.h" +#include "catalog/storage_gtt.h" #include "commands/async.h" #include "miscadmin.h" #include "pgstat.h" @@ -147,6 +148,7 @@ CreateSharedMemoryAndSemaphores(void) size = add_size(size, BTreeShmemSize()); size = add_size(size, SyncScanShmemSize()); size = add_size(size, AsyncShmemSize()); + size = add_size(size, active_gtt_shared_hash_size()); #ifdef EXEC_BACKEND size = add_size(size, ShmemBackendArraySize()); #endif @@ -217,6 +219,8 @@ CreateSharedMemoryAndSemaphores(void) SUBTRANSShmemInit(); MultiXactShmemInit(); InitBufferPool(); + /* global temporary table */ + active_gtt_shared_hash_init(); /* * Set up lock manager diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index c3adb2e..eb95e5f 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -62,6 +62,7 @@ #include "utils/builtins.h" #include "utils/rel.h" #include "utils/snapmgr.h" +#include "utils/guc.h" #define UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) @@ -4087,3 +4088,77 @@ KnownAssignedXidsReset(void) LWLockRelease(ProcArrayLock); } + +/* + * search all active backend to get oldest frozenxid + * for global temp table. + */ +int +list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n) +{ + ProcArrayStruct *arrayP = procArray; + TransactionId result = InvalidTransactionId; + int index; + int flags = 0; + int i = 0; + + if (max_active_gtt <= 0) + return 0; + + if (max_size > 0) + { + Assert(pids); + Assert(xids); + Assert(n); + *n = 0; + } + + if (max_active_gtt <= 0) + return InvalidTransactionId; + + if (RecoveryInProgress()) + return InvalidTransactionId; + + flags |= PROC_IS_AUTOVACUUM; + flags |= PROC_IN_LOGICAL_DECODING; + + LWLockAcquire(ProcArrayLock, LW_SHARED); + if (max_size > 0 && max_size < arrayP->numProcs) + { + LWLockRelease(ProcArrayLock); + elog(ERROR, "list_all_gtt_frozenxids require more array"); + } + + for (index = 0; index < arrayP->numProcs; index++) + { + int pgprocno = arrayP->pgprocnos[index]; + volatile PGPROC *proc = &allProcs[pgprocno]; + volatile PGXACT *pgxact = &allPgXact[pgprocno]; + + if (pgxact->vacuumFlags & flags) + continue; + + if (proc->databaseId == MyDatabaseId && + TransactionIdIsNormal(proc->session_gtt_frozenxid)) + { + if (result == InvalidTransactionId) + result = proc->session_gtt_frozenxid; + else if (TransactionIdPrecedes(proc->session_gtt_frozenxid, result)) + result = proc->session_gtt_frozenxid; + + if (max_size > 0) + { + pids[i] = proc->pid; + xids[i] = proc->session_gtt_frozenxid; + i++; + } + } + } + LWLockRelease(ProcArrayLock); + + if (max_size > 0) + *n = i; + + return result; +} + diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 32df8c8..e4e1125 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -395,6 +395,7 @@ InitProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; @@ -577,6 +578,7 @@ InitAuxiliaryProcess(void) MyProc->databaseId = InvalidOid; MyProc->roleId = InvalidOid; MyProc->tempNamespaceId = InvalidOid; + MyProc->session_gtt_frozenxid = InvalidTransactionId; /* init session level gtt frozenxid */ MyProc->isBackgroundWorker = IsBackgroundWorker; MyPgXact->delayChkpt = false; MyPgXact->vacuumFlags = 0; diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index c5b771c..e7725ce 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -646,6 +646,12 @@ mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, */ if (zero_damaged_pages || InRecovery) MemSet(buffer, 0, BLCKSZ); + else if(SmgrIsTemp(reln) && blocknum == 0 && forknum == MAIN_FORKNUM) + { + /* global temp table init btree meta page */ + MemSet(buffer, 0, BLCKSZ); + mdwrite(reln, forknum, blocknum, buffer, true); + } else ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c index 8406644..0d99321 100644 --- a/src/backend/utils/adt/dbsize.c +++ b/src/backend/utils/adt/dbsize.c @@ -1008,6 +1008,9 @@ pg_relation_filepath(PG_FUNCTION_ARGS) Assert(backend != InvalidBackendId); } break; + case RELPERSISTENCE_GLOBAL_TEMP: + backend = BackendIdForTempRelations(); + break; default: elog(ERROR, "invalid relpersistence: %c", relform->relpersistence); backend = InvalidBackendId; /* placate compiler */ diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 7c6f057..eb10cf2 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -112,6 +112,7 @@ #include "catalog/pg_operator.h" #include "catalog/pg_statistic.h" #include "catalog/pg_statistic_ext.h" +#include "catalog/storage_gtt.h" #include "executor/nodeAgg.h" #include "miscadmin.h" #include "nodes/makefuncs.h" @@ -4578,12 +4579,25 @@ examine_variable(PlannerInfo *root, Node *node, int varRelid, } else if (index->indpred == NIL) { - vardata->statsTuple = - SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(index->indexoid), - Int16GetDatum(pos + 1), - BoolGetDatum(false)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(index->indexoid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = + get_gtt_att_statistic(index->indexoid, + Int16GetDatum(pos + 1), + false); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + vardata->statsTuple = + SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(index->indexoid), + Int16GetDatum(pos + 1), + BoolGetDatum(false)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -4708,15 +4722,27 @@ examine_simple_variable(PlannerInfo *root, Var *var, } else if (rte->rtekind == RTE_RELATION) { - /* - * Plain table or parent of an inheritance appendrel, so look up the - * column in pg_statistic - */ - vardata->statsTuple = SearchSysCache3(STATRELATTINH, - ObjectIdGetDatum(rte->relid), - Int16GetDatum(var->varattno), - BoolGetDatum(rte->inh)); - vardata->freefunc = ReleaseSysCache; + char rel_persistence = get_rel_persistence(rte->relid); + + if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata->statsTuple = get_gtt_att_statistic(rte->relid, + var->varattno, + rte->inh); + vardata->freefunc = release_gtt_statistic_cache; + } + else + { + /* + * Plain table or parent of an inheritance appendrel, so look up the + * column in pg_statistic + */ + vardata->statsTuple = SearchSysCache3(STATRELATTINH, + ObjectIdGetDatum(rte->relid), + Int16GetDatum(var->varattno), + BoolGetDatum(rte->inh)); + vardata->freefunc = ReleaseSysCache; + } if (HeapTupleIsValid(vardata->statsTuple)) { @@ -6098,6 +6124,7 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, { /* Simple variable --- look to stats for the underlying table */ RangeTblEntry *rte = planner_rt_fetch(index->rel->relid, root); + char rel_persistence = get_rel_persistence(rte->relid); Assert(rte->rtekind == RTE_RELATION); relid = rte->relid; @@ -6115,6 +6142,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + rte->inh); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -6126,6 +6160,8 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* Expression --- maybe there are stats for the index itself */ relid = index->indexoid; colnum = 1; @@ -6141,6 +6177,13 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = get_gtt_att_statistic(relid, + colnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, @@ -7054,6 +7097,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, /* attempt to lookup stats in relation for this index column */ if (attnum != 0) { + char rel_persistence = get_rel_persistence(rte->relid); + /* Simple variable -- look to stats for the underlying table */ if (get_relation_stats_hook && (*get_relation_stats_hook) (root, rte, attnum, &vardata)) @@ -7066,6 +7111,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(rte->relid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = @@ -7078,6 +7131,8 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, } else { + char rel_persistence = get_rel_persistence(index->indexoid); + /* * Looks like we've found an expression column in the index. Let's * see if there's any stats for it. @@ -7097,6 +7152,14 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, !vardata.freefunc) elog(ERROR, "no function provided to release variable stats with"); } + else if (rel_persistence == RELPERSISTENCE_GLOBAL_TEMP) + { + vardata.statsTuple = + get_gtt_att_statistic(index->indexoid, + attnum, + false); + vardata.freefunc = release_gtt_statistic_cache; + } else { vardata.statsTuple = SearchSysCache3(STATRELATTINH, diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 1e3e6d3..345e3e9 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -34,6 +34,7 @@ #include "catalog/pg_statistic.h" #include "catalog/pg_transform.h" #include "catalog/pg_type.h" +#include "catalog/storage_gtt.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "utils/array.h" @@ -2878,6 +2879,18 @@ get_attavgwidth(Oid relid, AttrNumber attnum) if (stawidth > 0) return stawidth; } + if (get_rel_persistence(relid) == RELPERSISTENCE_GLOBAL_TEMP) + { + tp = get_gtt_att_statistic(relid, attnum, false); + if (!HeapTupleIsValid(tp)) + return 0; + + stawidth = ((Form_pg_statistic) GETSTRUCT(tp))->stawidth; + if (stawidth > 0) + return stawidth; + else + return 0; + } tp = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(relid), Int16GetDatum(attnum), diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index df025a5..8df9c7c 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -63,6 +63,7 @@ #include "catalog/pg_type.h" #include "catalog/schemapg.h" #include "catalog/storage.h" +#include "catalog/storage_gtt.h" #include "commands/policy.h" #include "commands/trigger.h" #include "miscadmin.h" @@ -1124,6 +1125,29 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) relation->rd_islocaltemp = false; } break; + case RELPERSISTENCE_GLOBAL_TEMP: + { + BlockNumber relpages = 0; + double reltuples = 0; + BlockNumber relallvisible = 0; + + relation->rd_backend = BackendIdForTempRelations(); + /* + * For global temp table, all backend can use + * this relation, so rd_islocaltemp is true + * in every backend. + */ + relation->rd_islocaltemp = true; + get_gtt_relstats(RelationGetRelid(relation), + &relpages, + &reltuples, + &relallvisible, + NULL, NULL); + relation->rd_rel->relpages = (int32)relpages; + relation->rd_rel->reltuples = (float4)reltuples; + relation->rd_rel->relallvisible = (int32)relallvisible; + } + break; default: elog(ERROR, "invalid relpersistence: %c", relation->rd_rel->relpersistence); @@ -1178,6 +1202,7 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) case RELKIND_PARTITIONED_INDEX: Assert(relation->rd_rel->relam != InvalidOid); RelationInitIndexAccessInfo(relation); + gtt_fix_index_state(relation); break; case RELKIND_RELATION: case RELKIND_TOASTVALUE: @@ -2217,6 +2242,8 @@ RelationReloadIndexInfo(Relation relation) HeapTupleHeaderGetXmin(tuple->t_data)); ReleaseSysCache(tuple); + + gtt_fix_index_state(relation); } /* Okay, now it's valid again */ @@ -3313,6 +3340,15 @@ RelationBuildLocalRelation(const char *relname, rel->rd_backend = BackendIdForTempRelations(); rel->rd_islocaltemp = true; break; + case RELPERSISTENCE_GLOBAL_TEMP: + rel->rd_backend = BackendIdForTempRelations(); + /* + * For global temp table, all backend can use + * this relation, so rd_islocaltemp is true + * in every backend. + */ + rel->rd_islocaltemp = true; + break; default: elog(ERROR, "invalid relpersistence: %c", relpersistence); break; @@ -3427,6 +3463,9 @@ RelationSetNewRelfilenode(Relation relation, char persistence) TransactionId freezeXid = InvalidTransactionId; RelFileNode newrnode; + if (RELATION_IS_GLOBAL_TEMP(relation)) + elog(ERROR, "global temp table does not allow setting new relfilenode"); + /* Allocate a new relfilenode */ newrelfilenode = GetNewRelFileNode(relation->rd_rel->reltablespace, NULL, persistence); @@ -3467,7 +3506,7 @@ RelationSetNewRelfilenode(Relation relation, char persistence) /* handle these directly, at least for now */ SMgrRelation srel; - srel = RelationCreateStorage(newrnode, persistence); + srel = RelationCreateStorage(newrnode, persistence, relation); smgrclose(srel); } break; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index cacbe90..9c4220b 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -140,6 +140,18 @@ char *GUC_check_errmsg_string; char *GUC_check_errdetail_string; char *GUC_check_errhint_string; +/* + * num = 0 means disable global temp table feature. + * global temp table define can still storage in catalog + * just can not use. + * num > 0 means database can management num active global temp table. + */ +#define MIN_NUM_ACTIVE_GTT 0 +#define DEFAULT_NUM_ACTIVE_GTT 1000 +#define MAX_NUM_ACTIVE_GTT 1000000 + +int max_active_gtt = MIN_NUM_ACTIVE_GTT; + static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3, 4); static void set_config_sourcefile(const char *name, char *sourcefile, @@ -2012,6 +2024,15 @@ static struct config_bool ConfigureNamesBool[] = static struct config_int ConfigureNamesInt[] = { { + {"max_active_global_temporary_table", PGC_POSTMASTER, UNGROUPED, + gettext_noop("max active global temporary table."), + NULL + }, + &max_active_gtt, + DEFAULT_NUM_ACTIVE_GTT, MIN_NUM_ACTIVE_GTT, MAX_NUM_ACTIVE_GTT, + NULL, NULL, NULL + }, + { {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Forces a switch to the next WAL file if a " "new file has not been started within N seconds."), diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index ec3e2c6..d3697d2 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15583,6 +15583,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) { char *ftoptions = NULL; char *srvname = NULL; + char *table_type = NULL; switch (tbinfo->relkind) { @@ -15634,9 +15635,15 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) binary_upgrade_set_pg_class_oids(fout, q, tbinfo->dobj.catId.oid, false); + if (tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED) + table_type = "UNLOGGED "; + else if (tbinfo->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + table_type = "GLOBAL TEMPORARY "; + else + table_type = ""; + appendPQExpBuffer(q, "CREATE %s%s %s", - tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ? - "UNLOGGED " : "", + table_type, reltypename, qualrelname); diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index f3c7eb9..28134e2 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3723,7 +3723,8 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys if (pset.sversion >= 90100) { appendPQExpBuffer(&buf, - ",\n CASE c.relpersistence WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + ",\n CASE c.relpersistence WHEN 'g' THEN '%s' WHEN 'p' THEN '%s' WHEN 't' THEN '%s' WHEN 'u' THEN '%s' END as \"%s\"", + gettext_noop("session"), gettext_noop("permanent"), gettext_noop("temporary"), gettext_noop("unlogged"), diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index dc03fbd..8bd6d09 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -1016,6 +1016,8 @@ static const pgsql_thing_t words_after_create[] = { {"FOREIGN TABLE", NULL, NULL, NULL}, {"FUNCTION", NULL, NULL, Query_for_list_of_functions}, {"GROUP", Query_for_list_of_roles}, + {"GLOBAL", NULL, NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE GLOBAL TEMP/TEMPORARY TABLE + * ... */ {"INDEX", NULL, NULL, &Query_for_list_of_indexes}, {"LANGUAGE", Query_for_list_of_languages}, {"LARGE OBJECT", NULL, NULL, NULL, THING_NO_CREATE | THING_NO_DROP}, @@ -2378,6 +2380,9 @@ psql_completion(const char *text, int start, int end) /* CREATE FOREIGN DATA WRAPPER */ else if (Matches("CREATE", "FOREIGN", "DATA", "WRAPPER", MatchAny)) COMPLETE_WITH("HANDLER", "VALIDATOR", "OPTIONS"); + /* CREATE GLOBAL TEMP/TEMPORARY*/ + else if (Matches("CREATE", "GLOBAL")) + COMPLETE_WITH("TEMP", "TEMPORARY"); /* CREATE INDEX --- is allowed inside CREATE SCHEMA, so use TailMatches */ /* First off we complete CREATE UNIQUE with "INDEX" */ @@ -2586,6 +2591,8 @@ psql_completion(const char *text, int start, int end) /* Complete "CREATE TEMP/TEMPORARY" with the possible temp objects */ else if (TailMatches("CREATE", "TEMP|TEMPORARY")) COMPLETE_WITH("SEQUENCE", "TABLE", "VIEW"); + else if (TailMatches("CREATE", "GLOBAL", "TEMP|TEMPORARY")) + COMPLETE_WITH("TABLE"); /* Complete "CREATE UNLOGGED" with TABLE or MATVIEW */ else if (TailMatches("CREATE", "UNLOGGED")) COMPLETE_WITH("TABLE", "MATERIALIZED VIEW"); diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index a12fc1f..78958e4 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -165,6 +165,7 @@ typedef FormData_pg_class *Form_pg_class; #define RELPERSISTENCE_PERMANENT 'p' /* regular table */ #define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */ #define RELPERSISTENCE_TEMP 't' /* temporary table */ +#define RELPERSISTENCE_GLOBAL_TEMP 'g' /* global temporary table */ /* default selection for replica identity (primary key or nothing) */ #define REPLICA_IDENTITY_DEFAULT 'd' diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 2228256..4d5d13a 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5504,6 +5504,40 @@ proparallel => 'r', prorettype => 'float8', proargtypes => 'oid', prosrc => 'pg_stat_get_xact_function_self_time' }, +# For global temporary table +{ oid => '4191', + descr => 'List local statistics for global temporary table', + proname => 'pg_get_gtt_statistics', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid int4 anyelement', + proallargtypes => '{oid,int4,anyelement,oid,int2,bool,float4,int4,float4,int2,int2,int2,int2,int2,oid,oid,oid,oid,oid,oid,oid,oid,oid,oid,_float4,_float4,_float4,_float4,_float4,anyarray,anyarray,anyarray,anyarray,anyarray}', + proargmodes => '{i,i,i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}', + proargnames => '{relid,att,x,starelid,staattnum,stainherit,stanullfrac,stawidth,stadistinct,stakind1,stakind2,stakind3,stakind4,stakind5,staop1,staop2,staop3,staop4,staop5,stacoll1,stacoll2,stacoll3,stacoll4,stacoll5,stanumbers1,stanumbers2,stanumbers3,stanumbers4,stanumbers5,stavalues1,stavalues2,stavalues3,stavalues4,stavalues5}', + prosrc => 'pg_get_gtt_statistics' }, +{ oid => '4192', + descr => 'List local relstats for global temporary table', + proname => 'pg_get_gtt_relstats', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,int4,float4,int4,xid,xid}', + proargmodes => '{i,o,o,o,o,o}', + proargnames => '{relid,relpages,reltuples,relallvisible,relfrozenxid,relminmxid}', + prosrc => 'pg_get_gtt_relstats' }, +{ oid => '4193', + descr => 'List attached pid for one global temporary table', + proname => 'pg_gtt_attached_pid', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => 'oid', + proallargtypes => '{oid,oid,int4}', + proargmodes => '{i,o,o}', + proargnames => '{relid,relid,pid}', + prosrc => 'pg_gtt_attached_pid' }, +{ oid => '4194', + descr => 'List those backends that have used global temporary table', + proname => 'pg_list_gtt_relfrozenxids', provolatile => 'v', proparallel => 'u', + prorettype => 'record', proretset => 't', prorows => '10', proargtypes => '', + proallargtypes => '{int4,xid}', + proargmodes => '{o,o}', + proargnames => '{pid,relfrozenxid}', + prosrc => 'pg_list_gtt_relfrozenxids' }, + { oid => '3788', descr => 'statistics: timestamp of the current statistics snapshot', proname => 'pg_stat_get_snapshot_timestamp', provolatile => 's', diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h index 048003c..af48cdf 100644 --- a/src/include/catalog/storage.h +++ b/src/include/catalog/storage.h @@ -19,7 +19,7 @@ #include "storage/smgr.h" #include "utils/relcache.h" -extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence); +extern SMgrRelation RelationCreateStorage(RelFileNode rnode, char relpersistence, Relation rel); extern void RelationDropStorage(Relation rel); extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit); extern void RelationTruncate(Relation rel, BlockNumber nblocks); diff --git a/src/include/catalog/storage_gtt.h b/src/include/catalog/storage_gtt.h new file mode 100644 index 0000000..aa80cb5 --- /dev/null +++ b/src/include/catalog/storage_gtt.h @@ -0,0 +1,41 @@ +/*------------------------------------------------------------------------- + * + * storage_gtt.h + * prototypes for functions in backend/catalog/storage_gtt.c + * + * src/include/catalog/storage_gtt.h + * + *------------------------------------------------------------------------- + */ +#ifndef STORAGE_GTT_H +#define STORAGE_GTT_H + +#include "access/htup.h" +#include "storage/block.h" +#include "storage/relfilenode.h" +#include "utils/relcache.h" + +extern Size active_gtt_shared_hash_size(void); +extern void active_gtt_shared_hash_init(void); +extern void remember_gtt_storage_info(RelFileNode rnode, Relation rel); +extern void forget_gtt_storage_info(Oid relid); +extern bool is_other_backend_use_gtt(RelFileNode node); +extern bool gtt_storage_attached(Oid relid); +extern Bitmapset *copy_active_gtt_bitmap(RelFileNode node); +extern void up_gtt_att_statistic(Oid reloid, int attnum, bool inh, int natts, + TupleDesc tupleDescriptor, Datum *values, bool *isnull); +extern HeapTuple get_gtt_att_statistic(Oid reloid, int attnum, bool inh); +extern void release_gtt_statistic_cache(HeapTuple tup); +extern void up_gtt_relstats(Relation relation, + BlockNumber num_pages, + double num_tuples, + BlockNumber num_all_visible_pages, + TransactionId relfrozenxid, + TransactionId relminmxid); +extern bool get_gtt_relstats(Oid relid, BlockNumber *relpages, double *reltuples, + BlockNumber *relallvisible, TransactionId *relfrozenxid, + TransactionId *relminmxid); +extern void gtt_force_enable_index(Relation index); +extern void gtt_fix_index_state(Relation index); + +#endif /* STORAGE_H */ diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index 93f9446..14cafae 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -120,4 +120,7 @@ extern Oid attnumTypeId(Relation rd, int attid); extern Oid attnumCollationId(Relation rd, int attid); extern bool isQueryUsingTempRelation(Query *query); +/* global temp table check */ +extern bool is_query_using_gtt(Query *query); + #endif /* PARSE_RELATION_H */ diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 870ecb5..92c590e 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -405,6 +405,8 @@ do { \ #define PageClearPrunable(page) \ (((PageHeader) (page))->pd_prune_xid = InvalidTransactionId) +#define GlobalTempRelationPageIsNotInitialized(rel, page) \ + ((rel)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP && PageIsNew(page)) /* ---------------------------------------------------------------- * extern declarations diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 8fda8e4..172eae9 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -220,6 +220,7 @@ typedef enum BuiltinTrancheIds LWTRANCHE_TBM, LWTRANCHE_PARALLEL_APPEND, LWTRANCHE_SXACT, + LWTRANCHE_GTT_CTL, LWTRANCHE_FIRST_USER_DEFINED } BuiltinTrancheIds; diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index d217801..8adde87 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -117,6 +117,8 @@ struct PGPROC Oid tempNamespaceId; /* OID of temp schema this backend is * using */ + TransactionId session_gtt_frozenxid; /* session level global temp table relfrozenxid */ + bool isBackgroundWorker; /* true if background worker. */ /* diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index a5c7d0c..a86f61f 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -125,4 +125,6 @@ extern void ProcArraySetReplicationSlotXmin(TransactionId xmin, extern void ProcArrayGetReplicationSlotXmin(TransactionId *xmin, TransactionId *catalog_xmin); +extern int list_all_session_gtt_frozenxids(int max_size, int *pids, uint32 *xids, int *n); + #endif /* PROCARRAY_H */ diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index ce93ace..0f7262e 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -281,6 +281,10 @@ extern int tcp_user_timeout; extern bool trace_sort; #endif +/* global temporary table */ +extern int max_active_gtt; +/* end */ + /* * Functions exported by guc.c */ diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 44ed04d..b308cb8 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -57,7 +57,7 @@ typedef struct RelationData struct SMgrRelationData *rd_smgr; /* cached file handle, or NULL */ int rd_refcnt; /* reference count */ BackendId rd_backend; /* owning backend id, if temporary relation */ - bool rd_islocaltemp; /* rel is a temp rel of this session */ + bool rd_islocaltemp; /* rel is a temp rel of this session */ bool rd_isnailed; /* rel is nailed in cache */ bool rd_isvalid; /* relcache entry is valid */ bool rd_indexvalid; /* is rd_indexlist valid? (also rd_pkindex and @@ -277,6 +277,7 @@ typedef struct StdRdOptions int parallel_workers; /* max number of parallel workers */ bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */ bool vacuum_truncate; /* enables vacuum to truncate a relation */ + bool on_commit_delete_rows; /* global temp table */ } StdRdOptions; #define HEAP_MIN_FILLFACTOR 10 @@ -535,11 +536,13 @@ typedef struct ViewOptions * True if relation's pages are stored in local buffers. */ #define RelationUsesLocalBuffers(relation) \ - ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) + ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP || \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) /* * RELATION_IS_LOCAL - * If a rel is either temp or newly created in the current transaction, + * If a rel is either local temp or global temp relation + * or newly created in the current transaction, * it can be assumed to be accessible only to the current backend. * This is typically used to decide that we can skip acquiring locks. * @@ -602,6 +605,17 @@ typedef struct ViewOptions RelationNeedsWAL(relation) && \ !IsCatalogRelation(relation)) +/* global temp table implementations */ +#define RELATION_IS_GLOBAL_TEMP(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) + +#define RELATION_GTT_ON_COMMIT_DELETE(relation) \ + ((relation)->rd_options && \ + ((relation)->rd_rel->relkind == RELKIND_RELATION || (relation)->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) && \ + (relation)->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP ? \ + ((StdRdOptions *) (relation)->rd_options)->on_commit_delete_rows : false) + +#define RelationGetRelPersistence(relation) ((relation)->rd_rel->relpersistence) + /* routines in utils/cache/relcache.c */ extern void RelationIncrementReferenceCount(Relation rel); extern void RelationDecrementReferenceCount(Relation rel); diff --git a/src/test/regress/expected/gtt_clean.out b/src/test/regress/expected/gtt_clean.out new file mode 100644 index 0000000..50ca9ac --- /dev/null +++ b/src/test/regress/expected/gtt_clean.out @@ -0,0 +1,7 @@ +reset search_path; +drop schema gtt cascade; +NOTICE: drop cascades to 4 other objects +DETAIL: drop cascades to table gtt.gtt1 +drop cascades to table gtt.gtt2 +drop cascades to table gtt.gtt3 +drop cascades to table gtt.gtt_t_kenyon diff --git a/src/test/regress/expected/gtt_function.out b/src/test/regress/expected/gtt_function.out new file mode 100644 index 0000000..e21e540 --- /dev/null +++ b/src/test/regress/expected/gtt_function.out @@ -0,0 +1,282 @@ +CREATE SCHEMA IF NOT EXISTS gtt_function; +set search_path=gtt_function,sys; +create global temp table gtt1(a int primary key, b text); +create global temp table gtt_test_rename(a int primary key, b text); +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); +ERROR: cannot create indexes on global temporary tables using concurrent mode +-- ERROR +cluster gtt1 using gtt1_pkey; +ERROR: not support cluster global temporary tables yet +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; +ERROR: ON COMMIT can only be used on temporary tables +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); +ERROR: regular table cannot specifie on_commit_delete_rows +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; + count +------- + 2 +(1 row) + +commit; +select count(*) from p_table01; + count +------- + 0 +(1 row) + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +ERROR: The parent table must be global temporary table +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + relname | relkind | relpersistence | reloptions +---------------------------------+---------+----------------+------------------------------- + p_table01 | p | g | {on_commit_delete_rows=true} + p_table01_2017 | r | g | {on_commit_delete_rows=true} + p_table01_2018 | r | g | {on_commit_delete_rows=true} + p_table01_id_seq | S | g | + p_table02 | p | g | {on_commit_delete_rows=false} + p_table02_2017 | r | g | {on_commit_delete_rows=false} + p_table02_2018 | r | g | {on_commit_delete_rows=false} + p_table02_id_seq | S | g | + tbl_inherits_parent | r | p | + tbl_inherits_parent_global_temp | r | g | {on_commit_delete_rows=true} + tbl_inherits_partition | r | g | {on_commit_delete_rows=true} +(11 rows) + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; +ERROR: global temp table not support on commit drop clause +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; +ERROR: can not defeine global temp table with on commit and with clause at same time +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); +--ok +alter table gtt_test_rename rename to gtt_test; +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); +ERROR: referenced relation "products" is not a global temp table +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; + id | a +----+--- + 2 | 1 + 3 | 2 +(2 rows) + +truncate gtt_seq; +select * from gtt_seq order by id; + id | a +----+--- +(0 rows) + +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + id | a +----+--- + 4 | 3 +(1 row) + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; +ERROR: materialized views must not use global temporary tables or views +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +ERROR: only support btree index on global temp table +create index idx_err on gtt1 using gist (a); +ERROR: data type integer has no default operator class for access method "gist" +HINT: You must specify an operator class for the index or define a default operator class for the data type. +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +ERROR: only support btree index on global temp table +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); +ERROR: only support btree index on global temp table +--ok +create global temp table gt (a SERIAL,b int); +begin; +set transaction_read_only = true; +insert into gt (b) values(1); +select * from gt; + a | b +---+--- + 1 | 1 +(1 row) + +commit; +--ok +create global temp table gt1(a int); +insert into gt1 values(generate_series(1,100000)); +create index idx_gt1_1 on gt1 (a); +create index idx_gt1_2 on gt1((a + 1)); +create index idx_gt1_3 on gt1((a*10),(a+a),(a-1)); +explain select * from gt1 where a=1; + QUERY PLAN +--------------------------------------------------------------------------- + Bitmap Heap Scan on gt1 (cost=12.17..482.50 rows=500 width=4) + Recheck Cond: (a = 1) + -> Bitmap Index Scan on idx_gt1_1 (cost=0.00..12.04 rows=500 width=0) + Index Cond: (a = 1) +(4 rows) + +explain select * from gt1 where a=200000; + QUERY PLAN +--------------------------------------------------------------------------- + Bitmap Heap Scan on gt1 (cost=12.17..482.50 rows=500 width=4) + Recheck Cond: (a = 200000) + -> Bitmap Index Scan on idx_gt1_1 (cost=0.00..12.04 rows=500 width=0) + Index Cond: (a = 200000) +(4 rows) + +explain select * from gt1 where a*10=300; + QUERY PLAN +--------------------------------------------------------------------------- + Bitmap Heap Scan on gt1 (cost=12.29..483.88 rows=500 width=4) + Recheck Cond: ((a * 10) = 300) + -> Bitmap Index Scan on idx_gt1_3 (cost=0.00..12.17 rows=500 width=0) + Index Cond: ((a * 10) = 300) +(4 rows) + +explain select * from gt1 where a*10=3; + QUERY PLAN +--------------------------------------------------------------------------- + Bitmap Heap Scan on gt1 (cost=12.29..483.88 rows=500 width=4) + Recheck Cond: ((a * 10) = 3) + -> Bitmap Index Scan on idx_gt1_3 (cost=0.00..12.17 rows=500 width=0) + Index Cond: ((a * 10) = 3) +(4 rows) + +analyze gt1; +explain select * from gt1 where a=1; + QUERY PLAN +-------------------------------------------------------------------------- + Index Only Scan using idx_gt1_1 on gt1 (cost=0.29..8.31 rows=1 width=4) + Index Cond: (a = 1) +(2 rows) + +explain select * from gt1 where a=200000; + QUERY PLAN +-------------------------------------------------------------------------- + Index Only Scan using idx_gt1_1 on gt1 (cost=0.29..8.31 rows=1 width=4) + Index Cond: (a = 200000) +(2 rows) + +explain select * from gt1 where a*10=300; + QUERY PLAN +--------------------------------------------------------------------- + Index Scan using idx_gt1_3 on gt1 (cost=0.42..8.44 rows=1 width=4) + Index Cond: ((a * 10) = 300) +(2 rows) + +explain select * from gt1 where a*10=3; + QUERY PLAN +--------------------------------------------------------------------- + Index Scan using idx_gt1_3 on gt1 (cost=0.42..8.44 rows=1 width=4) + Index Cond: ((a * 10) = 3) +(2 rows) + +reset search_path; +drop schema gtt_function cascade; +NOTICE: drop cascades to 17 other objects +DETAIL: drop cascades to table gtt_function.gtt1 +drop cascades to table gtt_function.gtt_test +drop cascades to table gtt_function.gtt2 +drop cascades to table gtt_function.gtt3 +drop cascades to table gtt_function.tmp_t0 +drop cascades to table gtt_function.tbl_inherits_parent +drop cascades to table gtt_function.tbl_inherits_parent_global_temp +drop cascades to table gtt_function.products +drop cascades to table gtt_function.measurement +drop cascades to table gtt_function.p_table01 +drop cascades to table gtt_function.p_table02 +drop cascades to table gtt_function.tbl_inherits_partition +drop cascades to table gtt_function.gtt5 +drop cascades to table gtt_function.mytable +drop cascades to table gtt_function.gtt_seq +drop cascades to table gtt_function.gt +drop cascades to table gtt_function.gt1 diff --git a/src/test/regress/expected/gtt_parallel_1.out b/src/test/regress/expected/gtt_parallel_1.out new file mode 100644 index 0000000..30d8a7b --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_1.out @@ -0,0 +1,84 @@ +set search_path=gtt,sys; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +truncate gtt1; +commit; +select * from gtt1 order by a; + a | b +---+--- +(0 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_parallel_2.out b/src/test/regress/expected/gtt_parallel_2.out new file mode 100644 index 0000000..850ef3e --- /dev/null +++ b/src/test/regress/expected/gtt_parallel_2.out @@ -0,0 +1,161 @@ +set search_path=gtt,sys; +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +commit; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 + 3 | test1 +(3 rows) + +rollback; +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test1 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 +(1 row) + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; + a | b +---+------- + 1 | test1 + 2 | test2 +(2 rows) + +truncate gtt3; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; + a | b +---+------- + 3 | test3 +(1 row) + +rollback; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +begin; +select * from gtt3 order by a; + a | b +---+--- +(0 rows) + +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; + a | b +---+------- + 5 | test5 +(1 row) + +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + a | b +---+------- + 6 | test6 +(1 row) + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; + count +-------- + 100000 +(1 row) + +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + QUERY PLAN +------------------------------------ + Index Scan using gtt3_pkey on gtt3 + Index Cond: (a = 300) +(2 rows) + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; + relname | pg_relation_size | pg_relation_size | pg_table_size | pg_indexes_size | pg_total_relation_size +--------------+------------------+------------------+---------------+-----------------+------------------------ + gtt_t_kenyon | 450560 | 8192 | 499712 | 475136 | 974848 +(1 row) + +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + relname +-------------- + gtt_t_kenyon +(1 row) + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + relname | pg_relation_size | pg_table_size | pg_total_relation_size +--------------------+------------------+---------------+------------------------ + idx_gtt_t_kenyon_1 | 65536 | 65536 | 65536 + idx_gtt_t_kenyon_2 | 409600 | 409600 | 409600 +(2 rows) + +reset search_path; diff --git a/src/test/regress/expected/gtt_prepare.out b/src/test/regress/expected/gtt_prepare.out new file mode 100644 index 0000000..9fe5fd4 --- /dev/null +++ b/src/test/regress/expected/gtt_prepare.out @@ -0,0 +1,9 @@ +CREATE SCHEMA IF NOT EXISTS gtt; +set search_path=gtt,sys; +create global temp table gtt1(a int primary key, b text) on commit delete rows; +create global temp table gtt2(a int primary key, b text) on commit delete rows; +create global temp table gtt3(a int primary key, b text); +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; diff --git a/src/test/regress/expected/gtt_stats.out b/src/test/regress/expected/gtt_stats.out new file mode 100644 index 0000000..b258b7c --- /dev/null +++ b/src/test/regress/expected/gtt_stats.out @@ -0,0 +1,76 @@ +CREATE SCHEMA IF NOT EXISTS gtt_stats; +set search_path=gtt_stats,sys; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + count +------- + 0 +(1 row) + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 0 +(1 row) + +insert into gtt values(generate_series(1,10000),'test'); +-- expect 1 +select count(*) from pg_gtt_attached_pids; + count +------- + 1 +(1 row) + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + count +------- + 2 +(1 row) + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 0 | 0 | 0 +(1 row) + +-- expect 0 +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+------------------+-------------+-------------------+------------------------+---------------------- +(0 rows) + +analyze gtt; +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + schemaname | tablename | relpages | reltuples | relallvisible +------------+-----------+----------+-----------+--------------- + gtt_stats | gtt | 55 | 10000 | 0 +(1 row) + +select * from pg_gtt_stats order by tablename; + schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram +------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------------------+------------------------+---------------------- + gtt_stats | gtt | a | f | 0 | 4 | -1 | | | {1,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,8700,8800,8900,9000,9100,9200,9300,9400,9500,9600,9700,9800,9900,10000} | 1 | | | + gtt_stats | gtt | b | f | 0 | 5 | 1 | {test} | {1} | | 1 | | | +(2 rows) + +reset search_path; +drop schema gtt_stats cascade; +NOTICE: drop cascades to table gtt_stats.gtt diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 2ab2115..4f4eb46 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1349,6 +1349,93 @@ pg_group| SELECT pg_authid.rolname AS groname, WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin); +pg_gtt_attached_pids| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relid, + s.pid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_gtt_attached_pid(c.oid) s(relid, pid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_relstats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + s.relpages, + s.reltuples, + s.relallvisible, + s.relfrozenxid, + s.relminmxid + FROM (pg_class c + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_relstats(c.oid) s(relpages, reltuples, relallvisible, relfrozenxid, relminmxid) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); +pg_gtt_stats| SELECT n.nspname AS schemaname, + c.relname AS tablename, + a.attname, + s.stainherit AS inherited, + s.stanullfrac AS null_frac, + s.stawidth AS avg_width, + s.stadistinct AS n_distinct, + CASE + WHEN (s.stakind1 = 1) THEN s.stavalues1 + WHEN (s.stakind2 = 1) THEN s.stavalues2 + WHEN (s.stakind3 = 1) THEN s.stavalues3 + WHEN (s.stakind4 = 1) THEN s.stavalues4 + WHEN (s.stakind5 = 1) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_vals, + CASE + WHEN (s.stakind1 = 1) THEN s.stanumbers1 + WHEN (s.stakind2 = 1) THEN s.stanumbers2 + WHEN (s.stakind3 = 1) THEN s.stanumbers3 + WHEN (s.stakind4 = 1) THEN s.stanumbers4 + WHEN (s.stakind5 = 1) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_freqs, + CASE + WHEN (s.stakind1 = 2) THEN s.stavalues1 + WHEN (s.stakind2 = 2) THEN s.stavalues2 + WHEN (s.stakind3 = 2) THEN s.stavalues3 + WHEN (s.stakind4 = 2) THEN s.stavalues4 + WHEN (s.stakind5 = 2) THEN s.stavalues5 + ELSE NULL::text[] + END AS histogram_bounds, + CASE + WHEN (s.stakind1 = 3) THEN s.stanumbers1[1] + WHEN (s.stakind2 = 3) THEN s.stanumbers2[1] + WHEN (s.stakind3 = 3) THEN s.stanumbers3[1] + WHEN (s.stakind4 = 3) THEN s.stanumbers4[1] + WHEN (s.stakind5 = 3) THEN s.stanumbers5[1] + ELSE NULL::real + END AS correlation, + CASE + WHEN (s.stakind1 = 4) THEN s.stavalues1 + WHEN (s.stakind2 = 4) THEN s.stavalues2 + WHEN (s.stakind3 = 4) THEN s.stavalues3 + WHEN (s.stakind4 = 4) THEN s.stavalues4 + WHEN (s.stakind5 = 4) THEN s.stavalues5 + ELSE NULL::text[] + END AS most_common_elems, + CASE + WHEN (s.stakind1 = 4) THEN s.stanumbers1 + WHEN (s.stakind2 = 4) THEN s.stanumbers2 + WHEN (s.stakind3 = 4) THEN s.stanumbers3 + WHEN (s.stakind4 = 4) THEN s.stanumbers4 + WHEN (s.stakind5 = 4) THEN s.stanumbers5 + ELSE NULL::real[] + END AS most_common_elem_freqs, + CASE + WHEN (s.stakind1 = 5) THEN s.stanumbers1 + WHEN (s.stakind2 = 5) THEN s.stanumbers2 + WHEN (s.stakind3 = 5) THEN s.stanumbers3 + WHEN (s.stakind4 = 5) THEN s.stanumbers4 + WHEN (s.stakind5 = 5) THEN s.stanumbers5 + ELSE NULL::real[] + END AS elem_count_histogram + FROM ((pg_class c + JOIN pg_attribute a ON ((c.oid = a.attrelid))) + LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))), + LATERAL pg_get_gtt_statistics(c.oid, (a.attnum)::integer, ''::text) s(starelid, staattnum, stainherit, stanullfrac, stawidth, stadistinct, stakind1, stakind2, stakind3, stakind4, stakind5, staop1, staop2, staop3, staop4, staop5, stacoll1, stacoll2, stacoll3, stacoll4, stacoll5, stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5, stavalues1, stavalues2, stavalues3, stavalues4, stavalues5) + WHERE ((c.relpersistence = 'g'::"char") AND (c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND (NOT a.attisdropped) AND has_column_privilege(c.oid, a.attnum, 'select'::text) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid)))); pg_hba_file_rules| SELECT a.line_number, a.type, a.database, diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index d2b17dd..80e577f 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -121,3 +121,10 @@ test: fast_default # run stats by itself because its delay may be insufficient under heavy load test: stats + +# global temp table test +test: gtt_stats +test: gtt_function +test: gtt_prepare +test: gtt_parallel_1 gtt_parallel_2 +test: gtt_clean diff --git a/src/test/regress/sql/gtt_clean.sql b/src/test/regress/sql/gtt_clean.sql new file mode 100644 index 0000000..f3cf710 --- /dev/null +++ b/src/test/regress/sql/gtt_clean.sql @@ -0,0 +1,6 @@ + + +reset search_path; + +drop schema gtt cascade; + diff --git a/src/test/regress/sql/gtt_function.sql b/src/test/regress/sql/gtt_function.sql new file mode 100644 index 0000000..784c537 --- /dev/null +++ b/src/test/regress/sql/gtt_function.sql @@ -0,0 +1,187 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_function; + +set search_path=gtt_function,sys; + +create global temp table gtt1(a int primary key, b text); + +create global temp table gtt_test_rename(a int primary key, b text); + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text) on commit PRESERVE rows; + +create global temp table tmp_t0(c0 tsvector,c1 varchar(100)); + +create table tbl_inherits_parent( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +); + +create global temp table tbl_inherits_parent_global_temp( +a int not null, +b varchar(32) not null default 'Got u', +c int check (c > 0), +d date not null +)on commit delete rows; + +CREATE global temp TABLE products ( + product_no integer PRIMARY KEY, + name text, + price numeric +); + +-- ERROR +create index CONCURRENTLY idx_gtt1 on gtt1 (b); + +-- ERROR +cluster gtt1 using gtt1_pkey; + +-- ERROR +create table gtt1(a int primary key, b text) on commit delete rows; + +-- ok +create table gtt1(a int primary key, b text) with(on_commit_delete_rows=true); + +-- ok +CREATE global temp TABLE measurement ( + logdate date not null, + peaktemp int, + unitsales int +) PARTITION BY RANGE (logdate); + +--ok +CREATE global temp TABLE p_table01 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +)on commit delete rows; + +CREATE global temp TABLE p_table01_2018 +PARTITION OF p_table01 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table01_2017 +PARTITION OF p_table01 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +begin; +insert into p_table01 values(1,'2018-01-02 00:00:00','test1'); +insert into p_table01 values(1,'2018-01-02 00:00:00','test2'); +select count(*) from p_table01; +commit; + +select count(*) from p_table01; + +--ok +CREATE global temp TABLE p_table02 ( +id bigserial NOT NULL, +cre_time timestamp without time zone, +note varchar(30) +) PARTITION BY RANGE (cre_time) +WITH ( +OIDS = FALSE +) +on commit PRESERVE rows; + +CREATE global temp TABLE p_table02_2018 +PARTITION OF p_table02 +FOR VALUES FROM ('2018-01-01 00:00:00') TO ('2019-01-01 00:00:00'); + +CREATE global temp TABLE p_table02_2017 +PARTITION OF p_table02 +FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2018-01-01 00:00:00'); + +-- ok +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent); +create global temp table tbl_inherits_partition() inherits (tbl_inherits_parent_global_temp) on commit delete rows; + +select relname ,relkind, relpersistence, reloptions from pg_class where relname like 'p_table0%' or relname like 'tbl_inherits%' order by relname; + +-- ERROR +create global temp table gtt3(a int primary key, b text) on commit drop; + +-- ERROR +create global temp table gtt4(a int primary key, b text) with(on_commit_delete_rows=true) on commit delete rows; + +-- ok +create global temp table gtt5(a int primary key, b text) with(on_commit_delete_rows=true); + +--ok +alter table gtt_test_rename rename to gtt_test; + +-- ok +ALTER TABLE gtt_test ADD COLUMN address varchar(30); + +-- ERROR +CREATE TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE global temp TABLE orders ( + order_id integer PRIMARY KEY, + product_no integer REFERENCES products (product_no), + quantity integer +); + +-- ERROR +CREATE GLOBAL TEMPORARY TABLE mytable ( + id SERIAL PRIMARY KEY, + data text +) on commit preserve rows; + +-- ok +create global temp table gtt_seq(id int GENERATED ALWAYS AS IDENTITY (START WITH 2) primary key, a int) on commit PRESERVE rows; +insert into gtt_seq (a) values(1); +insert into gtt_seq (a) values(2); +select * from gtt_seq order by id; +truncate gtt_seq; +select * from gtt_seq order by id; +insert into gtt_seq (a) values(3); +select * from gtt_seq order by id; + +--ERROR +CREATE MATERIALIZED VIEW mv_gtt1 as select * from gtt1; + +-- ALL ERROR +create index idx_err on gtt1 using hash (a); +create index idx_err on gtt1 using gist (a); +create index idx_tmp_t0_1 on tmp_t0 using gin (c0); +create index idx_tmp_t0_1 on tmp_t0 using gist (c0); + +--ok +create global temp table gt (a SERIAL,b int); +begin; +set transaction_read_only = true; +insert into gt (b) values(1); +select * from gt; +commit; + +--ok +create global temp table gt1(a int); +insert into gt1 values(generate_series(1,100000)); +create index idx_gt1_1 on gt1 (a); +create index idx_gt1_2 on gt1((a + 1)); +create index idx_gt1_3 on gt1((a*10),(a+a),(a-1)); +explain select * from gt1 where a=1; +explain select * from gt1 where a=200000; +explain select * from gt1 where a*10=300; +explain select * from gt1 where a*10=3; +analyze gt1; +explain select * from gt1 where a=1; +explain select * from gt1 where a=200000; +explain select * from gt1 where a*10=300; +explain select * from gt1 where a*10=3; + +reset search_path; + +drop schema gtt_function cascade; + diff --git a/src/test/regress/sql/gtt_parallel_1.sql b/src/test/regress/sql/gtt_parallel_1.sql new file mode 100644 index 0000000..d7d81de --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_1.sql @@ -0,0 +1,42 @@ + + +set search_path=gtt,sys; + +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +commit; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +rollback; +select * from gtt1 order by a; + +truncate gtt1; +select * from gtt1 order by a; + +begin; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +select * from gtt1 order by a; +insert into gtt1 values(1, 'test1'); +rollback; +select * from gtt1 order by a; + +begin; +select * from gtt1 order by a; +truncate gtt1; +insert into gtt1 values(1, 'test1'); +select * from gtt1 order by a; +truncate gtt1; +commit; +select * from gtt1 order by a; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_parallel_2.sql b/src/test/regress/sql/gtt_parallel_2.sql new file mode 100644 index 0000000..5203c2b --- /dev/null +++ b/src/test/regress/sql/gtt_parallel_2.sql @@ -0,0 +1,76 @@ + + +set search_path=gtt,sys; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test1'); +select * from gtt3 order by a; +commit; +select * from gtt3 order by a; + +begin; +insert into gtt3 values(3, 'test1'); +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +truncate gtt3; +select * from gtt3 order by a; + +insert into gtt3 values(1, 'test1'); +select * from gtt3 order by a; + +begin; +insert into gtt3 values(2, 'test2'); +select * from gtt3 order by a; +truncate gtt3; +select * from gtt3 order by a; +insert into gtt3 values(3, 'test3'); +update gtt3 set a = 3 where b = 'test1'; +select * from gtt3 order by a; +rollback; +select * from gtt3 order by a; + +begin; +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(5, 'test5'); +select * from gtt3 order by a; +truncate gtt3; +insert into gtt3 values(6, 'test6'); +commit; +select * from gtt3 order by a; + +truncate gtt3; +insert into gtt3 values(generate_series(1,100000), 'testing'); +select count(*) from gtt3; +analyze gtt3; +explain (COSTS FALSE) select * from gtt3 where a =300; + +insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500); +insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000); +insert into gtt_t_kenyon select generate_series(3,4),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',4000); +insert into gtt_t_kenyon select generate_series(5,6),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',5500); +select relname, pg_relation_size(oid),pg_relation_size(reltoastrelid),pg_table_size(oid),pg_indexes_size(oid),pg_total_relation_size(oid) from pg_class where relname = 'gtt_t_kenyon'; +select relname from pg_class where relname = 'gtt_t_kenyon' and reltoastrelid != 0; + +select +c.relname, pg_relation_size(c.oid),pg_table_size(c.oid),pg_total_relation_size(c.oid) +from +pg_class c +where +c.oid in +( +select +i.indexrelid as indexrelid +from +pg_index i ,pg_class cc +where cc.relname = 'gtt_t_kenyon' and cc.oid = i.indrelid +) +order by c.relname; + +reset search_path; + diff --git a/src/test/regress/sql/gtt_prepare.sql b/src/test/regress/sql/gtt_prepare.sql new file mode 100644 index 0000000..2f4d883 --- /dev/null +++ b/src/test/regress/sql/gtt_prepare.sql @@ -0,0 +1,16 @@ + +CREATE SCHEMA IF NOT EXISTS gtt; + +set search_path=gtt,sys; + +create global temp table gtt1(a int primary key, b text) on commit delete rows; + +create global temp table gtt2(a int primary key, b text) on commit delete rows; + +create global temp table gtt3(a int primary key, b text); + +create global temp table gtt_t_kenyon(id int,vname varchar(48),remark text) on commit PRESERVE rows; +create index idx_gtt_t_kenyon_1 on gtt_t_kenyon(id); +create index idx_gtt_t_kenyon_2 on gtt_t_kenyon(remark); +reset search_path; + diff --git a/src/test/regress/sql/gtt_stats.sql b/src/test/regress/sql/gtt_stats.sql new file mode 100644 index 0000000..f041892 --- /dev/null +++ b/src/test/regress/sql/gtt_stats.sql @@ -0,0 +1,42 @@ + +CREATE SCHEMA IF NOT EXISTS gtt_stats; + +set search_path=gtt_stats,sys; + +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +create global temp table gtt(a int primary key, b text) on commit PRESERVE rows; +-- expect 0 +select count(*) from pg_gtt_attached_pids; + +-- expect 0 +select count(*) from pg_list_gtt_relfrozenxids(); + +insert into gtt values(generate_series(1,10000),'test'); + +-- expect 1 +select count(*) from pg_gtt_attached_pids; + +-- expect 2 +select count(*) from pg_list_gtt_relfrozenxids(); + +-- expect 0 +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +-- expect 0 +select * from pg_gtt_stats order by tablename; + +analyze gtt; + +select schemaname, tablename, relpages, reltuples, relallvisible from pg_gtt_relstats order by tablename; + +select * from pg_gtt_stats order by tablename; + +reset search_path; + +drop schema gtt_stats cascade; + ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-30 14:21 Pavel Stehule <[email protected]> parent: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Pavel Stehule @ 2020-01-30 14:21 UTC (permalink / raw) To: 曾文旌(义从) <[email protected]>; +Cc: Robert Haas <[email protected]>; Tomas Vondra <[email protected]>; Konstantin Knizhnik <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> čt 30. 1. 2020 v 15:17 odesílatel 曾文旌(义从) <[email protected]> napsal: > > > > 2020年1月29日 下午9:48,Robert Haas <[email protected]> 写道: > > > > On Tue, Jan 28, 2020 at 12:12 PM 曾文旌(义从) <[email protected]> > wrote: > >>> Opinion by Pavel > >>> + rel->rd_islocaltemp = true; <<<<<<< if this is valid, then the name > of field "rd_islocaltemp" is not probably best > >>> I renamed rd_islocaltemp > >> > >> I don't see any change? > >> > >> Rename rd_islocaltemp to rd_istemp in > global_temporary_table_v8-pg13.patch > > > > In view of commit 6919b7e3294702adc39effd16634b2715d04f012, I think > > that this has approximately a 0% chance of being acceptable. If you're > > setting a field in a way that is inconsistent with the current use of > > the field, you're probably doing it wrong, because the field has an > > existing purpose to which new code must conform. And if you're not > > doing that, then you don't need to rename it. > Thank you for pointing it out. > I've rolled back the rename. > But I still need rd_localtemp to be true, The reason is that > 1 GTT The GTT needs to support DML in read-only transactions ,like local > temp table. > 2 GTT does not need to hold the lock before modifying the index buffer > ,also like local temp table. > > Please give me feedback. > maybe some like rel->rd_globaltemp = true; and somewhere else if (rel->rd_localtemp || rel->rd_globaltemp) { ... } > > Wenjing > > > > > > > > -- > > Robert Haas > > EnterpriseDB: http://www.enterprisedb.com > > The Enterprise PostgreSQL Company > > ^ permalink raw reply [nested|flat] 1038+ messages in thread
* Re: [Proposal] Global temporary tables @ 2020-01-31 19:38 Robert Haas <[email protected]> parent: Konstantin Knizhnik <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Robert Haas @ 2020-01-31 19:38 UTC (permalink / raw) To: Konstantin Knizhnik <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Tomas Vondra <[email protected]>; 曾文旌(义从) <[email protected]>; pgsql-hackers; 蔡松露(子嘉) <[email protected]>; Cai, Le <[email protected]>; 萧少聪(铁庵) <[email protected]> On Thu, Jan 30, 2020 at 4:33 AM Konstantin Knizhnik <[email protected]> wrote: > On 29.01.2020 21:16, Robert Haas wrote: > > On Wed, Jan 29, 2020 at 10:30 AM Konstantin Knizhnik > > <[email protected]> wrote: > > > > I think that the idea of calling ambuild() on the fly is not going to > > work, because, again, I don't think that calling that from random > > places in the code is safe. > > It is not a random place in the code. > Actually it is just one place - _bt_getbuf > Why it can be unsafe if it affects only private backends data? Because, as I already said, not every operation is safe at every point in the code. This is true even when there's no concurrency involved. For example, executing user-defined code is not safe while holding a buffer lock, because the user-defined code might try to do something that locks the same buffer, which would cause an undetected, uninterruptible deadlock. > But GTT case is different. Heap and indexes can be easily initialized by > backend using existed functions. That would be nice if we could make it work. Someone would need to show, however, that it's safe. > You say that it not safe. But you have not explained why it is unsafe. > Yes, I agree that it is my responsibility to prove that it is safe. > And as I already wrote, I can not provide such proof now. I will be > pleased if you or anybody else can help to convince that this approach > is safe or demonstrate problems with this approach. That's fair, but nobody's obliged to spend time on that. > But I really like to receive more constructive critics rather than "this > approach is wrong because it is unsafe". I'm sure, and that's probably valid. Equally, however, I'd like to receive more analysis of why it is safe than "I don't see anything wrong with it so it's probably fine." And I think that's pretty valid, too. > Actually index is not created on the fly. > Index is created is usual way, by executing "create index" command. > So all components of the Postgres (planner, executor,...) treat GTT > indexes in the same way as regular indexes. > Locking and invalidations policies are exactly the same for them. > The only difference is that content of GTT index is constructed on > demand using private backend data. > Is it safe or not? We are just reading data from local buffers/files and > writing them here. > May be I missed something but I do not see any unsafety here. > There are issues with updating statistic but them can be solved. But that's not all you are doing. To build the index, you'll have to sort the data. To sort the data, you'll have to call btree support functions. Those functions can be user-defined, and can do complex operations like catalog access that depend on a good transaction state, no buffer locks being held, and nothing already in progress within this backend that can get confused as a result of this operation. Just as a quick test, I tried doing this in _bt_getbuf: + if (InterruptHoldoffCount != 0) + elog(WARNING, "INTERRUPTS ARE HELD OFF"); That causes 103 out of 196 regression tests to fail, which means that it's pretty common to arrive in _bt_getbuf() with interrupts held off. At the very least, that means that the index build would be uninterruptible, which already seems unacceptable. Probably, it means that the calling code is already holding an LWLock, because that's normally what causes HOLD_INTERRUPTS() to happen. And as I have already explained, that is super-problematic, because of deadlock risks, and because it risks putting other backends into non-interruptible waits if they should happen to need the LWLock we're holding here. I really don't understand why the basic point here remains obscure. In general, it tends to be unsafe to call high-level code from low-level code, not just in PostgreSQL but in pretty much any program. Do you think that we can safely add a GUC that executes a user-defined SQL query every time an LWLock is acquired? If you do, why don't you try adding code to do that to LWLockAcquire and testing it out a little bit? Try making the SQL query do something like query pg_class, find a table name that's not in use, and create a table by that name. Then run the regression tests with the GUC set to run that query and see how it goes. I always hate to say that things are "obvious," because what's obvious to me may not be obvious to somebody else, but it is clear to me, at least, that this has no chance of working. Even though I can't say exactly what will break, or what will break first, I'm very sure that a lot of things will break and that most of them are unfixable. Now, your idea is not quite as crazy as that, but it has the same basic problem: you can't insert code into a low-level facility that uses a high level facility which may in turn use and depend on that very same low-level facility to not be in the middle of an operation. If you do, it's going to break somehow. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
* [PATCH] Fix tests under wal_level=minimal @ 2026-04-07 11:16 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 1038+ messages in thread From: Álvaro Herrera @ 2026-04-07 11:16 UTC (permalink / raw) Buildfarm members which have specifically configured to use wal_level=minimal fail the repack regression tests, which require wal_level=replica. Add a temp config file to fix that. --- src/test/modules/injection_points/Makefile | 3 +++ src/test/modules/injection_points/meson.build | 4 ++++ src/test/modules/injection_points/wal_level.conf | 1 + 3 files changed, 8 insertions(+) create mode 100644 src/test/modules/injection_points/wal_level.conf diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile index 2cd7d87c533..2c7abe93632 100644 --- a/src/test/modules/injection_points/Makefile +++ b/src/test/modules/injection_points/Makefile @@ -19,6 +19,9 @@ ISOLATION = basic \ syscache-update-pruned \ heap_lock_update +# some isolation tests require wal_level=replica +ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/injection_points/wal_level.conf + # The injection points are cluster-wide, so disable installcheck NO_INSTALLCHECK = 1 diff --git a/src/test/modules/injection_points/meson.build b/src/test/modules/injection_points/meson.build index a414abb924b..7a838259685 100644 --- a/src/test/modules/injection_points/meson.build +++ b/src/test/modules/injection_points/meson.build @@ -53,5 +53,9 @@ tests += { 'runningcheck': false, # see syscache-update-pruned # Some tests wait for all snapshots, so avoid parallel execution 'runningcheck-parallel': false, + # some tests require wal_level=replica + 'regress_args': [ + '--temp-config', files('wal_level.conf'), + ], }, } diff --git a/src/test/modules/injection_points/wal_level.conf b/src/test/modules/injection_points/wal_level.conf new file mode 100644 index 00000000000..010abb193a8 --- /dev/null +++ b/src/test/modules/injection_points/wal_level.conf @@ -0,0 +1 @@ +wal_level=replica -- 2.47.3 --j4ov4p7gfxgiujzz-- ^ permalink raw reply [nested|flat] 1038+ messages in thread
end of thread, other threads:[~2026-04-07 11:16 UTC | newest] Thread overview: 1038+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-01-05 20:06 Re: [Proposal] Global temporary tables Tomas Vondra <[email protected]> 2020-01-06 05:04 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-06 11:01 ` Tomas Vondra <[email protected]> 2020-01-06 12:17 ` Dean Rasheed <[email protected]> 2020-01-06 12:52 ` Tomas Vondra <[email protected]> 2020-01-06 13:50 ` Pavel Stehule <[email protected]> 2020-01-08 07:03 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-09 15:07 ` Konstantin Knizhnik <[email protected]> 2020-01-09 16:30 ` Tomas Vondra <[email protected]> 2020-01-10 12:24 ` Konstantin Knizhnik <[email protected]> 2020-01-12 01:14 ` Tomas Vondra <[email protected]> 2020-01-14 14:15 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-09 11:17 ` Konstantin Knizhnik <[email protected]> 2020-01-09 16:48 ` Tomas Vondra <[email protected]> 2020-01-10 08:47 ` Konstantin Knizhnik <[email protected]> 2020-01-12 01:51 ` Tomas Vondra <[email protected]> 2020-01-13 08:08 ` Konstantin Knizhnik <[email protected]> 2020-01-13 16:32 ` Tomas Vondra <[email protected]> 2020-01-13 20:12 ` Julien Rouhaud <[email protected]> 2020-01-13 21:03 ` Tomas Vondra <[email protected]> 2020-01-15 13:10 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-16 07:23 ` Konstantin Knizhnik <[email protected]> 2020-01-23 20:47 ` Robert Haas <[email protected]> 2020-01-24 08:39 ` Konstantin Knizhnik <[email protected]> 2020-01-24 09:09 ` Pavel Stehule <[email protected]> 2020-01-24 09:43 ` Konstantin Knizhnik <[email protected]> 2020-01-24 12:15 ` Pavel Stehule <[email protected]> 2020-01-24 13:17 ` Konstantin Knizhnik <[email protected]> 2020-01-24 19:39 ` Pavel Stehule <[email protected]> 2020-01-27 09:11 ` Konstantin Knizhnik <[email protected]> 2020-01-27 19:44 ` Pavel Stehule <[email protected]> 2020-01-29 08:12 ` Konstantin Knizhnik <[email protected]> 2020-01-29 14:47 ` Robert Haas <[email protected]> 2020-01-29 15:30 ` Konstantin Knizhnik <[email protected]> 2020-01-29 17:08 ` Pavel Stehule <[email protected]> 2020-01-29 17:21 ` Konstantin Knizhnik <[email protected]> 2020-01-29 17:37 ` Pavel Stehule <[email protected]> 2020-01-30 08:45 ` Konstantin Knizhnik <[email protected]> 2020-01-30 09:23 ` Pavel Stehule <[email protected]> 2020-01-30 09:44 ` Konstantin Knizhnik <[email protected]> 2020-01-30 09:52 ` Pavel Stehule <[email protected]> 2020-01-30 10:02 ` Konstantin Knizhnik <[email protected]> 2020-01-30 10:10 ` Pavel Stehule <[email protected]> 2020-01-29 18:16 ` Robert Haas <[email protected]> 2020-01-30 09:33 ` Konstantin Knizhnik <[email protected]> 2020-01-31 19:38 ` Robert Haas <[email protected]> 2020-01-29 13:43 ` Robert Haas <[email protected]> 2020-01-28 16:01 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-28 16:40 ` Pavel Stehule <[email protected]> 2020-01-28 17:12 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-28 17:13 ` Pavel Stehule <[email protected]> 2020-01-28 17:54 ` Pavel Stehule <[email protected]> 2020-01-29 13:06 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-30 14:06 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-29 13:48 ` Robert Haas <[email protected]> 2020-01-30 14:17 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-30 14:21 ` Pavel Stehule <[email protected]> 2020-01-11 14:00 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-11 20:27 ` Pavel Stehule <[email protected]> 2020-01-14 13:09 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-14 13:20 ` Pavel Stehule <[email protected]> 2020-01-14 14:16 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-19 17:04 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-19 17:32 ` Erik Rijkers <[email protected]> 2020-01-20 16:27 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-21 05:43 ` Pavel Stehule <[email protected]> 2020-01-22 05:29 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-23 16:28 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-23 17:21 ` Pavel Stehule <[email protected]> 2020-01-24 08:20 ` Konstantin Knizhnik <[email protected]> 2020-01-25 15:15 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-27 09:38 ` Konstantin Knizhnik <[email protected]> 2020-01-21 08:45 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-21 18:51 ` Pavel Stehule <[email protected]> 2020-01-22 06:16 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2020-01-22 06:31 ` Pavel Stehule <[email protected]> 2020-01-23 16:22 ` =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]> 2026-04-07 11:16 [PATCH] Fix tests under wal_level=minimal Álvaro Herrera <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox